youtube-dl python script postprocessing error: FFMPEG codecs aren't being recognized

后端 未结 1 1768
悲&欢浪女
悲&欢浪女 2021-01-18 21:20

My python script is trying to download youtube videos with youtube-dl.py. Works fine unless postprocessing is required. The code:

import youtube_dl

options          


        
相关标签:
1条回答
  • 2021-01-18 21:58

    This is a bug in the interplay between youtube-dl and ffmpeg, caused by the lack of extension in the filename. youtube-dl calls ffmpeg. Since the filename does not contain any extension, youtube-dl asks ffmpeg to generate a temporary file mp3. However, ffmpeg detects the output container type automatically by the extension and fails because mp3 has no extension.

    As a workaround, simply add %(ext)s in your filename template:

    'outtmpl': u'%(id)s.%(ext)s',
    
    0 讨论(0)
提交回复
热议问题