美文网首页Mac
youtube-dl安装以及简易使用

youtube-dl安装以及简易使用

作者: and2long | 来源:发表于2019-07-21 00:27 被阅读0次

安装youtube-dl

项目主页:https://github.com/ytdl-org/youtube-dl

安装ffmpeg

因涉及到格式转换,所以需要同时安装ffmpeg。

查看可用格式

$ youtube-dl -F https://www.youtube.com/watch?v=y83x7MgzWOA

指定代理

$ youtube-dl --proxy socks5://127.0.0.1:1086 -F https://www.youtube.com/watch?v=y83x7MgzWOA

输出信息如下:

zhanglilongsMBP:~ zhanglilong$ youtube-dl --proxy socks5://127.0.0.1:1086 -F https://www.youtube.com/watch?v=y83x7MgzWOA
[youtube] y83x7MgzWOA: Downloading webpage
[youtube] y83x7MgzWOA: Downloading video info webpage
[youtube] y83x7MgzWOA: Downloading js player vfld3bR7p
[youtube] y83x7MgzWOA: Downloading js player vfld3bR7p
[info] Available formats for y83x7MgzWOA:
format code  extension  resolution note
249          webm       audio only DASH audio   60k , opus @ 50k, 1.41MiB
250          webm       audio only DASH audio   78k , opus @ 70k, 1.85MiB
140          m4a        audio only DASH audio  130k , m4a_dash container, mp4a.40.2@128k, 3.44MiB
171          webm       audio only DASH audio  136k , vorbis@128k, 3.34MiB
251          webm       audio only DASH audio  150k , opus @160k, 3.61MiB
394          mp4        256x144    144p   94k , av01.0.05M.08, 24fps, video only, 2.15MiB
160          mp4        256x144    144p  111k , avc1.4d400c, 24fps, video only, 2.41MiB
278          webm       256x144    144p  122k , webm container, vp9, 24fps, video only, 2.46MiB
395          mp4        426x240    240p  219k , av01.0.05M.08, 24fps, video only, 4.48MiB
242          webm       426x240    240p  225k , vp9, 24fps, video only, 4.65MiB
133          mp4        426x240    240p  346k , avc1.4d4015, 24fps, video only, 5.19MiB
396          mp4        640x360    360p  382k , av01.0.05M.08, 24fps, video only, 8.06MiB
243          webm       640x360    360p  408k , vp9, 24fps, video only, 8.36MiB
134          mp4        640x360    360p  649k , avc1.4d401e, 24fps, video only, 9.82MiB
397          mp4        854x480    480p  725k , av01.0.05M.08, 24fps, video only, 14.36MiB
244          webm       854x480    480p  753k , vp9, 24fps, video only, 13.84MiB
135          mp4        854x480    480p  926k , avc1.4d401e, 24fps, video only, 14.90MiB
247          webm       1280x720   720p 1505k , vp9, 24fps, video only, 25.37MiB
136          mp4        1280x720   720p 1509k , avc1.4d401f, 24fps, video only, 23.93MiB
248          webm       1920x1080  1080p 2649k , vp9, 24fps, video only, 56.03MiB
137          mp4        1920x1080  1080p 4325k , avc1.640028, 24fps, video only, 74.44MiB
18           mp4        640x360    medium , avc1.42001E, mp4a.40.2@ 96k, 17.63MiB (best)

下载mp3文件

$ youtube-dl -x --audio-format mp3 --proxy socks5://127.0.0.1:1086 https://www.youtube.com/watch?v=y83x7MgzWOA

下载mp4格式视频

$ youtube-dl --proxy socks5://127.0.0.1:1086 -f '137+140' mw5VIEIvuMI

相关文章

网友评论

    本文标题:youtube-dl安装以及简易使用

    本文链接:https://www.haomeiwen.com/subject/hiiplctx.html