ydl = youtube_dl.YoutubeDL()
with ydl:
r = ydl.extract_info("myplaylist", download=False) # don't download, much faster
print(r['uploader'],r['title'],r['thumbnail'])
Run Code Online (Sandbox Code Playgroud)
代码输出是这样的
[youtube:playlist] Downloading playlist playlistidhere - add --no-playlist to just download video videoid
[youtube:playlist] playlistidhere: Downloading webpage
[download] Downloading playlist: playlistnamehere
[youtube:playlist] playlist Spotlight On: June Recap: Downloading 39 videos
[download] Downloading video 1 of 39
[youtube] video_id: Downloading webpage
[youtube] video_id: Downloading video info webpage
[youtube] video_id: Extracting video information
[download] Downloading video 2 of 39
[youtube] video_id2: Downloading webpage
[youtube] video_id2: Downloading video …Run Code Online (Sandbox Code Playgroud)