【问题标题】:I have already installed ffmpge but getting following DownloadError: ERROR: ffprobe/avprobe and ffmpeg/avconv not found. Please install one我已经安装了 ffmpeg,但出现以下下载错误:错误:ffprobe/avprobe 和 ffmpeg/avconv 未找到。请安装一个
【发布时间】:2020-11-22 01:44:34
【问题描述】:

从这个帖子获得帮助:download only audio from youtube video using youtube-dl in python script

import youtube_dl #installed youtube_dl file

options = {
    'format':'bestaudio/best',
    'extractaudio':True,            #extracting audio
    'audioformat':'mp3',            #file options and format
    'outtmpl':'%(id)s.%(ext)s',     #name the file the ID of the video
    'noplaylist':True,
    'nocheckcertificate':True,
    'postprocessors': [{
        'key': 'FFmpegExtractAudio',# Used ffmpeg for converting the file to mp3
        'preferredcodec': 'mp3',
        'preferredquality': '192',
    }]
}

with youtube_dl.YoutubeDL(options) as ydl:
    ydl.download(['https://youtu.be/BZP1rYjoBgI']) #final downloading

Python console output

【问题讨论】:

    标签: python audio youtube youtube-dl


    【解决方案1】:

    很可能,您没有完全安装 ffmpeg;它必须在您的PATH 中。您可以在终端中输入ffmpeg 进行检查。

    这里有多种可能的解决方案:

    1. 将 ffmpeg 安装到您的 PATH,例如将二进制文件复制到 /usr/bin/

    2. ffmpeg 二进制文件符号链接到PATH 中的目录。

    3. 设置您的PATH,使其包含您安装 ffmpeg 的目录。在 Linux 和 macOS 上,this likely involved editing ~/.profile or /etc/environment 并再次登录。在 Windows 上,editing the registry works

    4. 通过将'ffmpeg_location': '/replace/this/with/the/real/path/to/your/ffmpeg' 添加到您的 youtube-dl 配置中,在您的配置中指定精确的 ffmpeg 位置。当然,这只会解决 youtube-dl 的问题,而不是其他依赖 ffmpeg 的应用程序。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2020-09-03
      • 2015-08-26
      • 2020-11-08
      • 2019-11-22
      • 1970-01-01
      • 2020-05-10
      • 1970-01-01
      相关资源
      最近更新 更多