Linux 使用 youtube-dl 下载 youtobe 视频

环境

演示环境:linux

要求

linux 环境能够科研上网(透明模式)

安装 ffmpeg

1
2
3
4
5
6
wget https://johnvansickle.com/ffmpeg/releases/ffmpeg-release-amd64-static.tar.xz
tar xf ffmpeg-release-amd64-static.tar.xz
cp ffmpeg-5.1.1-amd64-static/ffmpeg /usr/bin/
chunli@blog:~/youtobe_dl$ ffmpeg #运行测试
ffmpeg version 5.0.1-static
chunli@blog:~/youtobe_dl$

2023.09.01 更新

youtube-dl 已失效

使用yt-dlp 替代

1
2
3
4
wget https://github.com/yt-dlp/yt-dlp/releases/download/2023.07.06/yt-dlp -O yt-dlp
chmod +x yt-dlp

用 yt-dlp代替 youtube-dl, 两者的使用参数也兼容

youtube-dl常用参数:

查看 视频资源 高清类型

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
-F  url                         查看视频资源的所有质量类型
-R 3 失败重试3次
--sleep-interval 3 每次下载间隔3秒(防止太频繁被youtube限流)
-i 忽略下载错误的,若无该参数,一个视频下载失败,就不再下载了
-f bestvideo+bestaudio 选择最佳视频,最佳音频
--merge-output-format mkv 输出封装格式
-o '%(title)s.%(ext)s' 输出文件名格式(参考:https://github.com/ytdl-org/youtube-dl/blob/master/README.md#output-template)

字幕选项:(比如有些英文课程,带上字幕方便理解)
默认的字幕在 potplayer 播放器可以显示, 但是 IOS的 nPlayer 播放器 不支持显示
--write-sub 下载字幕
--all-subs 下载字幕语言所有种类
--sub-lang zh-TW,ja 下载字幕语言种类
--embed-subs 合成字幕轨到封装
--convert-subs=srt 字幕转换,youtobe专用字幕格式转换为通用字幕格式(转换之后 IOS的 nPlayer 才可以显示字幕)

视频资源质量查看

示例: 1080P, 没有4K

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
chunli@blog:~/download$ youtube-dl -F https://www.youtube.com/watch?v=OanToL_DIxQ
[youtube] OanToL_DIxQ: Downloading webpage
[info] Available formats for OanToL_DIxQ:
format code extension resolution note
249 webm audio only tiny 49k , webm_dash container, opus @ 49k (48000Hz), 17.79MiB
250 webm audio only tiny 65k , webm_dash container, opus @ 65k (48000Hz), 23.63MiB
140 m4a audio only tiny 129k , m4a_dash container, mp4a.40.2@129k (44100Hz), 46.52MiB
251 webm audio only tiny 130k , webm_dash container, opus @130k (48000Hz), 46.86MiB
394 mp4 256x144 144p 65k , mp4_dash container, av01.0.00M.08@ 65k, 24fps, video only, 23.65MiB
160 mp4 256x144 144p 68k , mp4_dash container, avc1.4d400c@ 68k, 24fps, video only, 24.70MiB
278 webm 256x144 144p 82k , webm_dash container, vp9@ 82k, 24fps, video only, 29.69MiB
395 mp4 426x240 240p 113k , mp4_dash container, av01.0.00M.08@ 113k, 24fps, video only, 40.77MiB
133 mp4 426x240 240p 126k , mp4_dash container, avc1.4d4015@ 126k, 24fps, video only, 45.62MiB
242 webm 426x240 240p 148k , webm_dash container, vp9@ 148k, 24fps, video only, 53.38MiB
396 mp4 640x360 360p 232k , mp4_dash container, av01.0.01M.08@ 232k, 24fps, video only, 83.63MiB
134 mp4 640x360 360p 243k , mp4_dash container, avc1.4d401e@ 243k, 24fps, video only, 87.50MiB
243 webm 640x360 360p 270k , webm_dash container, vp9@ 270k, 24fps, video only, 97.25MiB
135 mp4 854x480 480p 397k , mp4_dash container, avc1.4d401e@ 397k, 24fps, video only, 142.85MiB
397 mp4 854x480 480p 417k , mp4_dash container, av01.0.04M.08@ 417k, 24fps, video only, 150.08MiB
244 webm 854x480 480p 453k , webm_dash container, vp9@ 453k, 24fps, video only, 162.83MiB
136 mp4 1280x720 720p 637k , mp4_dash container, avc1.4d401f@ 637k, 24fps, video only, 229.02MiB
398 mp4 1280x720 720p 845k , mp4_dash container, av01.0.05M.08@ 845k, 24fps, video only, 303.71MiB
247 webm 1280x720 720p 845k , webm_dash container, vp9@ 845k, 24fps, video only, 303.76MiB
399 mp4 1920x1080 1080p 1557k , mp4_dash container, av01.0.08M.08@1557k, 24fps, video only, 559.48MiB
248 webm 1920x1080 1080p 1977k , webm_dash container, vp9@1977k, 24fps, video only, 710.49MiB
137 mp4 1920x1080 1080p 2293k , mp4_dash container, avc1.640028@2293k, 24fps, video only, 824.09MiB
18 mp4 640x360 360p 372k , avc1.42001E, 24fps, mp4a.40.2 (44100Hz) (best)
chunli@blog:~/download$

示例:有1080P, 也有4K

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
chunli@blog:~/download$ youtube-dl -F https://www.youtube.com/watch?v=AY5qcIq5u2g
[youtube] AY5qcIq5u2g: Downloading webpage
[info] Available formats for AY5qcIq5u2g:
format code extension resolution note
249 webm audio only tiny 57k , webm_dash container, opus @ 57k (48000Hz), 292.95MiB
250 webm audio only tiny 76k , webm_dash container, opus @ 76k (48000Hz), 388.74MiB
140 m4a audio only tiny 129k , m4a_dash container, mp4a.40.2@129k (44100Hz), 662.07MiB
251 webm audio only tiny 144k , webm_dash container, opus @144k (48000Hz), 739.37MiB
160 mp4 256x144 144p 85k , mp4_dash container, avc1.4d400c@ 85k, 30fps, video only, 437.29MiB
278 webm 256x144 144p 94k , webm_dash container, vp9@ 94k, 30fps, video only, 485.71MiB
242 webm 426x240 240p 192k , webm_dash container, vp9@ 192k, 30fps, video only, 986.53MiB
133 mp4 426x240 240p 213k , mp4_dash container, avc1.4d4015@ 213k, 30fps, video only, 1.07GiB
243 webm 640x360 360p 379k , webm_dash container, vp9@ 379k, 30fps, video only, 1.89GiB
134 mp4 640x360 360p 467k , mp4_dash container, avc1.4d401e@ 467k, 30fps, video only, 2.33GiB
244 webm 854x480 480p 719k , webm_dash container, vp9@ 719k, 30fps, video only, 3.59GiB
135 mp4 854x480 480p 938k , mp4_dash container, avc1.4d401f@ 938k, 30fps, video only, 4.68GiB
247 webm 1280x720 720p 1556k , webm_dash container, vp9@1556k, 30fps, video only, 7.77GiB
136 mp4 1280x720 720p 1947k , mp4_dash container, avc1.64001f@1947k, 30fps, video only, 9.72GiB
248 webm 1920x1080 1080p 2612k , webm_dash container, vp9@2612k, 30fps, video only, 13.05GiB
137 mp4 1920x1080 1080p 4164k , mp4_dash container, avc1.640028@4164k, 30fps, video only, 20.80GiB
271 webm 2560x1440 1440p 7935k , webm_dash container, vp9@7935k, 30fps, video only, 39.63GiB
313 webm 3840x2160 2160p 15739k , webm_dash container, vp9@15739k, 30fps, video only, 78.60GiB
18 mp4 640x360 360p 567k , avc1.42001E, 30fps, mp4a.40.2 (44100Hz), 2.83GiB (best)
chunli@blog:~/download$

视频下载

最佳视频+最佳音频

1
2
3
4
5
6
7
8
9
10
11
chunli@blog:~/download$ youtube-dl -f bestvideo+bestaudio --merge-output-format mkv https://www.youtube.com/watch?v=0mjqVDmDqbM
[youtube] 0mjqVDmDqbM: Downloading webpage
[download] Resuming download at byte 288585
[download] Destination: 火箭少女101《月亮警察》制作特辑-0mjqVDmDqbM.f137.mp4
[download] 100% of 89.14MiB in 21:44
[download] Destination: 火箭少女101《月亮警察》制作特辑-0mjqVDmDqbM.f140.m4a
[download] 100% of 4.21MiB in 00:52
[ffmpeg] Merging formats into "火箭少女101《月亮警察》制作特辑-0mjqVDmDqbM.mkv"
Deleting original file 火箭少女101《月亮警察》制作特辑-0mjqVDmDqbM.f137.mp4 (pass -k to keep)
Deleting original file 火箭少女101《月亮警察》制作特辑-0mjqVDmDqbM.f140.m4a (pass -k to keep)
chunli@blog:~/download$

效果图1:

视频下载带字幕

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
chunli@blog:~/download$  youtube-dl --sub-lang zh-TW,ja --write-sub --embed-subs --merge-output-format mkv  https://www.youtube.com/watch?v=y5wkebBCwAE
[youtube] y5wkebBCwAE: Downloading webpage
[info] Writing video subtitles to: 【Evangelion OP】残酷な天使のテーゼ_高橋洋子(Covered by コバソロ & 若菜)-y5wkebBCwAE.zh-TW.vtt
[info] Writing video subtitles to: 【Evangelion OP】残酷な天使のテーゼ_高橋洋子(Covered by コバソロ & 若菜)-y5wkebBCwAE.ja.vtt
[download] Destination: 【Evangelion OP】残酷な天使のテーゼ_高橋洋子(Covered by コバソロ & 若菜)-y5wkebBCwAE.f137.mp4
[download] 100% of 42.64MiB in 12:51
[download] Destination: 【Evangelion OP】残酷な天使のテーゼ_高橋洋子(Covered by コバソロ & 若菜)-y5wkebBCwAE.f251.webm
[download] 100% of 4.17MiB in 01:15
[ffmpeg] Merging formats into "【Evangelion OP】残酷な天使のテーゼ_高橋洋子(Covered by コバソロ & 若菜)-y5wkebBCwAE.mkv"
Deleting original file 【Evangelion OP】残酷な天使のテーゼ_高橋洋子(Covered by コバソロ & 若菜)-y5wkebBCwAE.f137.mp4 (pass -k to keep)
Deleting original file 【Evangelion OP】残酷な天使のテーゼ_高橋洋子(Covered by コバソロ & 若菜)-y5wkebBCwAE.f251.webm (pass -k to keep)
[ffmpeg] Embedding subtitles in '【Evangelion OP】残酷な天使のテーゼ_高橋洋子(Covered by コバソロ & 若菜)-y5wkebBCwAE.mkv'
Deleting original file 【Evangelion OP】残酷な天使のテーゼ_高橋洋子(Covered by コバソロ & 若菜)-y5wkebBCwAE.zh-TW.vtt (pass -k to keep)
Deleting original file 【Evangelion OP】残酷な天使のテーゼ_高橋洋子(Covered by コバソロ & 若菜)-y5wkebBCwAE.ja.vtt (pass -k to keep)
chunli@blog:~/download$

效果图2:

字幕格式转换

将youtobe专用字幕格式转换为通用字幕格式

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
chunli@blog:~/download$ youtube-dl -f 278+249 --sub-lang zh-TW --write-sub --convert-subs=srt --embed-subs --merge-output-format mkv https://www.youtube.com/watch?v=Z-5OX1vwmPI
[youtube] Z-5OX1vwmPI: Downloading webpage
[info] Writing video subtitles to: 高中電子學_第4章 雙極性接面電晶體_1.雙極性電晶體的構造及特性_4-1.2 電晶體的符號、4-1.3 電晶體各極體的摻雜濃度關係_陳以熙-Z-5OX1vwmPI.zh-TW.vtt
[download] Destination: 高中電子學_第4章 雙極性接面電晶體_1.雙極性電晶體的構造及特性_4-1.2 電晶體的符號、4-1.3 電晶體各極體的摻雜濃度關係_陳以熙-Z-5OX1vwmPI.f278.webm
[download] 100% of 3.42MiB in 00:42
[download] Destination: 高中電子學_第4章 雙極性接面電晶體_1.雙極性電晶體的構造及特性_4-1.2 電晶體的符號、4-1.3 電晶體各極體的摻雜濃度關係_陳以熙-Z-5OX1vwmPI.f249.webm
[download] 100% of 4.13MiB in 00:51
[ffmpeg] Merging formats into "高中電子學_第4章 雙極性接面電晶體_1.雙極性電晶體的構造及特性_4-1.2 電晶體的符號、4-1.3 電晶體各極體的摻雜濃度關係_陳以熙-Z-5OX1vwmPI.mkv"
Deleting original file 高中電子學_第4章 雙極性接面電晶體_1.雙極性電晶體的構造及特性_4-1.2 電晶體的符號、4-1.3 電晶體各極體的摻雜濃度關係_陳以熙-Z-5OX1vwmPI.f278.webm (pass -k to keep)
Deleting original file 高中電子學_第4章 雙極性接面電晶體_1.雙極性電晶體的構造及特性_4-1.2 電晶體的符號、4-1.3 電晶體各極體的摻雜濃度關係_陳以熙-Z-5OX1vwmPI.f249.webm (pass -k to keep)
[ffmpeg] Converting subtitles
Deleting original file 高中電子學_第4章 雙極性接面電晶體_1.雙極性電晶體的構造及特性_4-1.2 電晶體的符號、4-1.3 電晶體各極體的摻雜濃度關係_陳以熙-Z-5OX1vwmPI.zh-TW.vtt (pass -k to keep)
[ffmpeg] Embedding subtitles in '高中電子學_第4章 雙極性接面電晶體_1.雙極性電晶體的構造及特性_4-1.2 電晶體的符號、4-1.3 電晶體各極體的摻雜濃度關係_陳以熙-Z-5OX1vwmPI.mkv'
Deleting original file 高中電子學_第4章 雙極性接面電晶體_1.雙極性電晶體的構造及特性_4-1.2 電晶體的符號、4-1.3 電晶體各極體的摻雜濃度關係_陳以熙-Z-5OX1vwmPI.zh-TW.srt (pass -k to keep)
chunli@blog:~/download$

效果图3:

下载所有字幕

支持 视频列表形式的 URL

1
2
3
4
5
6
7
8
9
10
11
12
13
14
chunli@blog:~/download$ youtube-dl -f 278+249 --write-sub --all-subs --convert-subs=srt --embed-subs --merge-output-format mkv https://www.youtube.com/watch?v=PHe0bXAIuk0
[youtube] PHe0bXAIuk0: Downloading webpage
[info] Writing video subtitles to: How The Economic Machine Works by Ray Dalio-PHe0bXAIuk0.fr.vtt
[info] Writing video subtitles to: How The Economic Machine Works by Ray Dalio-PHe0bXAIuk0.en.vtt
[info] Writing video subtitles to: How The Economic Machine Works by Ray Dalio-PHe0bXAIuk0.de.vtt
[info] Writing video subtitles to: How The Economic Machine Works by Ray Dalio-PHe0bXAIuk0.tr.vtt
[info] Writing video subtitles to: How The Economic Machine Works by Ray Dalio-PHe0bXAIuk0.it.vtt
[info] Writing video subtitles to: How The Economic Machine Works by Ray Dalio-PHe0bXAIuk0.und.vtt
[info] Writing video subtitles to: How The Economic Machine Works by Ray Dalio-PHe0bXAIuk0.es-ES.vtt
[info] Writing video subtitles to: How The Economic Machine Works by Ray Dalio-PHe0bXAIuk0.ja.vtt
[download] Destination: How The Economic Machine Works by Ray Dalio-PHe0bXAIuk0.f278.webm
[download] 100% of 9.67MiB in 02:51
[download] Destination: How The Economic Machine Works by Ray Dalio-PHe0bXAIuk0.f249.webm
[download] 36.3% of 12.01MiB at 57.74KiB/s ETA 02:15

效果图4

效果图4-nplayer

下载视频列表

最高质量-带字幕-所有字幕-字幕转换-保留缓存-间隔下载-下载重试-MKV封装-指定文件名格式

1
2
3
4
5
6
7
8
chunli@blog:~/download$ cat template_youtobe_dl/run_youtobe_dl.sh
#!/bin/bash

URL="https://www.youtube.com/watch?v=upe1T1023yo&list=PLI6pJZaOCtF3BGm_O2f4Xy2La0zJ4-4lJ"

youtube-dl -f bestvideo+bestaudio --write-sub --all-subs --convert-subs=srt --embed-subs -k -R 3 --sleep-interval 3 --merge-output-format mkv -o '%(title)s.%(ext)s' $URL

chunli@blog:~/download$

批量任务下载

URL任务准备

list.txt

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
微算機原理及應用(I)
https://www.youtube.com/watch?v=Hv_BzQZI5BI&list=PLI6pJZaOCtF0DBjbueOO6Kh8HOiJwImjn

微算機原理及應用(II)
https://www.youtube.com/watch?v=fNTDmaiTglU&list=PLI6pJZaOCtF2nmFzrl5UBwtKVDQvUekr9

高中電子學實習_工廠安全衛生及電子應用產品介紹
https://www.youtube.com/watch?v=bWsKhGmaVrc&list=PLI6pJZaOCtF1xx4esGP6rFIzLcpnp2D5b

高中電子學實習_二極體及應用電路
https://www.youtube.com/watch?v=RA3wxR0MnTY&list=PLI6pJZaOCtF3ZtG8SHxbZ7SU-UbFu134E

高中電子學實習_雙極性接面電晶體多級放大電路
https://www.youtube.com/watch?v=2BFz_9lsUd0&list=PLI6pJZaOCtF1LagSw7FCg4Fgo5dvwn4fu

高中電子學實習_金氧半場效電晶體(MOSFET)之判別
https://www.youtube.com/watch?v=rxvwfjsPu7w&list=PLI6pJZaOCtF3TS--eiZgLmiafjnZHkxeZ

高中電子學實習_金氧半場效電晶體數位電路
https://www.youtube.com/watch?v=wJceuEV2YzI&list=PLI6pJZaOCtF1oNab7oCcEBTE0MWHk8Krp

高中電子學實習_金氧半場效電晶體放大電路
https://www.youtube.com/watch?v=XmSa9K7DeU0&list=PLI6pJZaOCtF2qKDPurYQFF4vUJ_1jpo6b

高中電子學實習_金氧半場效電晶體多級放大電路
https://www.youtube.com/watch?v=Cl1BahqZK30&list=PLI6pJZaOCtF1fUAdhcTzNgxsNmVJwbNaZ

高中電子學實習_雙極性接面電晶體
https://www.youtube.com/watch?v=UXIoTEdFui8&list=PLI6pJZaOCtF0XKgY3iKeV3xJ6xzMYuZSq

高中電子學實習_音訊放大電路
https://www.youtube.com/watch?v=fJuxn57xDKE&list=PLI6pJZaOCtF3Yjf_XCq_ph2EgE2BPb7Ni

高中電子學實習_雙極性接面電晶體放大電路
https://www.youtube.com/watch?v=S47Q3IOfa_Y&list=PLI6pJZaOCtF0afECKSaf6AcEWHv-2oiJh

電子學實習_運算放大器應用電路
https://www.youtube.com/watch?v=JuCiDMrVVC0&list=PLI6pJZaOCtF26Vb9lzMLIMCUuQs51j98t

電子學實習_運算放大器振盪電路及濾波器
https://www.youtube.com/watch?v=xCODLoynFt4&list=PLI6pJZaOCtF2vzctcTN6R4aa_c65ST47Z

[高中]選修物理_近代物理
https://www.youtube.com/watch?v=yka_hThOjNU&list=PLI6pJZaOCtF0TaLLXuHvKB39CgueID2UC

高中數位邏輯_數字系統
https://www.youtube.com/watch?v=DN3aWVScL_Q&list=PLI6pJZaOCtF0IJiRiGyCMMEqPu-x9T2va

[高工]數位邏輯_基本邏輯閘
https://www.youtube.com/watch?v=ScCdax2dVOw&list=PLI6pJZaOCtF0VCFyeDd9jVx-XZsFFCzms

[高工]數位邏輯_布林代數及第摩根
https://www.youtube.com/watch?v=C72X8qkGKng&list=PLI6pJZaOCtF0fGVEbal0S37jh5csiMAt2

[高工]數位邏輯_布林代數的化簡
https://www.youtube.com/watch?v=XEPTdb95CrQ&list=PLI6pJZaOCtF2SOiWesnxvRYDs98FfhuT6

[高工]數位邏輯_組合邏輯電路之設
https://www.youtube.com/watch?v=Dwza5xMWwbY&list=PLI6pJZaOCtF2tJIQ2ASseHZAIQciDlyjl

[高工]數位邏輯_正反器
https://www.youtube.com/watch?v=3_sK3UkncJE&list=PLI6pJZaOCtF1PDGIzAnbFoWaoT4rpX2Ux

[高工]數位邏輯_循序邏輯電路之設
https://www.youtube.com/watch?v=6QZSNSevSA4&list=PLI6pJZaOCtF2Qbr7ZGz0WR00K-EUKmLDY

[高工]數位邏輯實習_基本邏輯閘實驗
https://www.youtube.com/watch?v=NYF7WEg0h_E&list=PLI6pJZaOCtF0Sp0TMG_IqVR5F_3ESKoDN

[高工]數位邏輯實習_工場安全及衛生
https://www.youtube.com/watch?v=A_T73wBNjIs&list=PLI6pJZaOCtF2_l-6ZsyUGHYPlCFpyoprJ

[高工]數位邏輯實習_邏輯實驗儀器
https://www.youtube.com/watch?v=DiJNwmMsI3k&list=PLI6pJZaOCtF10UhxMBiU-_aSGAptRdLbF

[高工]數位邏輯實習_基本邏輯閘實驗
https://www.youtube.com/watch?v=NYF7WEg0h_E&list=PLI6pJZaOCtF0Sp0TMG_IqVR5F_3ESKoDN

[高工]數位邏輯實習_組合邏輯實驗
https://www.youtube.com/watch?v=rZNwrCljTf0&list=PLI6pJZaOCtF2vIVOj1QY8BOtRNKjSbgER

[高工]數位邏輯實習_加法器及減法器
https://www.youtube.com/watch?v=xw4sYQ5g8Vk&list=PLI6pJZaOCtF2ZI0ksTLGaNnjtPU2N3EGt

[高工]數位邏輯實習_組合邏輯電路
https://www.youtube.com/watch?v=uXFImkM8LEg&list=PLI6pJZaOCtF1dwnU9hrUUA_Fbil6Kfdva

[高工]數位邏輯實習_正反器實驗
https://www.youtube.com/watch?v=GyTPzivkXRU&list=PLI6pJZaOCtF0diZcLHwdNtlLX8xCVEuGN

[高工]數位邏輯實習_循序邏輯電路應用實驗
https://www.youtube.com/watch?v=nV4Smh5GIuQ&list=PLI6pJZaOCtF1_bE5pg4V79QAKdNx533mz

特定脚本

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
chunli@blog:~/download$ cat run_youtobe_dl.sh
#!/bin/bash

URL=$1
echo 任务载入 $URL >> youtube.log

youtube-dl -f bestvideo+bestaudio --write-sub --all-subs --convert-subs=srt --embed-subs -k -R 3 --sleep-interval 3 --merge-output-format mkv -o '%(title)s.%(ext)s' $URL
if [ $? -eq 0 ]
then
echo 下载成功 $URL >> youtube.log
else
echo 下载失败 $URL >> youtube.log
fi

chunli@blog:~/download$

批量下载

1
2
3
4
5
6
7
8
9
10
11
12
13
14
chunli@blog:~/download$ > youtube.log  # 清空日志
chunli@blog:~/download$ cat list.txt | grep https | awk '{printf "\"%s\"\n", $1}'|xargs -P 4 -i ./run_youtobe_dl.sh {} #开始下载
chunli@blog:~/download$
chunli@blog:~/download$ tail -f youtube.log #查看日志
任务载入 https://www.youtube.com/watch?v=Hv_BzQZI5BI&list=PLI6pJZaOCtF0DBjbueOO6Kh8HOiJwImjn
任务载入 https://www.youtube.com/watch?v=fNTDmaiTglU&list=PLI6pJZaOCtF2nmFzrl5UBwtKVDQvUekr9
任务载入 https://www.youtube.com/watch?v=XmSa9K7DeU0&list=PLI6pJZaOCtF2qKDPurYQFF4vUJ_1jpo6b
任务载入 https://www.youtube.com/watch?v=RA3wxR0MnTY&list=PLI6pJZaOCtF3ZtG8SHxbZ7SU-UbFu134E
下载失败 https://www.youtube.com/watch?v=fNTDmaiTglU&list=PLI6pJZaOCtF2nmFzrl5UBwtKVDQvUekr9
下载失败 https://www.youtube.com/watch?v=XmSa9K7DeU0&list=PLI6pJZaOCtF2qKDPurYQFF4vUJ_1jpo6b
下载失败 https://www.youtube.com/watch?v=RA3wxR0MnTY&list=PLI6pJZaOCtF3ZtG8SHxbZ7SU-UbFu134E
下载成功 https://www.youtube.com/watch?v=XmSa9K7DeU0&list=PLI6pJZaOCtF2qKDPurYQFF4vUJ_1jpo6b
下载成功 https://www.youtube.com/watch?v=fNTDmaiTglU&list=PLI6pJZaOCtF2nmFzrl5UBwtKVDQvUekr9
下载成功 https://www.youtube.com/watch?v=Hv_BzQZI5BI&list=PLI6pJZaOCtF0DBjbueOO6Kh8HOiJwImjn

查看下载任务

1
2
3
4
5
6
7
8
9
10
11
12
13
chunli@blog:~/download$ ps -ef | grep -i  run_youtobe_dl
chunli 35184 34909 0 09:06 pts/0 00:00:00 xargs -P 10 -i ./run_youtobe_dl.sh {}
chunli 35185 35184 0 09:06 pts/0 00:00:00 /bin/bash ./run_youtobe_dl.sh https://www.youtube.com/watch?v=Hv_BzQZI5BI&list=PLI6pJZaOCtF0DBjbueOO6Kh8HOiJwImjn
chunli 35187 35184 0 09:06 pts/0 00:00:00 /bin/bash ./run_youtobe_dl.sh https://www.youtube.com/watch?v=bWsKhGmaVrc&list=PLI6pJZaOCtF1xx4esGP6rFIzLcpnp2D5b
chunli 35189 35184 0 09:06 pts/0 00:00:00 /bin/bash ./run_youtobe_dl.sh https://www.youtube.com/watch?v=RA3wxR0MnTY&list=PLI6pJZaOCtF3ZtG8SHxbZ7SU-UbFu134E
chunli 35191 35184 0 09:06 pts/0 00:00:00 /bin/bash ./run_youtobe_dl.sh https://www.youtube.com/watch?v=2BFz_9lsUd0&list=PLI6pJZaOCtF1LagSw7FCg4Fgo5dvwn4fu
chunli 35192 35184 0 09:06 pts/0 00:00:00 /bin/bash ./run_youtobe_dl.sh https://www.youtube.com/watch?v=rxvwfjsPu7w&list=PLI6pJZaOCtF3TS--eiZgLmiafjnZHkxeZ
chunli 35194 35184 0 09:06 pts/0 00:00:00 /bin/bash ./run_youtobe_dl.sh https://www.youtube.com/watch?v=wJceuEV2YzI&list=PLI6pJZaOCtF1oNab7oCcEBTE0MWHk8Krp
chunli 35196 35184 0 09:06 pts/0 00:00:00 /bin/bash ./run_youtobe_dl.sh https://www.youtube.com/watch?v=XmSa9K7DeU0&list=PLI6pJZaOCtF2qKDPurYQFF4vUJ_1jpo6b
chunli 35198 35184 0 09:06 pts/0 00:00:00 /bin/bash ./run_youtobe_dl.sh https://www.youtube.com/watch?v=UXIoTEdFui8&list=PLI6pJZaOCtF0XKgY3iKeV3xJ6xzMYuZSq
chunli 35377 35184 0 09:08 pts/0 00:00:00 /bin/bash ./run_youtobe_dl.sh https://www.youtube.com/watch?v=S47Q3IOfa_Y&list=PLI6pJZaOCtF0afECKSaf6AcEWHv-2oiJh
chunli 35405 35184 0 09:09 pts/0 00:00:00 /bin/bash ./run_youtobe_dl.sh https://www.youtube.com/watch?v=JuCiDMrVVC0&list=PLI6pJZaOCtF26Vb9lzMLIMCUuQs51j98t
chunli@blog:~/download$

查看下载结果

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
hunli@blog:~/download$ ll *mkv
-rw-r--r-- 1 chunli chunli 45M Jan 3 2021 '微算機原理及應用(I)_林淵翔_單元一微電腦系統的簡介_PART A_數位系統、數位邏輯閘的特性、數位資料的各種單位、資料與程式記憶體.mkv'
-rw-r--r-- 1 chunli chunli 27M Mar 13 2018 '微算機原理及應用(I)_林淵翔_單元一微電腦系統的簡介_PART B_微電腦系統的架構、匯流排的種類、處理器的內部架構與運作方式.mkv'
-rw-r--r-- 1 chunli chunli 21M Mar 14 2018 '微算機原理及應用(I)_林淵翔_單元一微電腦系統的簡介_PART C_嵌入式系統、微控制器和微處理器的差異、系統晶片(SOC)範例.mkv'
-rw-r--r-- 1 chunli chunli 24M Mar 6 2018 '微算機原理及應用(I)_林淵翔_單元三8051的組合語言程式設計_PART A_組合語言的格式、各種定址法.mkv'
-rw-r--r-- 1 chunli chunli 53M Jul 30 2021 '微算機原理及應用(I)_林淵翔_單元二8051的簡介與架構介紹_PART A_8051的介紹(特性、架構、家族).mkv'
-rw-r--r-- 1 chunli chunli 27M Dec 24 13:42 '微算機原理及應用(I)_林淵翔_單元二8051的簡介與架構介紹_PART B_8051的暫存器和記憶體、8051的接腳、8051的最簡單線路圖.mkv'
-rw-r--r-- 1 chunli chunli 25M May 10 2022 電子學實習_運算放大器應用電路_儀表放大器應用電路_支裕文.mkv
-rw-r--r-- 1 chunli chunli 23M Oct 19 2021 電子學實習_運算放大器應用電路_儀表電路應用概論及物理信號取樣與轉換_支裕文.mkv
-rw-r--r-- 1 chunli chunli 18M May 10 2022 電子學實習_運算放大器應用電路_反相放大器應用與實務剖析_支裕文.mkv
-rw-r--r-- 1 chunli chunli 19M Jan 2 05:46 電子學實習_運算放大器應用電路_阻抗匹配與負載效應_支裕文.mkv
-rw-r--r-- 1 chunli chunli 16M Oct 19 2021 電子學實習_運算放大器應用電路_電壓隨耦器應用電路與實務剖析_支裕文.mkv
-rw-r--r-- 1 chunli chunli 18M May 10 2022 電子學實習_運算放大器應用電路_非反相放大器應用與實務剖析_支裕文.mkv
-rw-r--r-- 1 chunli chunli 45M Sep 6 2017 '高中數位邏輯_數字系統_1.十進位表示法_ 支裕文.mkv'
-rw-r--r-- 1 chunli chunli 36M Sep 6 2017 '高中數位邏輯_數字系統_2. 二進位表示法_ 支裕文.mkv'
-rw-r--r-- 1 chunli chunli 37M Sep 5 2019 '高中物理_選修物理 V_6-2 量子現象_湯木生陰極射線管(1)_陳家騏.mkv'
-rw-r--r-- 1 chunli chunli 44M Mar 25 2019 '高中物理_選修物理 V_6-2 量子現象_湯木生陰極射線管(2)_陳家騏.mkv'
-rw-r--r-- 1 chunli chunli 52M Jan 22 2021 高中電子學實習_二極體及應用電路_二極體之識別原理篇_邱孟希.mkv
-rw-r--r-- 1 chunli chunli 22M Jan 22 2021 高中電子學實習_二極體及應用電路_二極體之識別模擬篇_邱孟希.mkv
-rw-r--r-- 1 chunli chunli 35M Oct 21 2020 高中電子學實習_工廠安全衛生及電子應用產品介紹_線上版模擬軟體_邱孟希.mkv
-rw-r--r-- 1 chunli chunli 48M Jan 22 2021 高中電子學實習_工廠安全衛生及電子應用產品介紹_電子應用產品_邱孟希.mkv
-rw-r--r-- 1 chunli chunli 30M Oct 21 2020 '高中電子學實習_工廠安全衛生及電子應用產品介紹_電子零件 Part A_邱孟希.mkv'
-rw-r--r-- 1 chunli chunli 43M Jan 22 2021 '高中電子學實習_工廠安全衛生及電子應用產品介紹_電子零件 Part B_邱孟希.mkv'
-rw-r--r-- 1 chunli chunli 53M Dec 14 2020 '高中電子學實習_金氧半場效電晶體(MOSFET)之判別_N型金氧半場效電晶體之判別_張元庭.mkv'
-rw-r--r-- 1 chunli chunli 42M Dec 14 2020 '高中電子學實習_金氧半場效電晶體(MOSFET)之判別_P型金氧半場效電晶體之判別_張元庭.mkv'
-rw-r--r-- 1 chunli chunli 79M Jan 4 17:24 '高中電子學實習_金氧半場效電晶體(MOSFET)之判別_金氧半場效應電晶體之識別PART A _張元庭.mkv'
-rw-r--r-- 1 chunli chunli 75M Dec 14 2020 '高中電子學實習_金氧半場效電晶體(MOSFET)之判別_金氧半場效應電晶體之識別PART B _張元庭.mkv'
-rw-r--r-- 1 chunli chunli 27M Jun 1 2021 高中電子學實習_金氧半場效電晶體放大電路_D-MOSFET相關知識介紹-原理篇_劉政鑫.mkv
-rw-r--r-- 1 chunli chunli 27M Jun 1 2021 高中電子學實習_金氧半場效電晶體放大電路_E-MOSFET相關知識介紹-原理篇_劉政鑫.mkv
-rw-r--r-- 1 chunli chunli 28M Jun 1 2021 '高中電子學實習_金氧半場效電晶體放大電路_MOSFET小訊號相關知識介紹(一)-原理篇(小訊號與放大器)_劉政鑫.mkv'
-rw-r--r-- 1 chunli chunli 33M Jun 1 2021 '高中電子學實習_金氧半場效電晶體放大電路_MOSFET小訊號相關知識介紹(二)-原理篇(放大工作原理)_劉政鑫.mkv'
-rw-r--r-- 1 chunli chunli 99M Sep 22 2021 高中電子學實習_金氧半場效電晶體放大電路_MOSFET小訊號量測相關儀器操作介紹_劉政鑫.mkv
-rw-r--r-- 1 chunli chunli 33M Sep 22 2021 高中電子學實習_金氧半場效電晶體放大電路_固定式偏壓共源極交流實作與量測-量測篇_劉政鑫.mkv
-rw-r--r-- 1 chunli chunli 27M Jun 1 2021 高中電子學實習_金氧半場效電晶體放大電路_固定式偏壓式共源極直流工作點設計與量測-量測篇_劉政鑫.mkv
-rw-r--r-- 1 chunli chunli 79M Jun 11 2021 '高中電子學實習_金氧半場效電晶體數位電路_反相器PART A _莊凱喬.mkv'
-rw-r--r-- 1 chunli chunli 68M Jun 11 2021 '高中電子學實習_金氧半場效電晶體數位電路_反相器PART B _莊凱喬.mkv'
-rw-r--r-- 1 chunli chunli 62M Feb 18 2021 '高中電子學實習_金氧半場效電晶體數位電路_特性量測PART A _莊凱喬.mkv'
-rw-r--r-- 1 chunli chunli 40M Jan 4 03:49 高中電子學實習_雙極性接面電晶體多級放大電路_串級放大電路RC耦合電路-原理篇_劉政鑫.mkv
-rw-r--r-- 1 chunli chunli 29M Jan 6 2021 高中電子學實習_雙極性接面電晶體多級放大電路_串級放大電路RC耦合電路-實作篇_劉政鑫.mkv
-rw-r--r-- 1 chunli chunli 37M Jan 6 2021 高中電子學實習_雙極性接面電晶體多級放大電路_串級放大電路RC耦合電路-模擬篇_劉政鑫.mkv
-rw-r--r-- 1 chunli chunli 38M Dec 28 07:26 高中電子學實習_雙極性接面電晶體多級放大電路_串級放大電路直接耦合電路-原理篇_劉政鑫.mkv
-rw-r--r-- 1 chunli chunli 29M Jan 6 2021 高中電子學實習_雙極性接面電晶體多級放大電路_串級放大電路直接耦合電路-模擬篇_劉政鑫.mkv
-rw-r--r-- 1 chunli chunli 25M Jan 14 00:51 '高中電子學實習_雙極性接面電晶體放大電路_複習並聯電路進階觀念PART A.mkv'
-rw-r--r-- 1 chunli chunli 17M Nov 1 2021 '高中電子學實習_雙極性接面電晶體放大電路_複習並聯電路進階觀念PART B_洪均在.mkv'
-rw-r--r-- 1 chunli chunli 23M Jan 13 23:10 '高中電子學實習_雙極性接面電晶體放大電路_複習串並聯電路進階觀念PART A_洪均在.mkv'
-rw-r--r-- 1 chunli chunli 29M Oct 26 2020 '高中電子學實習_雙極性接面電晶體放大電路_複習串並聯電路進階觀念PART B_洪均在.mkv'
-rw-r--r-- 1 chunli chunli 32M Nov 1 2021 高中電子學實習_雙極性接面電晶體放大電路_複習串聯進階觀念_洪均在.mkv
-rw-r--r-- 1 chunli chunli 29M Jun 12 2020 高中電子學實習_雙極性接面電晶體_雙極性接面電晶體之識別_BJT之工作原理_洪均在.mkv
-rw-r--r-- 1 chunli chunli 17M Nov 1 2021 高中電子學實習_雙極性接面電晶體_雙極性接面電晶體之識別_BJT使用於放大器_洪均在.mkv
-rw-r--r-- 1 chunli chunli 26M Nov 1 2021 高中電子學實習_雙極性接面電晶體_雙極性接面電晶體之識別_BJT分類與結構_洪均在.mkv
-rw-r--r-- 1 chunli chunli 29M Nov 1 2021 高中電子學實習_雙極性接面電晶體_雙極性接面電晶體之識別_BJT在直流與交流之電流與方向_洪均在.mkv
-rw-r--r-- 1 chunli chunli 21M Nov 1 2021 高中電子學實習_雙極性接面電晶體_雙極性接面電晶體之識別_BJT種類與外觀_洪均在.mkv
-rw-r--r-- 1 chunli chunli 38M Dec 9 07:06 高中電子學實習_雙極性接面電晶體_雙極性接面電晶體之識別_NPN與PNP之判別_洪均在.mkv
-rw-r--r-- 1 chunli chunli 32M Nov 1 2021 高中電子學實習_雙極性接面電晶體_雙極性接面電晶體之識別_電晶體E、C腳位判別_洪均在.mkv
-rw-r--r-- 1 chunli chunli 33M Nov 1 2021 高中電子學實習_雙極性接面電晶體_雙極性接面電晶體之識別_電晶體的編號與規格_洪均在.mkv
chunli@blog:~/download$