下载一个youtube mashup视频并将其拆分为一个带标签的音频文件列表
mashdown的Python项目详细描述
mashdown将下载一个youtube mashup视频,并将其拆分为单独的音频文件,其中包含文档化的音频标签。
warning:要使mashdown正常工作,视频必须附带一个tracklist,列出每个曲目的开始时间和曲目名称。tracklist可以在youtube描述中,也可以在本地文件中。这是一个完美的候选人。
安装
要安装mashdown,只需使用pip:
$ pip install mashdown
示例
下载并拆分mashup
$ mashdown \ --audioformat ogg \ --album "The Lord of the Rings Sountrack"\ --artist "Howard Shore"\ https://www.youtube.com/watch\?v\=upzOSSQWSYU
拆分本地mashup
在本例中,不会下载mashup。youtube url仅用于获取tracklist信息。
$ mashdown \ --audioformat ogg \ --mashupfile path/to/mashupfile --album "The Lord of the Rings Sountrack"\ --artist "Howard Shore"\ https://www.youtube.com/watch\?v\=upzOSSQWSYU
用法
- usage: mashdown [-h] [-m MASHUPFILE] [–input-audioformat INPUT_AUDIOFORMAT]
- [-f AUDIOFORMAT] [-o OUTPUT_DIR] [-q] [–artist ARTIST] [–album ALBUM] url
Split a Youtube mashup video into a list of tagged audio tracks
- positional arguments:
- url The youtube link to the mashup.
- optional arguments:
-h, --help show this help message and exit -m MASHUPFILE, --mashupfile MASHUPFILE The local path, relative or absolute, to the mashup file. --input-audioformat INPUT_AUDIOFORMAT The prefered audio format for the source mashup file. -f AUDIOFORMAT, --audioformat AUDIOFORMAT The export audio format. Examples: ‘mp3’, ‘ogg’, ‘mp4’, ‘flac’, … -o OUTPUT_DIR, --output-dir OUTPUT_DIR The directory in which the output directory will be created.By default, the current directory will be used. -q, --quiet Remove non important log messages - metadata:
--artist ARTIST The artist name --album ALBUM The album name
依赖关系
mashdown取决于以下库:
- pydub(需要在系统上安装ffmpeg或avconv)来剪切视频文件并导出音频段
- pafy,下载YouTube视频并获取其元数据
- mutagen,编辑音频文件元数据
释放量
0.1.1
- 曲目名称可以位于曲目开始时间之前或之后
- 添加了单元测试
0.1.0
初始版本