Member-only story
Using Pycharm 2020.3
It is the way to enhance the efficiency of downloading the videos from the playlist automatically. Hope this one helps the people who look for it.
It needs 2 module packages, youtube_dl, and OS. Please read the documentation.
Just change the URL, and replace it with the URL you want.
import youtube_dl
import os
videoDir = os.path.join(os.getcwd(), "video") #C:\Users\win\PycharmProjects\pythonProject2\video)
class downloader:
def ydl_playlist_downloader(self, playlist):
self.playlist = playlist
print("videoDir :{}".format(videoDir))
#for playlist input in the ydl_opts function
ydl_opts = {}
with youtube_dl.YoutubeDL(ydl_opts) as ydl:
playlist_dict = ydl.extract_info(playlist, download=False)
print(playlist_dict.keys())
print(playlist_dict.get('title'))
playlist_dict = ydl.extract_info(playlist, download=True)
downloader = downloader()
url = "https://www.youtube.com/playlist?list=PLtt_YYUGi1gURt5igZoCr1p_nFnb8ZBzS"
ydl = downloader.ydl_playlist_downloader(url)
If you’ve found any of my articles helpful or useful then please consider throwing a coffee my way to help support my work or give me patronage😊, by using
Last but not least, if you are not a Medium Member yet and plan to become one, I kindly ask you to…