下載youtube視訊 使用youtube-dl
阿新 • • 發佈:2018-12-16
安裝
Linux/Mac/Windows
sudo -H pip install --upgrade youtube-dl
Mac
brew install youtube-dl
下載(首先你需要能訪問youtube/科學上網教程手動版 自動版)
獲取視訊資訊:(使用了藍燈目前預設代理埠49944)
youtube-dl -F https://www.youtube.com/watch\?v\=nKW8Ndu7Mjw --proxy 'https://127.0.0.1:49944'
輸出資訊:
[youtube] nKW8Ndu7Mjw: Downloading webpage
[youtube] nKW8Ndu7Mjw: Downloading video info webpage
[info] Available formats for nKW8Ndu7Mjw:
format code extension resolution note
249 webm audio only DASH audio 66k , opus @ 50k, 3.88MiB
250 webm audio only DASH audio 86k , opus @ 70k, 4.84MiB
140 m4a audio only DASH audio 128k , m4a_dash container, [email protected], 9.63MiB
171 webm audio only DASH audio 131k , [email protected], 8.12MiB
251 webm audio only DASH audio 162k , opus @160k, 8.87MiB
160 mp4 256x144 144p 48k , avc1.4d400c, 24fps, video only, 2.82MiB
133 mp4 426x240 240p 88k , avc1.4d4015, 24fps, video only, 4.61MiB
278 webm 256x144 144p 101k , webm container, vp9, 24fps, video only, 6.87MiB
242 webm 426x240 240p 110k , vp9, 24fps, video only, 6.86MiB
243 webm 640x360 360p 226k , vp9, 24fps, video only, 11.27MiB
134 mp4 640x360 360p 242k , avc1.4d401e, 24fps, video only, 9.13MiB
244 webm 854x480 480p 370k , vp9, 24fps, video only, 17.38MiB
135 mp4 854x480 480p 516k , avc1.4d401e, 24fps, video only, 15.20MiB
247 webm 1280x720 720p 564k , vp9, 24fps, video only, 26.36MiB
248 webm 1920x1080 1080p 930k , vp9, 24fps, video only, 42.14MiB
136 mp4 1280x720 720p 1001k , avc1.4d401f, 24fps, video only, 23.99MiB
137 mp4 1920x1080 1080p 1756k , avc1.640028, 24fps, video only, 40.63MiB
17 3gp 176x144 small , mp4v.20.3, [email protected] 24k, 6.15MiB
36 3gp 320x180 small , mp4v.20.3, mp4a.40.2, 16.89MiB
18 mp4 640x360 medium , avc1.42001E, [email protected] 96k, 26.96MiB
43 webm 640x360 medium , vp8.0, [email protected], 38.19MiB
22 mp4 1280x720 hd720 , avc1.64001F, [email protected] (best)
下載:把大寫F換成小寫f 然後加引數 下載指定的解析度和聲音位元速率要使用 前面編號
比如 22+140 視訊編號+聲音編號 下載完成後會嘗試合併 有些會因為源熱度太低一直失敗無法下載
youtube-dl -f 22+140 https://www.youtube.com/watch\?v\=nKW8Ndu7Mjw --proxy 'https://127.0.0.1:49944'
出現這樣的資訊就等待下載完成吧
[download] 3.4% of 33.58MiB at 14.38KiB/s ETA 38:31