Skip to content

Commit

Permalink
fix: QQ Music download bug
Browse files Browse the repository at this point in the history
  • Loading branch information
Beadd committed Jun 4, 2023
1 parent 889b259 commit 89eaa65
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions musicdownloader.py
Original file line number Diff line number Diff line change
Expand Up @@ -216,9 +216,9 @@ def json_download_music(data, headers, proxies):
return "exist"
music_req = requests.get(music_url, headers=headers, proxies=proxies,
timeout=10)
if music_req.content is None:
print(colored("下载失败,自动跳过", "yellow"))
return
if music_req.content is None or music_req.content is b'':
print(colored("下载失败,自动跳过,可能是vip歌曲", "yellow"))
return "exit"
with open(music_path, "wb") as code:
code.write(music_req.content)
if not os.path.getsize(music_path):
Expand Down Expand Up @@ -567,6 +567,8 @@ def mode_music(api_path, headers, proxies, header163, show_github = True):
continue
if music_path == "getsize":
continue
if music_path == "exit":
continue
if g_eyed3_exist:
json_add_eyed3(data, music_path, headers, proxies, header163)
if set_download_lyric:
Expand Down

0 comments on commit 89eaa65

Please sign in to comment.