活到老学到老之yt-dlp_macos(二)

关于yt-dlp_macos的第一篇文章,请参考:https://blog.csdn.net/zhang_jiamin/article/details/147050835?spm=1011.2415.3001.5331

今天使用过程中提示:zsh: no matches found

bash 复制代码
jasper.zhang@localhost yt-download % yt-dlp_macos --cookies www.youtube.com_cookies.txt -f mp4 https://www.youtube.com/watch?v=xxxxxxx
zsh: no matches found: https://www.youtube.com/watch?v=xxxxxxx

zsh: no matches found 的原因是 zsh (Z Shell)把URL 中的 ? 符号解释为通配符的一部分,从而导致 shell 尝试匹配文件或路径。

解决:用 单引号 或 双引号 将 URL 括起来:

bash 复制代码
jasper.zhang@localhost yt-download % yt-dlp_macos --cookies www.youtube.com_cookies.txt -f mp4 "https://www.youtube.com/watch?v=xxxxxxx"

再次执行后提示:

bash 复制代码
jasper.zhang@localhost yt-download % yt-dlp_macos --cookies www.youtube.com_cookies.txt -f mp4 "https://www.youtube.com/watch?v=xxxxxxx"
WARNING: Your yt-dlp version (2025.08.11) is older than 90 days!
         It is strongly recommended to always use the latest version.
         Run "yt-dlp --update" or "yt-dlp -U" to update.
         To suppress this warning, add --no-update to your command/config.
[youtube] Extracting URL: https://www.youtube.com/watch?v=xxxxxxxx
[youtube] xxxxxxxx: Downloading webpage
[youtube] xxxxxxxx: Downloading tv client config
[youtube] xxxxxxxx: Downloading player 7d647a07-main
[youtube] xxxxxxxx: Downloading tv player API JSON
ERROR: [youtube] xxxxxxxx: The following content is not available on this app.. Watch on the latest version of YouTube.

于是更新版本:

bash 复制代码
jasper.zhang@localhost yt-download % yt-dlp_macos --update
Current version: stable@2025.08.11 from yt-dlp/yt-dlp
Latest version: stable@2025.11.12 from yt-dlp/yt-dlp
Current Build Hash: 8001c730007495a26de24d7fcf6c72e76bc24c47bdde2cfd86d51e21626bd7e4
Updating to stable@2025.11.12 from yt-dlp/yt-dlp ...
Updated yt-dlp to stable@2025.11.12 from yt-dlp/yt-dlp

最新版本为:

bash 复制代码
jasper.zhang@localhost yt-download % yt-dlp_macos --version
2025.11.12

The following content is not available on this app.. Watch on the latest version of YouTube. 通常表示正在尝试下载的 YouTube 视频受到了地区、账户或 YouTube 版本的限制。于是尝试在下载时模拟浏览器访问:

bash 复制代码
jasper.zhang@localhost yt-download % yt-dlp_macos --cookies www.youtube.com_cookies.txt -f mp4 --user-agent "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36" "https://www.youtube.com/watch?v=xxxxxxxx"

执行后可以下载成功,但还是有warning:

bash 复制代码
WARNING: "-f mp4" selects the best pre-merged mp4 format which is often not what's intended.
         Pre-merged mp4 formats are not available from all sites, or may only be available in lower quality.
         To prioritize the best h264 video and aac audio in an mp4 container, use "-t mp4" instead.
         If you know what you are doing and want a pre-merged mp4 format, use "-f b[ext=mp4]" instead to suppress this warning

为了优先选择 最佳 H.264 视频和 AAC 音频 格式,应该使用 -t mp4:

bash 复制代码
jasper.zhang@localhost yt-download % yt-dlp_macos --cookies www.youtube.com_cookies.txt -t mp4 --user-agent "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36" "https://www.youtube.com/watch?v=xxxxxxxx"

这样就OK了!

相关推荐
hai-chu2 小时前
将 Neo4j 安装为 macOS 服务
macos·策略模式·neo4j
远程软件小帮手3 小时前
UU远程上线mac被控!如何远程控制 macOS 设备办公?
游戏·macos·智能手机·电脑
mini_0557 小时前
mac电脑免费使用Typora教程
macos
大牙Adela7 小时前
在Mac上通过Multipass虚拟机中的Ubuntu系统使用Graphviz工具
c语言·qt·ubuntu·macos·multipass·graphviz
z202305087 小时前
Linux之网络子系统-硬件MAC和 phy 的基本组成原理
macos
张志翔的博客10 小时前
如何在 macOS 上切换 Shell:从 Bash 到 Zsh 或其他 Shell
开发语言·macos·bash
2501_9417987321 小时前
C++高性能音频处理与实时特征提取实战分享:多线程信号处理与低延迟优化经验
ide·macos·xcode
星卯教育tony1 天前
Typora下载与Windows+Mac环境下使用教程
macos
laocaibulao1 天前
mac电脑brew安装libnghttp3.rb失败咋办
macos