mirror of
https://github.com/BsaLee/up163cloud.git
synced 2026-01-12 08:00:43 +08:00
部分歌曲没有artist信息等,增加异常处理,增强稳健性
This commit is contained in:
parent
ede9a1fd35
commit
43cfe4e85b
6
.gitignore
vendored
Normal file
6
.gitignore
vendored
Normal file
@ -0,0 +1,6 @@
|
||||
__pycache__/
|
||||
.history/
|
||||
neteasecloudmusicapi/
|
||||
cookies.txt
|
||||
failed_ids.txt
|
||||
*.json
|
||||
7
main.py
7
main.py
@ -131,7 +131,14 @@ def process_songs(song_info_list, cookie):
|
||||
# 更新 song_info 添加 artist 和 album 信息
|
||||
song_info['artist'] = song_artist
|
||||
song_info['album'] = song_album
|
||||
try:
|
||||
try_to_upload_song(song_info, cookie)
|
||||
except Exception as e:
|
||||
print(f'上传过程异常,跳过该歌曲:{e}')
|
||||
save_failed_id(song_id)
|
||||
|
||||
def try_to_upload_song(song_info, cookie):
|
||||
song_id = song_info['id']
|
||||
attempts = 0
|
||||
while attempts < 3:
|
||||
result = import_song(song_info, cookie)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user