命令行工具

youtube-dl 使用

2020-09-02  本文已影响0人  舌尖上的大胖

油管上有很多不错的教程和有营养的内容,可以下载下来反复观看。这里推荐个开源项目,在这里 https://github.com/ytdl-org/youtube-dl 查看详情。

一、安装

$ brew install youtube-dl

二、常用方法

1、常规使用

$ youtube-dl 'https://www.youtube.com/your/url'

2、下载指定格式

-F, --list-formats ................................... 列出支持的所有格式
--all-formats ........................................ 下载所有支持的格式
-f, --format <FORMAT> ................................ 下载指定格式

例如:只下载 m4a 格式:

$ youtube-dl -f m4a 'https://www.youtube.com/your/url'

3、使用外部下载工具

目前支持 aria2cavconvaxelcurlffmpeghttpiewget。以 aria2c 举例。

$ youtube-dl --external-downloader aria2c 'https://www.youtube.com/your/url'

4、下载列表中的指定下载范围

--playlist-start <NUMBER> ........ 列表中的开始位置,默认为 1
--playlist-end <NUMBER> .......... 列表中的结束位置,默认为最后一个
--playlist-items <ITEM_SPEC> ..... 指定下载项,如:--playlist-items 1-3,7,10-13

5、提取列表

$ youtube-dl --flat-playlist 'https://www.youtube.com/your/playlist/url'

(完)

上一篇 下一篇

猜你喜欢

热点阅读