从youtube下载视频的自动化服务
ytdownloader的Python项目详细描述
youtubedownloader是一个自动下载多个 YouTube视频。
关于
youtubedownloader是用Python编写的。它使用 Asynchronous Python Multiprocessing的核心 用户一次下载多个视频。
youtubedownloader必须使用配置文件。它支撑着山药 /配置文件的json格式。此配置文件提供 服务的结构和可用性。它定义了 videos/playlists需要下载,以及如何下载 存储。
配置语法
youtubedownloader支持yaml/json配置格式。 youtubedownloader更喜欢yaml而不是json。下面是片段 yaml/json格式的示例配置。
settings: process: 2 download: mostlyinsane: dirname: '../mostlyinsane' videos: - 'https://www.youtube.com/watch?v=vcKPjDUc5EQ' trippling: dirname: 'trippling' playlists: 'https://www.youtube.com/watch?list=PLTB0eCoUXEraZe3d7fJRdB-znE5D0cMZ7' official-ceogiri: dirname: 'official-ceogiri' playlists: - 'https://www.youtube.com/watch?list=PLTB0eCoUXEraZe3d7fJRdB-znE5D0cMZ7'
{ "settings": { "process": 5 }, "download": { "mostlyinsane": { "dirname": "../mostlyinsane", "videos": [ "https://www.youtube.com/watch?v=vcKPjDUc5EQ" ] }, "trippling": { "dirname": "trippling", "playlists": "https://www.youtube.com/watch?list=PLTB0eCoUXEraZe3d7fJRdB-znE5D0cMZ7" }, "official-ceogiri": { "dirname": "official-ceogiri", "playlists": [ "https://www.youtube.com/watch?list=PLTB0eCoUXEraZe3d7fJRdB-znE5D0cMZ7" ] } } }
settings定义服务级别变量。-process强制 youtubedownloader使用Asynchronous Python Multiprocessing和 告诉应该部署多少进程来下载 视频/播放列表一次。
download定义要下载的视频/播放列表。IT标签 dirnames和videos/playlists在内部存储 已在相应的目录中下载视频/播放列表。
- dirname相对/绝对目录路径存储视频 在。
- videossingle/array的youtube视频链接下载。
- playlistssingle/array的youtube播放列表链接 下载。
安装
这是为python 2.6+和python 3.0+构建的纯python包。到 设置:
sudo pip install ytdownloader
选项
ytdownloader --help
- config指定配置文件的位置 youtubedownloader。如果省略,则youtubedownloader将查找 配置文件的当前目录。
- --version指定youtubedownloader的当前版本。
- --about关于youtubedownloader的文本
用法
ytdownloader --version // latest version of ytdownloader
ytdownloader --about // about text for ytdownloader
ytdownloader // start the ytdownloader and search config file in current directory
ytdownloader docs/config.yaml // start the ytdownloader and use docs/config.yaml as config file