【发布时间】:2023-01-01 02:26:12
【问题描述】:
这是我使用 Python 的代码(简化版):
import yt_dlp
YDL_OPTIONS = {
'format': 'bestaudio*',
'noplaylist': True,
}
with yt_dlp.YoutubeDL(YDL_OPTIONS) as ydl:
info = ydl.extract_info(url, download=False)
当 url 指向播放列表时出现问题
(例如https://www.youtube.com/playlist?list=PLlrATfBNZ98dudnM48yfGUldqGD0S4FFb)
这是输出:
[youtube:tab] PLlrATfBNZ98dudnM48yfGUldqGD0S4FFb: Downloading webpage
[youtube:tab] PLlrATfBNZ98dudnM48yfGUldqGD0S4FFb: Downloading API JSON with unavailable videos
[download] Downloading playlist: C++
[youtube:tab] playlist C++: Downloading 100 videos
[download] Downloading video 1 of 100
[youtube] 18c3MTX0PK0: Downloading webpage
[youtube] 18c3MTX0PK0: Downloading android player API JSON
[download] Downloading video 2 of 100
[youtube] 1OsGXuNA5cc: Downloading webpage
[youtube] 1OsGXuNA5cc: Downloading android player API JSON
[download] Downloading video 3 of 100
[youtube] 1E_kBSka_ec: Downloading webpage
[youtube] 1E_kBSka_ec: Downloading android player API JSON
...
如您所见,'无播放列表'选项在这种情况下不起作用。
是否有选项或功能使ydl在整个播放列表中仅提取一个视频信息,例如第一个?
【问题讨论】:
标签: python youtube youtube-dl yt-dlp