Skip to content

Commit

Permalink
✨ feat: 剪切音乐
Browse files Browse the repository at this point in the history
  • Loading branch information
nichuanfang committed Oct 10, 2023
1 parent b86fc3c commit 8673f1d
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions mk/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ def clip(path:str,start:str,end:str):
if img_data!=None:
# 添加封面
mp3 = MP3(path)
mp3.add_cover(img_data)
mp3.add_bytes_cover(img_data)
mp3.save()
print('剪辑完成!')

Expand Down Expand Up @@ -161,7 +161,7 @@ def main(args=None):
# title = info['title']


# download('https://youtu.be/xsk1SLmf9a0?si=zj8z06UGwLAKEMOj','Handbook - See The World','https://i2.cdn.turner.com/cnn/2008/WORLD/asiapcf/09/03/ta.jaychou/art.jaychou.jpg')
# download('https://www.bilibili.com/video/BV1yt41177RB?t=253.7')
# clip('青花瓷-周杰伦.mp3','00:00:00','00:00:30')
pass

Expand Down
2 changes: 1 addition & 1 deletion mk/mp3_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def add_cover(self,cover_url):
print(f'封面{cover_url}添加完成')

# 给mp3文件添加封面
def add_cover(self,image_data:bytes):
def add_bytes_cover(self,image_data:bytes):
# 插入封面
self.songFile['APIC'] = APIC(
encoding=0,
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

setup(
name='music-tool-kit',
version='0.1.4',
version='0.1.5',
description='A tool kit for music download and clip',
long_description_content_type='text/markdown',
long_description=readme,
Expand Down

0 comments on commit 8673f1d

Please sign in to comment.