Python的 - YouTube的-dl.utils.DownloadError:ERROR:音频转换失败:文件:MP3无效参数

问题描述:

youtube-dl.utils.DownloadError: ERROR: audio conversion failed: file: mp3 invalid argumentPython的 - YouTube的-dl.utils.DownloadError:ERROR:音频转换失败:文件:MP3无效参数

与下面的参数,在Windows 7上的Python 3.6上运行的YouTube-DL,FFmpeg的,并出现上述错误libmp3lame已安装。

ydl_opts = {             
"format": "bestaudio/best", 
"extractaudio": True, 
"outtmpl": fetch_name + "%(ext)s", 
"noplaylist": True, 
"nocheckcertificate": True, 
"postprocessors": [{ 
    "key": "FFmpegExtractAudio", 
    "preferredcodec": "mp3", 
    "preferredquality": "192", 
}], 
"progress_hooks": [hook] 
} 

fetch_name例如是C:\Path\File[hook]只显示下载消息。 我在这里和互联网上搜索,但无法找到此错误。

+1

[mcve]将有助于诊断。 – Cecilia

我追溯了代码中的参数,发现这个file,然后又追溯到postprocessors的列表。

正如你所看到的后处理器被命名为FFmpegExtractAudioPP正如你已经使用FFmpegExtractAudio。可能是这个地方你错了。