我想制造一个不和谐的音乐机器人。我用youtube-dl检索信息,用ffmpeg播放音频。我的机器人下载视频没有问题,而且一切正常。但是当我尝试下载某些视频时,出现了一个错误:
[dash @ 0x7fe45a801200] Manifest too large: 65055
https://manifest.googlevideo.com/api/manifest/dash/expire/1606336104/ei/CGq-X4G6Htauz7sPrZuCsA8/ip/14.192.212.39/id/64a943d43b8f53eb/source/youtube/requiressl/yes/playback_host/r5---sn-h5mpn-30ae.googlevideo.com/mh/Go/mm/31%2C29/mn/sn-h5mpn-30ae%2Csn-30a7rn7l/ms/au%2Crdu/mv/m/mvi/5/pl/24/hfr/all/as/fmp4_audio_clear%2Cwebm_audio_clear%2Cwebm2_audio_clear%2Cfmp4_sd_hd_clear%2Cwebm2_sd_hd_clear/initcwndbps/533750/vprv/1/mt/1606314038/fvip/5/keepalive/yes/beids/23927369/itag/0/sparams/expire%2Cei%2Cip%2Cid%2Csource%2Crequiressl%2Chfr%2Cas%2Cvprv%2Citag/sig/AOq0QJ8wRQIhAOn6Br0QsuXc-3unfhYdzXVXcydzVWioIQlKvv2U4i3OAiB6ApoiqFoPvE3YKYGPbRiId_bHQYO8zsawGGPMidYGAA%3D%3D/lsparams/playback_host%2Cmh%2Cmm%2Cmn%2Cms%2Cmv%2Cmvi%2Cpl%2Cinitcwndbps/lsig/AG3C_xAwRQIhANmxfRNBI4wSJo6trsKkq8GinQ-ADMxgHRmelBwM-GEAAiAafey9YRrZz1h1S6PzV3u0S6IsZUKscGrrGP9Pofv2uQ%3D%3D: Invalid data found when processing input在尝试下载其他没有问题的视频之后,我发现显示这些错误的视频有一个额外的步骤来下载MPD清单。我会尝试下载更大的视频,它会工作,但只是这些特定的视频,持续时间约7-10分钟,才会出现这些错误。我真的迷路了。
这是我在语音频道播放视频的代码:
voice = get(client.voice_clients, guild = ctx.guild)
with YoutubeDL(ydl_opts) as ydl:
info = ydl.extract_info(url[playlist], download = False)
URL = info['formats'][0]['url']
voice.play(FFmpegPCMAudio(URL, **FFMPEG_OPTIONS))发布于 2020-11-27 14:46:01
我也面临着这个问题。在四处搜索时,我发现了一个线程:ffmpeg "Manifest too large" when downloading youtube video。所以我想要做的是youtube-dl --youtube-skip-dash-manifest,但是由于我们是从python运行它的,所以有点不同。为了弄清楚我需要做什么,我使用了python:
$ python -i
Python 3.7.5 (default, Nov 7 2019, 10:50:52)
[GCC 8.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import youtube_dl as ytdl
>>> help(ytdl)这就引出了YoutubeDL的文档。键入"/“以启动搜索,然后键入搜索字符串。我搜索了“清单”并按了enter键。它提出了这个问题:
| youtube_include_dash_manifest: If True (default), DASH manifests and related
| data will be downloaded and processed by extractor.
| You can reduce network I/O by disabling it if you don't
| care about DASH.看来这正是我所需要的。然后,我将该密钥包含在我的字典(您的ydl_opts)中,如下所示:
ydl_opts = {
'quiet': False,
'default_search': 'ytsearch',
'format': 'bestaudio/best',
'youtube_include_dash_manifest': False,
}这解决了我的问题,希望它也能解决你的问题。
https://stackoverflow.com/questions/65006795
复制相似问题