<!-- MANPAGE: BEGIN EXCLUDED SECTION -->
<div align="center">
[![music-tool-kit](https://raw.githubusercontent.com/nichuanfang/music-tool-kit/main/.github/banner.svg)](#readme)
[![PyPi](https://img.shields.io/badge/-PyPi-blue.svg?logo=pypi&labelColor=555555&style=for-the-badge)](https://pypi.org/project/music-tool-kit "music-tool-kit")
[![License: Unlicense](https://img.shields.io/badge/-Unlicense-blue.svg?style=for-the-badge)](LICENSE "License")
[![Commits](https://img.shields.io/github/commit-activity/m/nichuanfang/music-tool-kit?label=commits&style=for-the-badge)](https://github.com/nichuanfang/music-tool-kit/commits "Commit History")
</div>
<!-- MANPAGE: END EXCLUDED SECTION -->
**music-tool-kit**,主要使用场景为提取[youtube](https://www.youtube.com)和[bilibili](https://www.bilibili.com)视频中的音频,支持**音频下载**,**元信息自动补全**,**音频截取**,**提取伴奏**,**youtube 列表批量下载**,**自定义批量下载**等.配合[itunes](https://www.bilibili.com/video/BV1sK4y1w75o/?spm_id_from=333.337.search-card.all.click&vd_source=04c6a0d121b6fb871e3d3c0a2554b29b)的**本地文件**功能可以极大的提升音乐体验([教程](https://www.bilibili.com/video/BV1VL411T7mp/?vd_source=04c6a0d121b6fb871e3d3c0a2554b29b))
> [!NOTE]
>
> 本项目仅为个人使用,无任何商业用途,仅支持 AAC 格式的音乐
---
**内容目录**:
- [环境准备](#环境准备)
- [安装 ⭐⭐⭐](#安装)
- [升级](#升级)
- [卸载](#卸载)
- [使用](#使用)
- [音乐下载 ⭐⭐⭐](#音乐下载)
- [音乐搜索](#音乐搜索)
- [音乐剪辑](#音乐剪辑)
- [提取伴奏](#提取伴奏)
- [csv 批量模板](#csv-批量模板)
- [批量下载 ⭐⭐](#批量下载)
- [音乐破解 ⭐⭐](#音乐破解)
- [License](#license)
# 环境准备
## 安装
```bash
python -m pip install –upgrade pip
pip install -U music-tool-kit
```
![help](https://raw.githubusercontent.com/nichuanfang/music-tool-kit/main/example/help.png)
> [!IMPORTANT]
>
> - [python](https://www.python.org/)版本:**3.11.0及以上**
> - 需安装[ffmpeg](https://ffmpeg.org/)并正确配置环境变量
> - 如果需要下载youtube的音乐,需要准备**科学上网**环境
> - `[]`标记的项目表示可不填
> - 为规避特殊字符导致路径识别失败,**标题**、**路径**、**URL**等相关的参数尽量使用**双引号**`""`
## 升级
```bash
pip install -U music-tool-kit
```
## 卸载
```bash
pip uninstall music-tool-kit
```
# 使用
## 音乐下载
```bash
mk "网址" "[标题]" "[封面url]"
```
**普通下载**
![download](https://raw.githubusercontent.com/nichuanfang/music-tool-kit/main/example/download.png)
**列表下载**使用方法为 `mk "列表url | 列表序号"` ,**url 需要为 [youtube](https://www.youtube.com) 的列表格式(url中含有list=)**,如果想下载全部歌曲,直接输入 `mk "列表url |"` 即可!
例如:
```bash
mk "https://www.youtube.com/playlist?list=PL8B3F8A7B0A9F4DE8 | 1,2,3,4,5"
```
![download_list](https://raw.githubusercontent.com/nichuanfang/music-tool-kit/main/example/batch_download.png)
> [!TIP]
>
> - 标题格式为 **歌曲名-歌手(专辑名)** 输出歌曲格式默认为 **mp3**
> - music-tool-kit会根据**标题**,自动将下载的音频元信息补全,包括歌曲名,歌手(艺术家),内置封面图片,以及专辑名称.如果不遵循该标题格式,元信息可能补全失败
> - 仅支持下载 youtube 的列表下载,url|后面的列表序号之间需要用逗号分隔
## 音乐搜索
```bash
mk -s "关键字"
```
![search](https://raw.githubusercontent.com/nichuanfang/music-tool-kit/main/example/search.png)
支持 youtube bilibili 输出优先级 youtube > bilibili,输入列表序号,输入标题,完成下载
> [!TIP]
>
> - 最多显示20条数据
> - 直接按`Enter`可以跳出序号选择界面,输入的序号不能超过最大返回的条目数
> - 如果不想设置标题 直接按`Enter`即可
## 音乐剪辑
```bash
mk -c "输入的mp3文件" 开始时间 结束时间
```
![clip](https://raw.githubusercontent.com/nichuanfang/music-tool-kit/main/example/clip.png)
> Tips: 时间格式为 `00:00:00`
## 提取伴奏
```bash
mk -e "输入的mp3文件" [模型名称]
```
支持的模型:
- `UVR_MDXNET_Main` (整体较好)
- `UVR-MDX-NET-Inst_Main` (整体较好)
- `UVR-MDX-NET-Inst_3` (整体较好)
- `UVR-MDX-NET-Inst_HQ_3` (整体较好)
- `UVR_MDXNET_KARA_2` (一般,人声剔除不干净,声音忽高忽低)
- `Kim_Inst` (一般)
![extract](https://raw.githubusercontent.com/nichuanfang/music-tool-kit/main/example/inst.png)
> [!WARNING]
> - 默认模型为`UVR_MDXNET_Main`,具体请结合音乐类型和自己的实际听感自行调整模型
> - 伴奏提取比较吃 cpu 性能,时间比较漫长,请耐心等待,大概需要 5~10 分钟
## csv 批量模板
```bash
mk -t
```
生成的模板文件如下:
![csv_template](https://raw.githubusercontent.com/nichuanfang/music-tool-kit/main/example/csv_template.png)
用户自行填写下载信息,保存后使用`mk "csv文件"`即可批量下载
| url | title | cover_url | start_time | end_time | instrumental |
| ---- | ----- | --------- | ---------- | -------- | ------------ |
| 网址 | 标题 | 封面 url | 开始时间 | 结束时间 | 是否生成伴奏(true or false) |
## 批量下载
```bash
mk "csv文件"
```
![csv_download](https://raw.githubusercontent.com/nichuanfang/music-tool-kit/main/example/csv_download.png)
## 音乐破解
```bash
mk -u
```
> [!TIP]
>
> - 暂时只支持网易云音乐
> - 需要在网易云音乐的下载文件夹执行`mk -u`
# License
This work is released under the MIT license. A copy of the license is provided in the [LICENSE](https://raw.githubusercontent.com/nichuanfang/music-tool-kit/main/LICENSE) file.
Raw data
{
"_id": null,
"home_page": "https://github.com/nichuanfang/music-tool-kit",
"name": "music-tool-kit",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.11",
"maintainer_email": null,
"keywords": "mkmtkmusic, musictool, musicdownload, musicclip, musickit, musictoolkit",
"author": "Nichuan Fang",
"author_email": "f18326186224@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/8a/ca/eb8995c3bd23746cb3bd2321a046963f530e6b5b65a1fe1bd4fff7608b04/music-tool-kit-1.3.35.tar.gz",
"platform": "any",
"description": "<!-- MANPAGE: BEGIN EXCLUDED SECTION -->\n<div align=\"center\">\n\n[![music-tool-kit](https://raw.githubusercontent.com/nichuanfang/music-tool-kit/main/.github/banner.svg)](#readme)\n\n[![PyPi](https://img.shields.io/badge/-PyPi-blue.svg?logo=pypi&labelColor=555555&style=for-the-badge)](https://pypi.org/project/music-tool-kit \"music-tool-kit\")\n[![License: Unlicense](https://img.shields.io/badge/-Unlicense-blue.svg?style=for-the-badge)](LICENSE \"License\")\n[![Commits](https://img.shields.io/github/commit-activity/m/nichuanfang/music-tool-kit?label=commits&style=for-the-badge)](https://github.com/nichuanfang/music-tool-kit/commits \"Commit History\")\n\n</div>\n<!-- MANPAGE: END EXCLUDED SECTION -->\n\n**music-tool-kit**\uff0c\u4e3b\u8981\u4f7f\u7528\u573a\u666f\u4e3a\u63d0\u53d6[youtube](https://www.youtube.com)\u548c[bilibili](https://www.bilibili.com)\u89c6\u9891\u4e2d\u7684\u97f3\u9891,\u652f\u6301**\u97f3\u9891\u4e0b\u8f7d**,**\u5143\u4fe1\u606f\u81ea\u52a8\u8865\u5168**,**\u97f3\u9891\u622a\u53d6**,**\u63d0\u53d6\u4f34\u594f**,**youtube \u5217\u8868\u6279\u91cf\u4e0b\u8f7d**,**\u81ea\u5b9a\u4e49\u6279\u91cf\u4e0b\u8f7d**\u7b49.\u914d\u5408[itunes](https://www.bilibili.com/video/BV1sK4y1w75o/?spm_id_from=333.337.search-card.all.click&vd_source=04c6a0d121b6fb871e3d3c0a2554b29b)\u7684**\u672c\u5730\u6587\u4ef6**\u529f\u80fd\u53ef\u4ee5\u6781\u5927\u7684\u63d0\u5347\u97f3\u4e50\u4f53\u9a8c([\u6559\u7a0b](https://www.bilibili.com/video/BV1VL411T7mp/?vd_source=04c6a0d121b6fb871e3d3c0a2554b29b))\n\n> [!NOTE]\n>\n> \u672c\u9879\u76ee\u4ec5\u4e3a\u4e2a\u4eba\u4f7f\u7528,\u65e0\u4efb\u4f55\u5546\u4e1a\u7528\u9014,\u4ec5\u652f\u6301 AAC \u683c\u5f0f\u7684\u97f3\u4e50\n\n---\n**\u5185\u5bb9\u76ee\u5f55**\uff1a\n- [\u73af\u5883\u51c6\u5907](#\u73af\u5883\u51c6\u5907)\n - [\u5b89\u88c5 \u2b50\u2b50\u2b50](#\u5b89\u88c5)\n - [\u5347\u7ea7](#\u5347\u7ea7)\n - [\u5378\u8f7d](#\u5378\u8f7d)\n- [\u4f7f\u7528](#\u4f7f\u7528)\n - [\u97f3\u4e50\u4e0b\u8f7d \u2b50\u2b50\u2b50](#\u97f3\u4e50\u4e0b\u8f7d)\n - [\u97f3\u4e50\u641c\u7d22](#\u97f3\u4e50\u641c\u7d22)\n - [\u97f3\u4e50\u526a\u8f91](#\u97f3\u4e50\u526a\u8f91)\n - [\u63d0\u53d6\u4f34\u594f](#\u63d0\u53d6\u4f34\u594f)\n - [csv \u6279\u91cf\u6a21\u677f](#csv-\u6279\u91cf\u6a21\u677f)\n - [\u6279\u91cf\u4e0b\u8f7d \u2b50\u2b50](#\u6279\u91cf\u4e0b\u8f7d) \n - [\u97f3\u4e50\u7834\u89e3 \u2b50\u2b50](#\u97f3\u4e50\u7834\u89e3)\n- [License](#license)\n\n# \u73af\u5883\u51c6\u5907\n\n## \u5b89\u88c5\n\n```bash\npython -m pip install \u2013upgrade pip\npip install -U music-tool-kit\n```\n\n![help](https://raw.githubusercontent.com/nichuanfang/music-tool-kit/main/example/help.png)\n\n> [!IMPORTANT]\n>\n> - [python](https://www.python.org/)\u7248\u672c:**3.11.0\u53ca\u4ee5\u4e0a**\n> - \u9700\u5b89\u88c5[ffmpeg](https://ffmpeg.org/)\u5e76\u6b63\u786e\u914d\u7f6e\u73af\u5883\u53d8\u91cf\n> - \u5982\u679c\u9700\u8981\u4e0b\u8f7dyoutube\u7684\u97f3\u4e50,\u9700\u8981\u51c6\u5907**\u79d1\u5b66\u4e0a\u7f51**\u73af\u5883\n> - `[]`\u6807\u8bb0\u7684\u9879\u76ee\u8868\u793a\u53ef\u4e0d\u586b\n> - \u4e3a\u89c4\u907f\u7279\u6b8a\u5b57\u7b26\u5bfc\u81f4\u8def\u5f84\u8bc6\u522b\u5931\u8d25,**\u6807\u9898**\u3001**\u8def\u5f84**\u3001**URL**\u7b49\u76f8\u5173\u7684\u53c2\u6570\u5c3d\u91cf\u4f7f\u7528**\u53cc\u5f15\u53f7**`\"\"`\n\n## \u5347\u7ea7\n\n```bash\npip install -U music-tool-kit\n```\n\n## \u5378\u8f7d\n\n```bash\npip uninstall music-tool-kit\n```\n\n# \u4f7f\u7528\n\n## \u97f3\u4e50\u4e0b\u8f7d\n\n```bash\nmk \"\u7f51\u5740\" \"[\u6807\u9898]\" \"[\u5c01\u9762url]\"\n\n```\n\n**\u666e\u901a\u4e0b\u8f7d**\n![download](https://raw.githubusercontent.com/nichuanfang/music-tool-kit/main/example/download.png)\n\n**\u5217\u8868\u4e0b\u8f7d**\u4f7f\u7528\u65b9\u6cd5\u4e3a `mk \"\u5217\u8868url | \u5217\u8868\u5e8f\u53f7\"` ,**url \u9700\u8981\u4e3a [youtube](https://www.youtube.com) \u7684\u5217\u8868\u683c\u5f0f(url\u4e2d\u542b\u6709list=)**,\u5982\u679c\u60f3\u4e0b\u8f7d\u5168\u90e8\u6b4c\u66f2,\u76f4\u63a5\u8f93\u5165 `mk \"\u5217\u8868url |\"` \u5373\u53ef!\n\n\u4f8b\u5982:\n```bash\nmk \"https://www.youtube.com/playlist?list=PL8B3F8A7B0A9F4DE8 | 1,2,3,4,5\"\n```\n![download_list](https://raw.githubusercontent.com/nichuanfang/music-tool-kit/main/example/batch_download.png)\n\n> [!TIP]\n>\n> - \u6807\u9898\u683c\u5f0f\u4e3a **\u6b4c\u66f2\u540d-\u6b4c\u624b(\u4e13\u8f91\u540d)** \u8f93\u51fa\u6b4c\u66f2\u683c\u5f0f\u9ed8\u8ba4\u4e3a **mp3**\n> - music-tool-kit\u4f1a\u6839\u636e**\u6807\u9898**,\u81ea\u52a8\u5c06\u4e0b\u8f7d\u7684\u97f3\u9891\u5143\u4fe1\u606f\u8865\u5168,\u5305\u62ec\u6b4c\u66f2\u540d,\u6b4c\u624b(\u827a\u672f\u5bb6),\u5185\u7f6e\u5c01\u9762\u56fe\u7247,\u4ee5\u53ca\u4e13\u8f91\u540d\u79f0.\u5982\u679c\u4e0d\u9075\u5faa\u8be5\u6807\u9898\u683c\u5f0f,\u5143\u4fe1\u606f\u53ef\u80fd\u8865\u5168\u5931\u8d25\n> - \u4ec5\u652f\u6301\u4e0b\u8f7d youtube \u7684\u5217\u8868\u4e0b\u8f7d,url|\u540e\u9762\u7684\u5217\u8868\u5e8f\u53f7\u4e4b\u95f4\u9700\u8981\u7528\u9017\u53f7\u5206\u9694\n\n## \u97f3\u4e50\u641c\u7d22\n\n```bash\nmk -s \"\u5173\u952e\u5b57\"\n```\n![search](https://raw.githubusercontent.com/nichuanfang/music-tool-kit/main/example/search.png)\n\u652f\u6301 youtube bilibili \u8f93\u51fa\u4f18\u5148\u7ea7 youtube > bilibili,\u8f93\u5165\u5217\u8868\u5e8f\u53f7,\u8f93\u5165\u6807\u9898,\u5b8c\u6210\u4e0b\u8f7d\n\n> [!TIP]\n>\n> - \u6700\u591a\u663e\u793a20\u6761\u6570\u636e\n> - \u76f4\u63a5\u6309`Enter`\u53ef\u4ee5\u8df3\u51fa\u5e8f\u53f7\u9009\u62e9\u754c\u9762,\u8f93\u5165\u7684\u5e8f\u53f7\u4e0d\u80fd\u8d85\u8fc7\u6700\u5927\u8fd4\u56de\u7684\u6761\u76ee\u6570\n> - \u5982\u679c\u4e0d\u60f3\u8bbe\u7f6e\u6807\u9898 \u76f4\u63a5\u6309`Enter`\u5373\u53ef\n\n## \u97f3\u4e50\u526a\u8f91\n\n```bash\nmk -c \"\u8f93\u5165\u7684mp3\u6587\u4ef6\" \u5f00\u59cb\u65f6\u95f4 \u7ed3\u675f\u65f6\u95f4\n```\n\n![clip](https://raw.githubusercontent.com/nichuanfang/music-tool-kit/main/example/clip.png)\n\n> Tips: \u65f6\u95f4\u683c\u5f0f\u4e3a `00:00:00`\n\n## \u63d0\u53d6\u4f34\u594f\n\n```bash\nmk -e \"\u8f93\u5165\u7684mp3\u6587\u4ef6\" [\u6a21\u578b\u540d\u79f0]\n```\n\n\u652f\u6301\u7684\u6a21\u578b:\n\n- `UVR_MDXNET_Main` (\u6574\u4f53\u8f83\u597d)\n- `UVR-MDX-NET-Inst_Main` (\u6574\u4f53\u8f83\u597d)\n- `UVR-MDX-NET-Inst_3` (\u6574\u4f53\u8f83\u597d)\n- `UVR-MDX-NET-Inst_HQ_3` (\u6574\u4f53\u8f83\u597d)\n- `UVR_MDXNET_KARA_2` (\u4e00\u822c,\u4eba\u58f0\u5254\u9664\u4e0d\u5e72\u51c0,\u58f0\u97f3\u5ffd\u9ad8\u5ffd\u4f4e)\n- `Kim_Inst` (\u4e00\u822c)\n\n![extract](https://raw.githubusercontent.com/nichuanfang/music-tool-kit/main/example/inst.png)\n\n> [!WARNING]\n> - \u9ed8\u8ba4\u6a21\u578b\u4e3a`UVR_MDXNET_Main`,\u5177\u4f53\u8bf7\u7ed3\u5408\u97f3\u4e50\u7c7b\u578b\u548c\u81ea\u5df1\u7684\u5b9e\u9645\u542c\u611f\u81ea\u884c\u8c03\u6574\u6a21\u578b\n> - \u4f34\u594f\u63d0\u53d6\u6bd4\u8f83\u5403 cpu \u6027\u80fd,\u65f6\u95f4\u6bd4\u8f83\u6f2b\u957f,\u8bf7\u8010\u5fc3\u7b49\u5f85,\u5927\u6982\u9700\u8981 5~10 \u5206\u949f\n\n## csv \u6279\u91cf\u6a21\u677f\n\n```bash\nmk -t\n```\n\n\u751f\u6210\u7684\u6a21\u677f\u6587\u4ef6\u5982\u4e0b:\n![csv_template](https://raw.githubusercontent.com/nichuanfang/music-tool-kit/main/example/csv_template.png)\n\u7528\u6237\u81ea\u884c\u586b\u5199\u4e0b\u8f7d\u4fe1\u606f,\u4fdd\u5b58\u540e\u4f7f\u7528`mk \"csv\u6587\u4ef6\"`\u5373\u53ef\u6279\u91cf\u4e0b\u8f7d\n\n| url | title | cover_url | start_time | end_time | instrumental |\n| ---- | ----- | --------- | ---------- | -------- | ------------ |\n| \u7f51\u5740 | \u6807\u9898 | \u5c01\u9762 url | \u5f00\u59cb\u65f6\u95f4 | \u7ed3\u675f\u65f6\u95f4 | \u662f\u5426\u751f\u6210\u4f34\u594f(true or false) |\n\n## \u6279\u91cf\u4e0b\u8f7d\n\n```bash\nmk \"csv\u6587\u4ef6\"\n```\n\n![csv_download](https://raw.githubusercontent.com/nichuanfang/music-tool-kit/main/example/csv_download.png)\n\n## \u97f3\u4e50\u7834\u89e3\n\n```bash\nmk -u\n```\n\n> [!TIP]\n>\n> - \u6682\u65f6\u53ea\u652f\u6301\u7f51\u6613\u4e91\u97f3\u4e50\n> - \u9700\u8981\u5728\u7f51\u6613\u4e91\u97f3\u4e50\u7684\u4e0b\u8f7d\u6587\u4ef6\u5939\u6267\u884c`mk -u`\n\n# License\n\nThis work is released under the MIT license. A copy of the license is provided in the [LICENSE](https://raw.githubusercontent.com/nichuanfang/music-tool-kit/main/LICENSE) file.\n\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "A tool kit for music download and clip",
"version": "1.3.35",
"project_urls": {
"Bug Tracker": "https://github.com/nichuanfang/music-tool-kit/issues",
"Documentation": "https://blog.jaychou.site/2023/12/02/music-tool-kit%E5%B7%A5%E5%85%B7/",
"Homepage": "https://github.com/nichuanfang/music-tool-kit",
"Source Code": "https://github.com/nichuanfang/music-tool-kit"
},
"split_keywords": [
"mkmtkmusic",
" musictool",
" musicdownload",
" musicclip",
" musickit",
" musictoolkit"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "a3491c1c9a62709afdecd4f05c024bc1517326fdb78565143d2d088f1480acea",
"md5": "25a261a4158ea2a70d8ea3d1264669cd",
"sha256": "1f6c8160b2c443d034d4d58787790a15f11d4145de714fce2f3e854bd54d3a87"
},
"downloads": -1,
"filename": "music_tool_kit-1.3.35-py3-none-any.whl",
"has_sig": false,
"md5_digest": "25a261a4158ea2a70d8ea3d1264669cd",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.11",
"size": 3474245,
"upload_time": "2024-08-17T12:50:24",
"upload_time_iso_8601": "2024-08-17T12:50:24.189960Z",
"url": "https://files.pythonhosted.org/packages/a3/49/1c1c9a62709afdecd4f05c024bc1517326fdb78565143d2d088f1480acea/music_tool_kit-1.3.35-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "8acaeb8995c3bd23746cb3bd2321a046963f530e6b5b65a1fe1bd4fff7608b04",
"md5": "af441022b00b30e195ac1adc4c948bc4",
"sha256": "6ee13d6b31478267659726eeadeb2e10cb16e383d813f06763ef1bead4780c2b"
},
"downloads": -1,
"filename": "music-tool-kit-1.3.35.tar.gz",
"has_sig": false,
"md5_digest": "af441022b00b30e195ac1adc4c948bc4",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.11",
"size": 3461516,
"upload_time": "2024-08-17T12:50:25",
"upload_time_iso_8601": "2024-08-17T12:50:25.807406Z",
"url": "https://files.pythonhosted.org/packages/8a/ca/eb8995c3bd23746cb3bd2321a046963f530e6b5b65a1fe1bd4fff7608b04/music-tool-kit-1.3.35.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-08-17 12:50:25",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "nichuanfang",
"github_project": "music-tool-kit",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"requirements": [],
"lcname": "music-tool-kit"
}