diff --git a/README.md b/README.md index 10422da..6d52e3f 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ pip install -U music-tool-kit - 音乐下载 ```bash -mtk 网址 [输出] [封面url] +musictool 网址 [输出] [封面url] ``` > tips: 输出格式为 歌曲名[-歌手] 输出歌曲格式为 mp3 可选, 封面 url 也可选 @@ -19,7 +19,7 @@ mtk 网址 [输出] [封面url] - 音乐剪辑 ```bash -mtk -clip 输入的文件 开始时间 结束时间 +musictool -clip 输入的文件 开始时间 结束时间 ``` > tips: 时间格式为: 00:00:00 @@ -27,5 +27,5 @@ mtk -clip 输入的文件 开始时间 结束时间 - 音乐伴奏提取 ```bash -mtk -extract 输入的文件 输出的文件 +musictool -extract 输入的文件 ``` diff --git a/mtk/__main__.py b/mtk/__main__.py index 6d68f12..5281f0e 100644 --- a/mtk/__main__.py +++ b/mtk/__main__.py @@ -1,3 +1,5 @@ +# !/usr/bin/env python3 + import sys import requests from mtk.mp3_util import MP3 @@ -9,7 +11,7 @@ def extract_info(url): info = ydl.extract_info(url, download=False) return info -def download(url:str,title:str|None=None,cover_url:str|None=None): +def download(url:str,title:str=None,cover_url:str=None): """下载mp3格式的音乐 Args: url (str): 歌曲网址 @@ -78,8 +80,9 @@ def main(args=None): if len(args) == 0: print('configuration:\n\n' '---------------------------------------------\n'+ - '下载: mtk url [title] [cover_url]\n'+ - '剪辑: mtk --clip path start end\n' + '下载: musictool url [title] [cover_url]\n'+ + '剪辑: musictool -clip path start end\n' + '提取伴奏: musictool -extract path\n' '---------------------------------------------\n' ) return diff --git a/mtk/mp3_util.py b/mtk/mp3_util.py index 815e0c5..a6e231a 100644 --- a/mtk/mp3_util.py +++ b/mtk/mp3_util.py @@ -1,4 +1,5 @@ # -*- coding: utf-8 -*- +# !/usr/bin/env python3 import requests import os from mutagen.id3 import ID3, APIC, TIT2, TPE1, TALB diff --git a/requirements.txt b/requirements.txt index 510fcd5..be715e2 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,3 @@ yt-dlp>=2023.10.7 -ffmpeg>=1.4 requests>=2.26.0 mutagen>=1.47.0 \ No newline at end of file diff --git a/setup.py b/setup.py index 92690e3..002db24 100644 --- a/setup.py +++ b/setup.py @@ -8,7 +8,7 @@ setup( name='music-tool-kit', - version='0.0.4', + version='0.0.9', description='A tool kit for music download and clip', long_description_content_type='text/markdown', long_description=readme, @@ -31,12 +31,10 @@ 'mtk': ['*.txt'], }, require_python='>=3.8', - install_requires=[ - 'requests' - ], + install_requires=requirements, entry_points={ 'console_scripts': [ - 'mtk = mtk.__main__:main', + 'musictool = mtk.__main__:main', ] }, classifiers=[