简化了搜索、下载YouTube视频并将其转换为MP3文件的过程
yt2mp3的Python项目详细描述
YouTube到MP3
说明
这个程序简化了从命令行搜索、下载和转换youtube视频到mp3文件的过程。您需要的只是视频URL或您要查找的艺术家/曲目的名称。
如果没有提供url,程序将尝试通过查询itunes api检索与所提供输入匹配的歌曲的数据,并使用这些数据查找相应的youtube视频。然后将下载、转换视频,并使用收集的数据填充MP3的元数据。
完成后,生成的mp3文件将保存到downloads目录中,文件结构如下Music/{artist}/{track}.mp3
。
注意:如果提供了一个url,但找不到歌曲数据的匹配项,则程序将提示用户输入曲目/艺术家,并且youtube缩略图将用作唱片集插图。
开始
先决条件
程序只需要安装python 3.4+和ffmpeg或libav。有关详细信息,请查看additional setup。
安装
您可以使用以下命令安装程序:
$ pip install yt2mp3
用法
程序可以通过以下方式执行:
$ yt2mp3 [-options]
选项:
Arguments | |
---|---|
^{ | Specify the track name query |
^{ | Specify the artist name query |
^{ | Specify the album name query |
^{ | Specify a Youtube URL or ID |
^{ | Specify a Youtube playlist URL or ID |
^{ | Overwrite the file if one exists in output directory |
^{ | Specify the resolution for the cover-art |
^{ | Suppress program command-line output |
^{ | Display a command-line progress bar |
^{ | Show the version number and exit |
^{ | Display information on usage and functionality |
文档
更多文档可在Read The Docs
贡献
如果你想为这个项目做贡献,可以建议一个feature request和/或提交一个pull request。