我昨天在 GitHub 支持页面上发布了一个关于此的问题,它被标记为重复 - 原始答案在这里。此问题不会像该用户那样自动修复。相反,它似乎来来去去没有模式,所以我没有复制它的好方法。有些歌曲会在某个时间点播放,但几分钟后就不会播放了。
错误:
[debug] Encodings: locale cp1252, fs utf-8, out UTF-8, pref cp1252
[debug] youtube-dl version 2020.09.20
[debug] Python version 3.7.8 (CPython) - Windows-10-10.0.19041-SP0
[youtube:search] query "iron man 3 song": Downloading page 1
[debug] exe versions: none
[debug] Proxy map: {}
ERROR: query "song name": Failed to parse JSON caused by JSONDecodeError('Expecting value: line 1 column 1 (char 0)')); please report this issue on https://yt-dl.org/bug . Make sure you are using the latest version; see https://yt-dl.org/update on how to update. Be sure to call youtube-dl with the --verbose flag and include its complete output.
尝试从视频中提取数据时遇到问题。这是我正在使用的代码片段:
ydlOps = {
'format': 'bestaudio/best',
'outtmpl': './%(title)s.webm',
'noplaylist': True,
'extractaudio': True,
'audioformat': 'webm',
'default_search': 'ytsearch1',
'quite': True,
'verbose':True,
'version': True
}
with youtube_dl.YoutubeDL(ydlOps) as downloader:
songData = downloader.extract_info(url, download=download)
我已经更改了选项,尝试了其他据说有效的选项,但似乎没有任何改变。有些会起作用,然后不会,然后它们会再次起作用。