MacOS下用Homebrew安装yt-dlp并配置yt-dlp.conf
MacOS下用Homebrew安装yt-dlp视频下载器并配置.conf配置文件
安装yt-dlp
brew install yt-dlp
查看是否安装成功
yt-dlp --version
2024.11.18
给yt-dlp添加配置文件
1、打开访达文件夹,到~根目录下,通常是你的用户名文件夹,里面有图片下载音乐等
2、按下command + shift + . (显示隐藏文件)
3、打开 .config 文件夹,创建 yt-dlp 文件夹
4、创建 config 这个就是配置文件
下面是我的配置,可以参考一下,配置文件里不要有中文,cookies的文件也放在这个里面
导出浏览器cookie可以用这个扩展程序:Get cookies.txt LOCALLY
扩展程序:https://github.com/kairi003/Get-cookies.txt-Locally
yt-dlp官方配置文件参数介绍:https://github.com/yt-dlp/yt-dlp#configuration
## cookies
--cookies 'cookies.txt'
##args
--output %(uploader)s/%(title)s-%(resolution)s.%(ext)s
## Verbosity / Simulation Options
--console-title --progress-template "download-title:%(info.id)s-%(progress.eta)s"
## output path
--paths '/Users/yuto/Downloads/Video/Cut/'
## Video Format Options
--merge-output-format mp4
## Subtitle Options
##--sub-langs all,-live_chat
## Post-Processing Options
##--embed-subs
##--embed-thumbnail
##--embed-metadata
##--convert-subs srt
## ffmpeg tools for macOS,You must modify the path
--ffmpeg-location /opt/homebrew/Cellar/ffmpeg/7.1_3/bin/ffmpeg