youtubedl仅在中提取播放列表

2024-04-23 11:22:55 发布

您现在位置:Python中文网/ 问答频道 /正文

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'])

这样的代码输出

[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 info webpage
[youtube] video_id2: Extracting video information
[download] Downloading video 3 of 39
[youtube] video_id3: Downloading webpage
[youtube] video_id3: Downloading video info webpage
[youtube] video_id3: Extracting video information
[download] Downloading video 4 of 39
[download] Downloading video 39 of 39
[youtube] video_id4: Downloading webpage
[youtube] video_id4: Downloading video info webpage
[youtube] video_id4: Extracting video information
Traceback (most recent call last):
  File "<input>", line 5, in <module>
KeyError: 'uploader'

但我只想要youtube播放列表信息 我的问题是如何获得播放列表的上传程序、thumnail、所有视频缩略图、视频标题、播放列表标题等


Tags: ofinfoidinformationyoutubedownloadvideoplaylist