update:yt-dlp

This commit is contained in:
dichgrem
2025-08-27 12:18:02 +08:00
parent d26638ece4
commit 4cc105c221
49 changed files with 262 additions and 320 deletions

View File

@@ -1,9 +1,9 @@
+++
title = "网络艺术:Aria2使用指南"
title = "下载系列(3):Aria2使用指南"
date = 2025-04-15
[taxonomies]
tags = ["网络艺术"]
tags = ["Network"]
+++
前言 Aria2是一款开源、跨平台的命令行界面下载管理器常常被各种下载器软件使用。

View File

@@ -1,5 +1,5 @@
+++
title = "网络艺术:下载技术的历史"
title = "下载系列(1):下载技术的历史"
date = 2025-04-11
[taxonomies]

View File

@@ -1,38 +1,40 @@
+++
title = "网络艺术:Yt-dlp使用指南"
title = "下载系列(2):Yt-dlp使用指南"
date = 2025-04-12
[taxonomies]
tags = ["网络艺术"]
tags = ["Network"]
+++
前言 有时候我们想要视频保存到本地以便离线回看。yt-dlp是一款功能强大的命令行工具专注于下载视频与音频内容支持数千个平台是开源下载工具爱好者的常用选择。
前言 yt-dlp是一款功能强大的命令行工具专注于下载视频与音频内容支持数千个平台是开源下载工具爱好者的常用选择。
<!-- more -->
有时候我们想要下载网络上的某些视频比如BilibiliYouTube等等但它们没有提供下载按钮这时候就可以用开源的yt-dlp来进行下载。和Aria2一样很多下载软件的核心就是yt-dlp.
## 历史沿革:从 youtube-dl 到 yt-dlp
## 历史
- **起源与演进**
`youtube-dl` 由 Ricardo García González 于 **2006 年**创建,最初仅支持 YouTube随后扩展至其他网站成为 GitHub 上最受欢迎的开源下载项目之一.项目维护者在 2011 年、2021 年等阶段陆续交替,由 phihag、dstftw 等接手.2020 年唱片业协会RIAA发起 DMCA 要求删除该项目,虽一度被移除,但在公众与 EFF 的推动下于当年 11 月恢复,并促使 GitHub 改进相关策略.
- **停滞youtube-dlc → yt-dlp 的诞生**
随着开发进度放缓,社区于 2020 年衍生出 youtube-dlc 分支,随即在 **2021 年**演变为更活跃的 `yt-dlp` 项目,它继承了 youtube-dl 的核心功能,并引入更多改进,包括更好的格式选择、多线程下载等,迅速在 Linux 发行版中取代 youtube-dl (如 Ubuntu 22.04 之后).
随着开发进度放缓,社区于 2020 年衍生出 youtube-dlc 分支,**2021 年**演变为更活跃的 `yt-dlp` 项目,它继承了 youtube-dl 的核心功能,并引入更多改进,包括更好的格式选择、多线程下载等,成为了GitHub上star最多的项目之一.
- **重构与功能拓展**
`yt-dlp` 从 youtube-dlc 完全重构,新增许多 extractor解析器、改进配置与默认行为还扩展了插件系统和兼容性支持.
## 各平台安装指南
## 安装
- 通用Linux/macOS/Windows
### Windows
下载官方最新可执行文件:
从yt-dlp官方GitHub上下载exe二进制文件:
```bash
sudo curl -L https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp -o /usr/local/bin/yt-dlp
sudo chmod a+rx /usr/local/bin/yt-dlp
````
[yt-dlp](https://github.com/yt-dlp/yt-dlp/releases/tag/2025.08.22)
将其放到一个目录下,比如``C:\Users\<你的用户名>\yt-dlp\yt-dlp.exe``,随后添加环境变量。
> 添加环境变量Win键搜索“环境变量”打开“编辑系统环境变量”点击最下方的“环境变量”选择“系统变量”中的path点击“编辑”新建一个变量将上面的目录 C:\Users\<你的用户名>\yt-dlp\ 写入,注意去掉前后引号,随后确定-确定-确定退出。
更新版本:
@@ -46,15 +48,21 @@ yt-dlp -U
python3 -m pip install -U yt-dlp
```
- Linux 发行版仓库
各发行版可能提供略滞后的 yt-dlp
### Linux 发行版
- Debian / Ubuntu`sudo apt install yt-dlp`
- Arch / Manjaro`sudo pacman -S yt-dlp`
- Fedora`sudo dnf install yt-dlp` 等。
- Fedora`sudo dnf install yt-dlp`
- Nixos:
```
{pkgs, ...}: {
home.packages = with pkgs; [
peazip
];
}
```
- AndroidTermux
### AndroidTermux
```bash
pkg update && pkg upgrade
@@ -62,7 +70,84 @@ pkg install python libexpat openssl ffmpeg
python3 -m pip install -U yt-dlp
```
## 常用命令
## 下载实战
- **下载B站带字幕视频**:
```
yt-dlp "https://www.bilibili.com/video/BVxxxxx" --write-subs --embed-subs --sub-langs all,-live_chat
--write-subs: 将字幕文件下载为单独文件 (如 .vtt 或 .ass)
--embed-subs: 将下载的字幕嵌入到视频文件中(如果格式支持)
--sub-langs all,-live_chat: 下载所有字幕语言,但排除像“弹幕/实时聊天”之类的非标准字幕流
```
- **下载YouTube视频**
先使用这个命令查看可用格式:
```
yt-dlp -F https://www.youtube.com/watch?v=xxxxxxxxxxxx
```
然后它会列举出所有可用的格式,如下:
```
[youtube] MgtOAVOXBWo: Downloading webpage
[youtube] MgtOAVOXBWo: Downloading tv client config
[youtube] MgtOAVOXBWo: Downloading tv player API JSON
[youtube] MgtOAVOXBWo: Downloading ios player API JSON
[youtube] MgtOAVOXBWo: Downloading m3u8 information
[info] Available formats for MgtOAVOXBWo:
ID EXT RESOLUTION FPS │ FILESIZE TBR PROTO │ VCODEC VBR ACODEC MORE INFO
──────────────────────────────────────────────────────────────────────────────────────────────────────────
sb2 mhtml 48x27 0 │ mhtml │ images storyboard
sb1 mhtml 80x45 0 │ mhtml │ images storyboard
sb0 mhtml 160x90 0 │ mhtml │ images storyboard
233 mp4 audio only │ m3u8 │ audio only unknown Untested, Default, low
234 mp4 audio only │ m3u8 │ audio only unknown Untested, Default, high
602 mp4 256x144 15 │ ~ 9.23MiB 81k m3u8 │ vp09.00.10.08 81k video only Untested
269 mp4 256x144 30 │ ~ 14.94MiB 130k m3u8 │ avc1.4D400C 130k video only Untested
603 mp4 256x144 30 │ ~ 15.90MiB 139k m3u8 │ vp09.00.11.08 139k video only Untested
229 mp4 426x240 30 │ ~ 33.33MiB 291k m3u8 │ avc1.4D4015 291k video only Untested
604 mp4 426x240 30 │ ~ 25.82MiB 225k m3u8 │ vp09.00.20.08 225k video only Untested
230 mp4 640x360 30 │ ~ 73.50MiB 642k m3u8 │ avc1.4D401E 642k video only Untested
605 mp4 640x360 30 │ ~ 55.73MiB 487k m3u8 │ vp09.00.21.08 487k video only Untested
231 mp4 854x480 30 │ ~104.35MiB 911k m3u8 │ avc1.4D401F 911k video only Untested
606 mp4 854x480 30 │ ~ 94.79MiB 827k m3u8 │ vp09.00.30.08 827k video only Untested
311 mp4 1280x720 60 │ ~330.73MiB 2887k m3u8 │ avc1.4D4020 2887k video only Untested
612 mp4 1280x720 60 │ ~197.04MiB 1720k m3u8 │ vp09.00.40.08 1720k video only Untested
312 mp4 1920x1080 60 │ ~486.64MiB 4248k m3u8 │ avc1.64002A 4248k video only Untested
617 mp4 1920x1080 60 │ ~369.06MiB 3222k m3u8 │ vp09.00.41.08 3222k video only Untested
623 mp4 2560x1440 60 │ ~ 1.00GiB 8945k m3u8 │ vp09.00.50.08 8945k video only Untested
```
我们下载312和233,即视频和音频,使用以下命令:
```
yt-dlp -f "312+233" -o "<新视频的名字,要短一点>.%(ext)s" https://www.youtube.com/watch?v=xxxxxxxxxxxx
```
这行命令会自动将下载的312的1080p/H.264的视频和233的音频合并为一个mp4视频注意新的名称不能太长否则会下载失败。
如果要下载带字幕的视频,则使用
```
yt-dlp -f "312+233" --write-subs --write-auto-subs --embed-subs --sub-langs "zh.*,en.*" -o "<新视频的名字,要短一点>.%(ext)s" https://www.youtube.com/watch?v=xxxxxxxxxxx
```
这个命令会:
- 下载1080p视频
- 下载中文和英文字幕(包括自动生成的)
- 将字幕嵌入到视频文件中
- 同时保存单独的字幕文件
- 参数说明
```
--write-subs: 下载手动字幕
--write-auto-subs: 下载自动生成的字幕
--embed-subs: 将字幕嵌入到视频中
--sub-langs "zh.*": 指定下载中文字幕(所有中文变体)
--sub-format srt: 指定字幕格式(可选)
```
## 常用参数
- **下载视频**
@@ -151,40 +236,6 @@ python3 -m pip install -U yt-dlp
在 `~/.config/yt-dlp/config` 文件中添加习惯参数,如下载路径、格式偏好等。
- **比如下载B站带字幕视频的命令**:
```
yt-dlp "https://www.bilibili.com/video/BVxxxxx" --write-subs --embed-subs --sub-langs all,-live_chat
--write-subs: 将字幕文件下载为单独文件 (如 .vtt 或 .ass)
--embed-subs: 将下载的字幕嵌入到视频文件中(如果格式支持)
--sub-langs all,-live_chat: 下载所有字幕语言,但排除像“弹幕/实时聊天”之类的非标准字幕流
```
---
## 进阶技巧
- **FFmpeg 合并支持**:若视频与音频分离,需安装 FFmpeg 才能完成合并。
- **处理地理限制**:结合 `--proxy` 或 `--geo-bypass` 等选项使用 VPN/代理绕过区域限制。
- **应对下载失败(如 403**
```bash
yt-dlp --rm-cache-dir
```
- **设置 UA、Referer、打印请求头调试**
```bash
--add-headers "User-Agent: ..." --print http_headers
```
- **Stability & 更新问题**:建议避免使用发行版中的旧版本,推荐使用官方可执行或 pip 方法。
---
**Done.**

View File

@@ -601,7 +601,7 @@
<span class="button previous">
<a href="https://blog.dich.bid/network-aria2/">
<span class="button__icon"></span>&nbsp;
<span class="button__text">网络艺术:Aria2使用指南</span>
<span class="button__text">下载系列(3):Aria2使用指南</span>
</a>
</span>

View File

@@ -370,7 +370,7 @@ Markdown 使用一个或多个空行来分隔不同的段落。如果要换行
<span class="button next">
<a href="https://blog.dich.bid/network-download-1/">
<span class="button__text">网络艺术:下载技术的历史</span>&nbsp;
<span class="button__text">下载系列(1):下载技术的历史</span>&nbsp;
<span class="button__icon"></span>
</a>
</span>

View File

@@ -149,27 +149,27 @@
<li class="post-list">
<a href="https://blog.dich.bid/network-aria2/">
<span class="post-date">2025-04-15</span>
:: <span class="post-list-title">网络艺术:Aria2使用指南</span></a>
:: <span class="post-list-title">下载系列(3):Aria2使用指南</span></a>
<span class="post-tags-inline">
::
<a class="post-tag" href="https://blog.dich.bid/tags/wang-luo-yi-shu/">#网络艺术</a></span>
<a class="post-tag" href="https://blog.dich.bid/tags/network/">#Network</a></span>
</li>
<li class="post-list">
<a href="https://blog.dich.bid/network-yt-dlp/">
<span class="post-date">2025-04-12</span>
:: <span class="post-list-title">网络艺术:Yt-dlp使用指南</span></a>
:: <span class="post-list-title">下载系列(2):Yt-dlp使用指南</span></a>
<span class="post-tags-inline">
::
<a class="post-tag" href="https://blog.dich.bid/tags/wang-luo-yi-shu/">#网络艺术</a></span>
<a class="post-tag" href="https://blog.dich.bid/tags/network/">#Network</a></span>
</li>
<li class="post-list">
<a href="https://blog.dich.bid/network-download-1/">
<span class="post-date">2025-04-11</span>
:: <span class="post-list-title">网络艺术:下载技术的历史</span></a>
:: <span class="post-list-title">下载系列(1):下载技术的历史</span></a>
<span class="post-tags-inline">
::

View File

@@ -85,7 +85,7 @@
</entry>
<entry xml:lang="en">
<title>网络艺术:Aria2使用指南</title>
<title>下载系列(3):Aria2使用指南</title>
<published>2025-04-15T00:00:00+00:00</published>
<updated>2025-04-15T00:00:00+00:00</updated>
@@ -104,7 +104,7 @@
</entry>
<entry xml:lang="en">
<title>网络艺术:Yt-dlp使用指南</title>
<title>下载系列(2):Yt-dlp使用指南</title>
<published>2025-04-12T00:00:00+00:00</published>
<updated>2025-04-12T00:00:00+00:00</updated>
@@ -119,11 +119,11 @@
<link rel="alternate" type="text/html" href="https://blog.dich.bid/network-yt-dlp/"/>
<id>https://blog.dich.bid/network-yt-dlp/</id>
<summary type="html">&lt;p&gt;前言 有时候我们想要视频保存到本地以便离线回看。yt-dlp是一款功能强大的命令行工具专注于下载视频与音频内容支持数千个平台是开源下载工具爱好者的常用选择。&lt;&#x2F;p&gt;</summary>
<summary type="html">&lt;p&gt;前言 yt-dlp是一款功能强大的命令行工具专注于下载视频与音频内容支持数千个平台是开源下载工具爱好者的常用选择。&lt;&#x2F;p&gt;</summary>
</entry>
<entry xml:lang="en">
<title>网络艺术:下载技术的历史</title>
<title>下载系列(1):下载技术的历史</title>
<published>2025-04-11T00:00:00+00:00</published>
<updated>2025-04-11T00:00:00+00:00</updated>

View File

@@ -236,7 +236,7 @@
<div class="post on-list">
<h1 class="post-title"><a href="https://blog.dich.bid/network-aria2/">网络艺术:Aria2使用指南</a></h1>
<h1 class="post-title"><a href="https://blog.dich.bid/network-aria2/">下载系列(3):Aria2使用指南</a></h1>
<div class="post-meta-inline">
<span class="post-date">
@@ -248,7 +248,7 @@
<span class="post-tags-inline">
:: tags:&nbsp;
<a class="post-tag" href="https://blog.dich.bid/tags/wang-luo-yi-shu/">#网络艺术</a></span>
<a class="post-tag" href="https://blog.dich.bid/tags/network/">#Network</a></span>

View File

@@ -103,7 +103,7 @@
<div class="post">
<h1 class="post-title"><a href="https://blog.dich.bid/network-aria2/">网络艺术:Aria2使用指南</a></h1>
<h1 class="post-title"><a href="https://blog.dich.bid/network-aria2/">下载系列(3):Aria2使用指南</a></h1>
<div class="post-meta-inline">
<span class="post-date">
@@ -115,7 +115,7 @@
<span class="post-tags-inline">
:: tags:&nbsp;
<a class="post-tag" href="https://blog.dich.bid/tags/wang-luo-yi-shu/">#网络艺术</a></span>
<a class="post-tag" href="https://blog.dich.bid/tags/network/">#Network</a></span>
<div class="post-content">
@@ -317,7 +317,7 @@
<span class="button previous">
<a href="https://blog.dich.bid/network-yt-dlp/">
<span class="button__icon"></span>&nbsp;
<span class="button__text">网络艺术:Yt-dlp使用指南</span>
<span class="button__text">下载系列(2):Yt-dlp使用指南</span>
</a>
</span>

View File

@@ -103,7 +103,7 @@
<div class="post">
<h1 class="post-title"><a href="https://blog.dich.bid/network-download-1/">网络艺术:下载技术的历史</a></h1>
<h1 class="post-title"><a href="https://blog.dich.bid/network-download-1/">下载系列(1):下载技术的历史</a></h1>
<div class="post-meta-inline">
<span class="post-date">
@@ -441,7 +441,7 @@ HTTP协议是一种无状态的、应用层协议用于传输超文本数据
<span class="button next">
<a href="https://blog.dich.bid/network-yt-dlp/">
<span class="button__text">网络艺术:Yt-dlp使用指南</span>&nbsp;
<span class="button__text">下载系列(2):Yt-dlp使用指南</span>&nbsp;
<span class="button__icon"></span>
</a>
</span>

View File

@@ -103,7 +103,7 @@
<div class="post">
<h1 class="post-title"><a href="https://blog.dich.bid/network-yt-dlp/">网络艺术:Yt-dlp使用指南</a></h1>
<h1 class="post-title"><a href="https://blog.dich.bid/network-yt-dlp/">下载系列(2):Yt-dlp使用指南</a></h1>
<div class="post-meta-inline">
<span class="post-date">
@@ -115,12 +115,14 @@
<span class="post-tags-inline">
:: tags:&nbsp;
<a class="post-tag" href="https://blog.dich.bid/tags/wang-luo-yi-shu/">#网络艺术</a></span>
<a class="post-tag" href="https://blog.dich.bid/tags/network/">#Network</a></span>
<div class="post-content">
<p>前言 有时候我们想要视频保存到本地以便离线回看。yt-dlp是一款功能强大的命令行工具专注于下载视频与音频内容支持数千个平台是开源下载工具爱好者的常用选择。</p>
<span id="continue-reading"></span><h2 id="li-shi-yan-ge-cong-youtube-dl-dao-yt-dlp">历史沿革:从 youtube-dl 到 yt-dlp</h2>
<p>前言 yt-dlp是一款功能强大的命令行工具专注于下载视频与音频内容支持数千个平台是开源下载工具爱好者的常用选择。</p>
<span id="continue-reading"></span>
<p>有时候我们想要下载网络上的某些视频比如BilibiliYouTube等等但它们没有提供下载按钮这时候就可以用开源的yt-dlp来进行下载。和Aria2一样很多下载软件的核心就是yt-dlp.</p>
<h2 id="li-shi">历史</h2>
<ul>
<li>
<p><strong>起源与演进</strong>
@@ -128,21 +130,21 @@
</li>
<li>
<p><strong>停滞youtube-dlc → yt-dlp 的诞生</strong>
随着开发进度放缓,社区于 2020 年衍生出 youtube-dlc 分支,随即在 <strong>2021 年</strong>演变为更活跃的 <code>yt-dlp</code> 项目,它继承了 youtube-dl 的核心功能,并引入更多改进,包括更好的格式选择、多线程下载等,迅速在 Linux 发行版中取代 youtube-dl (如 Ubuntu 22.04 之后).</p>
随着开发进度放缓,社区于 2020 年衍生出 youtube-dlc 分支,<strong>2021 年</strong>演变为更活跃的 <code>yt-dlp</code> 项目,它继承了 youtube-dl 的核心功能,并引入更多改进,包括更好的格式选择、多线程下载等,成为了GitHub上star最多的项目之一.</p>
</li>
<li>
<p><strong>重构与功能拓展</strong>
<code>yt-dlp</code> 从 youtube-dlc 完全重构,新增许多 extractor解析器、改进配置与默认行为还扩展了插件系统和兼容性支持.</p>
</li>
</ul>
<h2 id="ge-ping-tai-an-zhuang-zhi-nan">各平台安装指南</h2>
<ul>
<li>通用Linux/macOS/Windows</li>
</ul>
<p>下载官方最新可执行文件:</p>
<pre data-lang="bash" style="background-color:#151515;color:#e8e8d3;" class="language-bash "><code class="language-bash" data-lang="bash"><span style="color:#ffb964;">sudo</span><span> curl</span><span style="color:#ffb964;"> -L</span><span> https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp</span><span style="color:#ffb964;"> -o</span><span> /usr/local/bin/yt-dlp
</span><span style="color:#ffb964;">sudo</span><span> chmod a+rx /usr/local/bin/yt-dlp
</span></code></pre>
<h2 id="an-zhuang">安装</h2>
<h3 id="windows">Windows</h3>
<p>从yt-dlp官方GitHub上下载exe二进制文件</p>
<p><a href="https://github.com/yt-dlp/yt-dlp/releases/tag/2025.08.22">yt-dlp</a></p>
<p>将其放到一个目录下,比如<code>C:\Users\&lt;你的用户名&gt;\yt-dlp\yt-dlp.exe</code>,随后添加环境变量。</p>
<blockquote>
<p>添加环境变量Win键搜索“环境变量”打开“编辑系统环境变量”点击最下方的“环境变量”选择“系统变量”中的path点击“编辑”新建一个变量将上面的目录 C:\Users&lt;你的用户名&gt;\yt-dlp\ 写入,注意去掉前后引号,随后确定-确定-确定退出。</p>
</blockquote>
<p>更新版本:</p>
<pre data-lang="bash" style="background-color:#151515;color:#e8e8d3;" class="language-bash "><code class="language-bash" data-lang="bash"><span style="color:#ffb964;">yt-dlp -U
</span></code></pre>
@@ -151,29 +153,103 @@
</ul>
<pre data-lang="bash" style="background-color:#151515;color:#e8e8d3;" class="language-bash "><code class="language-bash" data-lang="bash"><span style="color:#ffb964;">python3 -m</span><span> pip install</span><span style="color:#ffb964;"> -U</span><span> yt-dlp
</span></code></pre>
<h3 id="linux-fa-xing-ban">Linux 发行版</h3>
<ul>
<li>Linux 发行版仓库</li>
</ul>
<p>各发行版可能提供略滞后的 yt-dlp</p>
<ul>
<li>
<p>Debian / Ubuntu<code>sudo apt install yt-dlp</code></p>
</li>
<li>
<p>Arch / Manjaro<code>sudo pacman -S yt-dlp</code></p>
</li>
<li>
<p>Fedora<code>sudo dnf install yt-dlp</code> 等。</p>
</li>
<li>
<p>AndroidTermux</p>
</li>
<li>Debian / Ubuntu<code>sudo apt install yt-dlp</code></li>
<li>Arch / Manjaro<code>sudo pacman -S yt-dlp</code></li>
<li>Fedora<code>sudo dnf install yt-dlp</code></li>
<li>Nixos:</li>
</ul>
<pre style="background-color:#151515;color:#e8e8d3;"><code><span>{pkgs, ...}: {
</span><span> home.packages = with pkgs; [
</span><span> peazip
</span><span> ];
</span><span>}
</span></code></pre>
<h3 id="android-termux">AndroidTermux</h3>
<pre data-lang="bash" style="background-color:#151515;color:#e8e8d3;" class="language-bash "><code class="language-bash" data-lang="bash"><span style="color:#ffb964;">pkg</span><span> update &amp;&amp; </span><span style="color:#ffb964;">pkg</span><span> upgrade
</span><span style="color:#ffb964;">pkg</span><span> install python libexpat openssl ffmpeg
</span><span style="color:#ffb964;">python3 -m</span><span> pip install</span><span style="color:#ffb964;"> -U</span><span> yt-dlp
</span></code></pre>
<h2 id="chang-yong-ming-ling">常用命令</h2>
<h2 id="xia-zai-shi-zhan">下载实战</h2>
<ul>
<li><strong>下载B站带字幕视频</strong>:</li>
</ul>
<pre style="background-color:#151515;color:#e8e8d3;"><code><span>yt-dlp &quot;https://www.bilibili.com/video/BVxxxxx&quot; --write-subs --embed-subs --sub-langs all,-live_chat
</span><span>
</span><span>--write-subs: 将字幕文件下载为单独文件 (如 .vtt 或 .ass)
</span><span>
</span><span>--embed-subs: 将下载的字幕嵌入到视频文件中(如果格式支持)
</span><span>
</span><span>--sub-langs all,-live_chat: 下载所有字幕语言,但排除像“弹幕/实时聊天”之类的非标准字幕流
</span></code></pre>
<ul>
<li><strong>下载YouTube视频</strong></li>
</ul>
<p>先使用这个命令查看可用格式:</p>
<pre style="background-color:#151515;color:#e8e8d3;"><code><span>yt-dlp -F https://www.youtube.com/watch?v=xxxxxxxxxxxx
</span></code></pre>
<p>然后它会列举出所有可用的格式,如下:</p>
<pre style="background-color:#151515;color:#e8e8d3;"><code><span>[youtube] MgtOAVOXBWo: Downloading webpage
</span><span>[youtube] MgtOAVOXBWo: Downloading tv client config
</span><span>[youtube] MgtOAVOXBWo: Downloading tv player API JSON
</span><span>[youtube] MgtOAVOXBWo: Downloading ios player API JSON
</span><span>[youtube] MgtOAVOXBWo: Downloading m3u8 information
</span><span>[info] Available formats for MgtOAVOXBWo:
</span><span>ID EXT RESOLUTION FPS │ FILESIZE TBR PROTO │ VCODEC VBR ACODEC MORE INFO
</span><span>──────────────────────────────────────────────────────────────────────────────────────────────────────────
</span><span>sb2 mhtml 48x27 0 │ mhtml │ images storyboard
</span><span>sb1 mhtml 80x45 0 │ mhtml │ images storyboard
</span><span>sb0 mhtml 160x90 0 │ mhtml │ images storyboard
</span><span>233 mp4 audio only │ m3u8 │ audio only unknown Untested, Default, low
</span><span>234 mp4 audio only │ m3u8 │ audio only unknown Untested, Default, high
</span><span>602 mp4 256x144 15 │ ~ 9.23MiB 81k m3u8 │ vp09.00.10.08 81k video only Untested
</span><span>269 mp4 256x144 30 │ ~ 14.94MiB 130k m3u8 │ avc1.4D400C 130k video only Untested
</span><span>603 mp4 256x144 30 │ ~ 15.90MiB 139k m3u8 │ vp09.00.11.08 139k video only Untested
</span><span>229 mp4 426x240 30 │ ~ 33.33MiB 291k m3u8 │ avc1.4D4015 291k video only Untested
</span><span>604 mp4 426x240 30 │ ~ 25.82MiB 225k m3u8 │ vp09.00.20.08 225k video only Untested
</span><span>230 mp4 640x360 30 │ ~ 73.50MiB 642k m3u8 │ avc1.4D401E 642k video only Untested
</span><span>605 mp4 640x360 30 │ ~ 55.73MiB 487k m3u8 │ vp09.00.21.08 487k video only Untested
</span><span>231 mp4 854x480 30 │ ~104.35MiB 911k m3u8 │ avc1.4D401F 911k video only Untested
</span><span>606 mp4 854x480 30 │ ~ 94.79MiB 827k m3u8 │ vp09.00.30.08 827k video only Untested
</span><span>311 mp4 1280x720 60 │ ~330.73MiB 2887k m3u8 │ avc1.4D4020 2887k video only Untested
</span><span>612 mp4 1280x720 60 │ ~197.04MiB 1720k m3u8 │ vp09.00.40.08 1720k video only Untested
</span><span>312 mp4 1920x1080 60 │ ~486.64MiB 4248k m3u8 │ avc1.64002A 4248k video only Untested
</span><span>617 mp4 1920x1080 60 │ ~369.06MiB 3222k m3u8 │ vp09.00.41.08 3222k video only Untested
</span><span>623 mp4 2560x1440 60 │ ~ 1.00GiB 8945k m3u8 │ vp09.00.50.08 8945k video only Untested
</span></code></pre>
<p>我们下载312和233,即视频和音频,使用以下命令:</p>
<pre style="background-color:#151515;color:#e8e8d3;"><code><span>yt-dlp -f &quot;312+233&quot; -o &quot;&lt;新视频的名字,要短一点&gt;.%(ext)s&quot; https://www.youtube.com/watch?v=xxxxxxxxxxxx
</span></code></pre>
<p>这行命令会自动将下载的312的1080p/H.264的视频和233的音频合并为一个mp4视频注意新的名称不能太长否则会下载失败。</p>
<p>如果要下载带字幕的视频,则使用</p>
<pre style="background-color:#151515;color:#e8e8d3;"><code><span>yt-dlp -f &quot;312+233&quot; --write-subs --write-auto-subs --embed-subs --sub-langs &quot;zh.*,en.*&quot; -o &quot;&lt;新视频的名字,要短一点&gt;.%(ext)s&quot; https://www.youtube.com/watch?v=xxxxxxxxxxx
</span></code></pre>
<p>这个命令会:</p>
<ul>
<li>
<p>下载1080p视频</p>
</li>
<li>
<p>下载中文和英文字幕(包括自动生成的)</p>
</li>
<li>
<p>将字幕嵌入到视频文件中</p>
</li>
<li>
<p>同时保存单独的字幕文件</p>
</li>
<li>
<p>参数说明</p>
</li>
</ul>
<pre style="background-color:#151515;color:#e8e8d3;"><code><span>--write-subs: 下载手动字幕
</span><span>--write-auto-subs: 下载自动生成的字幕
</span><span>--embed-subs: 将字幕嵌入到视频中
</span><span>--sub-langs &quot;zh.*&quot;: 指定下载中文字幕(所有中文变体)
</span><span>--sub-format srt: 指定字幕格式(可选)
</span></code></pre>
<h2 id="chang-yong-can-shu">常用参数</h2>
<ul>
<li>
<p><strong>下载视频</strong></p>
@@ -249,40 +325,6 @@
<p><strong>配置文件设定默认参数</strong></p>
<p><code>~/.config/yt-dlp/config</code> 文件中添加习惯参数,如下载路径、格式偏好等。</p>
</li>
<li>
<p><strong>比如下载B站带字幕视频的命令</strong>:</p>
</li>
</ul>
<pre style="background-color:#151515;color:#e8e8d3;"><code><span>yt-dlp &quot;https://www.bilibili.com/video/BVxxxxx&quot; --write-subs --embed-subs --sub-langs all,-live_chat
</span><span>
</span><span>--write-subs: 将字幕文件下载为单独文件 (如 .vtt 或 .ass)
</span><span>
</span><span>--embed-subs: 将下载的字幕嵌入到视频文件中(如果格式支持)
</span><span>
</span><span>--sub-langs all,-live_chat: 下载所有字幕语言,但排除像“弹幕/实时聊天”之类的非标准字幕流
</span></code></pre>
<hr />
<h2 id="jin-jie-ji-qiao">进阶技巧</h2>
<ul>
<li>
<p><strong>FFmpeg 合并支持</strong>:若视频与音频分离,需安装 FFmpeg 才能完成合并。</p>
</li>
<li>
<p><strong>处理地理限制</strong>:结合 <code>--proxy</code><code>--geo-bypass</code> 等选项使用 VPN/代理绕过区域限制。</p>
</li>
<li>
<p><strong>应对下载失败(如 403</strong></p>
<pre data-lang="bash" style="background-color:#151515;color:#e8e8d3;" class="language-bash "><code class="language-bash" data-lang="bash"><span style="color:#ffb964;">yt-dlp --rm-cache-dir
</span></code></pre>
</li>
<li>
<p><strong>设置 UA、Referer、打印请求头调试</strong></p>
<pre data-lang="bash" style="background-color:#151515;color:#e8e8d3;" class="language-bash "><code class="language-bash" data-lang="bash"><span style="color:#ffb964;">--add-headers </span><span style="color:#556633;">&quot;</span><span style="color:#99ad6a;">User-Agent: ...</span><span style="color:#556633;">&quot;</span><span style="color:#ffb964;"> --print</span><span> http_headers
</span></code></pre>
</li>
<li>
<p><strong>Stability &amp; 更新问题</strong>:建议避免使用发行版中的旧版本,推荐使用官方可执行或 pip 方法。</p>
</li>
</ul>
<hr />
<p><strong>Done.</strong></p>
@@ -299,14 +341,14 @@
<span class="button previous">
<a href="https://blog.dich.bid/network-download-1/">
<span class="button__icon"></span>&nbsp;
<span class="button__text">网络艺术:下载技术的历史</span>
<span class="button__text">下载系列(1):下载技术的历史</span>
</a>
</span>
<span class="button next">
<a href="https://blog.dich.bid/network-aria2/">
<span class="button__text">网络艺术:Aria2使用指南</span>&nbsp;
<span class="button__text">下载系列(3):Aria2使用指南</span>&nbsp;
<span class="button__icon"></span>
</a>
</span>

View File

@@ -104,7 +104,7 @@
<div class="posts">
<div class="post on-list">
<h1 class="post-title"><a href="https://blog.dich.bid/network-yt-dlp/">网络艺术:Yt-dlp使用指南</a></h1>
<h1 class="post-title"><a href="https://blog.dich.bid/network-yt-dlp/">下载系列(2):Yt-dlp使用指南</a></h1>
<div class="post-meta-inline">
<span class="post-date">
@@ -116,13 +116,13 @@
<span class="post-tags-inline">
:: tags:&nbsp;
<a class="post-tag" href="https://blog.dich.bid/tags/wang-luo-yi-shu/">#网络艺术</a></span>
<a class="post-tag" href="https://blog.dich.bid/tags/network/">#Network</a></span>
<div class="post-content">
<p>前言 有时候我们想要视频保存到本地以便离线回看。yt-dlp是一款功能强大的命令行工具专注于下载视频与音频内容支持数千个平台是开源下载工具爱好者的常用选择。</p>
<p>前言 yt-dlp是一款功能强大的命令行工具专注于下载视频与音频内容支持数千个平台是开源下载工具爱好者的常用选择。</p>
</div>
<div>
<!-- &#xFE0E; -- force text style - some devices render this as emoji -->
@@ -137,7 +137,7 @@
<div class="post on-list">
<h1 class="post-title"><a href="https://blog.dich.bid/network-download-1/">网络艺术:下载技术的历史</a></h1>
<h1 class="post-title"><a href="https://blog.dich.bid/network-download-1/">下载系列(1):下载技术的历史</a></h1>
<div class="post-meta-inline">
<span class="post-date">

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -1 +1 @@
{"version":"1.3.0","languages":{"en":{"hash":"en_a5a6d11e14","wasm":"en","page_count":93}}}
{"version":"1.3.0","languages":{"en":{"hash":"en_1bd37ccdd4","wasm":"en","page_count":92}}}

Binary file not shown.

View File

@@ -224,9 +224,6 @@
<url>
<loc>https://blog.dich.bid/tags/network/</loc>
</url>
<url>
<loc>https://blog.dich.bid/tags/wang-luo-yi-shu/</loc>
</url>
<url>
<loc>https://blog.dich.bid/tags/windows/</loc>
</url>

View File

@@ -116,13 +116,7 @@
<li class="tag-list">
<a href="https://blog.dich.bid/tags/network/">
Network (10 posts)
</a>
</li>
<li class="tag-list">
<a href="https://blog.dich.bid/tags/wang-luo-yi-shu/">
网络艺术 (2 posts)
Network (12 posts)
</a>
</li>

View File

@@ -107,7 +107,7 @@ Dich&#x27;blog</title>
<div class="post">
<h1 class="post-title">
tag: #Network
(10 posts)
(12 posts)
</h1>
<a href="https://blog.dich.bid/tags">
@@ -116,9 +116,29 @@ Dich&#x27;blog</title>
<ul><li class="post-list">
<a href="https://blog.dich.bid/network-aria2/">
<span class="post-date">2025-04-15</span>
:: <span class="post-list-title">下载系列(3):Aria2使用指南</span></a>
<span class="post-tags-inline">
::
<a class="post-tag" href="https://blog.dich.bid/tags/network/">#Network</a></span>
</li>
<li class="post-list">
<a href="https://blog.dich.bid/network-yt-dlp/">
<span class="post-date">2025-04-12</span>
:: <span class="post-list-title">下载系列(2):Yt-dlp使用指南</span></a>
<span class="post-tags-inline">
::
<a class="post-tag" href="https://blog.dich.bid/tags/network/">#Network</a></span>
</li>
<li class="post-list">
<a href="https://blog.dich.bid/network-download-1/">
<span class="post-date">2025-04-11</span>
:: <span class="post-list-title">网络艺术:下载技术的历史</span></a>
:: <span class="post-list-title">下载系列(1):下载技术的历史</span></a>
<span class="post-tags-inline">
::

View File

@@ -1,162 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<title>
Dich&#x27;blog</title>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1">
<meta name="robots" content="noodp"/>
<link rel="stylesheet" href="https://blog.dich.bid/style.css">
<link rel="stylesheet" href="https://blog.dich.bid/color/blue.css">
<link rel="stylesheet" href="https://blog.dich.bid/color/background_dark.css">
<link rel="stylesheet" href="https://blog.dich.bid/font-hack-subset.css">
<meta name="description" content="All posts tagged 网络艺术">
<meta property="og:description" content="All posts tagged 网络艺术">
<meta property="og:title" content="Dich'blog">
<meta property="og:type" content="website">
<meta property="og:url" content="https://blog.dich.bid/tags/wang-luo-yi-shu/">
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:description" content="All posts tagged 网络艺术">
<meta name="twitter:title" content="Dich'blog">
<meta property="twitter:domain" content="blog.dich.bid">
<meta property="twitter:url" content="https://blog.dich.bid/tags/wang-luo-yi-shu/">
<link rel="alternate" type="application/atom+xml" title="Dich&#x27;blog Atom Feed" href="https://blog.dich.bid/atom.xml" />
<link rel="icon" type="image/png" href=&#x2F;dich.webp />
<!-- ✅ Added center alignment styles -->
<style>
.footer {
text-align: center;
padding: 1rem 0;
}
.footer__inner {
display: flex;
justify-content: center;
flex-direction: column;
align-items: center;
}
.copyright {
text-align: center;
}
</style>
</head>
<body class="">
<div class="container">
<header class="header">
<div class="header__inner">
<div class="header__logo">
<a href="https://blog.dich.bid" style="text-decoration: none;">
<div class="logo">
Dich&#x27;blog
</div>
</a>
</div>
</div>
<nav class="menu">
<ul class="menu__inner">
<li><a href="https://blog.dich.bid">blog</a></li>
<li><a href="https://blog.dich.bid/archive">archive</a></li>
<li class="active"><a href="https://blog.dich.bid/tags">tags</a></li>
<li><a href="https://blog.dich.bid/weekly">weekly</a></li>
<li><a href="https://blog.dich.bid/search">search</a></li>
<li><a href="https://blog.dich.bid/about">about me</a></li>
<li><a href="https://blog.dich.bid/links">links</a></li>
<li><a href="https://blog.dich.bid/atom.xml">rss</a></li>
<li><a href="https://github.com/Dichgrem" target="_blank" rel="noopener noreferrer">github</a></li>
</ul>
</nav>
</header>
<div class="content">
<div class="post">
<h1 class="post-title">
tag: #网络艺术
(2 posts)
</h1>
<a href="https://blog.dich.bid/tags">
Show all tags
</a>
<ul><li class="post-list">
<a href="https://blog.dich.bid/network-aria2/">
<span class="post-date">2025-04-15</span>
:: <span class="post-list-title">网络艺术:Aria2使用指南</span></a>
<span class="post-tags-inline">
::
<a class="post-tag" href="https://blog.dich.bid/tags/wang-luo-yi-shu/">#网络艺术</a></span>
</li>
<li class="post-list">
<a href="https://blog.dich.bid/network-yt-dlp/">
<span class="post-date">2025-04-12</span>
:: <span class="post-list-title">网络艺术:Yt-dlp使用指南</span></a>
<span class="post-tags-inline">
::
<a class="post-tag" href="https://blog.dich.bid/tags/wang-luo-yi-shu/">#网络艺术</a></span>
</li>
</ul>
</div>
</div>
<footer class="footer">
<div class="footer__inner">
<div class="copyright">
<span>©
2025
Dichgrem</span>
<span class="copyright-theme">
<span class="copyright-theme-sep"> :: CC BY-SA 4.0 :: A friend comes from distant lands</span>
</a>
</span>
</div>
</div>
</footer>
</div>
</body>
</html>