Skip to content

Commit

Permalink
debug
Browse files Browse the repository at this point in the history
  • Loading branch information
Diaoxiaozhang committed Mar 28, 2024
1 parent 97989dc commit f7e3954
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion main.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def analyze_sound(self, sound_id, headers):
try:
not response.json()["trackInfo"]["isAuthorized"]
except KeyError:
print('解析失败,可能达到每日下载上限')
print(colorama.Fore.RED + f'ID为{sound_id}的声音解析失败,可能因为达到每日付费音频下载上限!')
return False
if not response.json()["trackInfo"]["isAuthorized"]:
return 0 # 未购买或未登录vip账号
Expand Down Expand Up @@ -130,6 +130,9 @@ async def async_analyze_sound(self, sound_id, session, headers):
response_json = json.loads(await response.text())
sound_name = response_json["trackInfo"]["title"]
encrypted_url_list = response_json["trackInfo"]["playUrlList"]
except KeyError:
print(colorama.Fore.RED + f'ID为{sound_id}的声音解析失败,可能因为达到每日付费音频下载上限')
return False
except Exception as e:
print(colorama.Fore.RED + f'ID为{sound_id}的声音解析失败!')
logger.debug(f'ID为{sound_id}的声音解析失败!')
Expand Down

0 comments on commit f7e3954

Please sign in to comment.