Skip to content

Commit 11a13bd

Browse files
committed
Xiami: do not raise exception if no lyric found
1 parent 3a4abe0 commit 11a13bd

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

src/you_get/downloader/xiami.py

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,10 @@ def xiami_download_song(sid, output_dir = '.', merge = True, info_only = False):
5959
if not info_only:
6060
file_name = "%s - %s - %s" % (song_title, album_name, artist)
6161
download_urls([url], file_name, ext, size, output_dir, merge = merge, faker = True)
62-
xiami_download_lyric(lrc_url, file_name, output_dir)
62+
try:
63+
xiami_download_lyric(lrc_url, file_name, output_dir)
64+
except:
65+
pass
6366

6467
def xiami_download_showcollect(cid, output_dir = '.', merge = True, info_only = False):
6568
html = get_html('http://www.xiami.com/song/showcollect/id/' + cid, faker = True)
@@ -84,7 +87,10 @@ def xiami_download_showcollect(cid, output_dir = '.', merge = True, info_only =
8487
if not info_only:
8588
file_name = "%02d.%s - %s - %s" % (track_nr, song_title, artist, album_name)
8689
download_urls([url], file_name, ext, size, output_dir, merge = merge, faker = True)
87-
xiami_download_lyric(lrc_url, file_name, output_dir)
90+
try:
91+
xiami_download_lyric(lrc_url, file_name, output_dir)
92+
except:
93+
pass
8894

8995
track_nr += 1
9096

@@ -111,7 +117,10 @@ def xiami_download_album(aid, output_dir = '.', merge = True, info_only = False)
111117
if not info_only:
112118
file_name = "%02d.%s" % (track_nr, song_title)
113119
download_urls([url], file_name, ext, size, output_dir, merge = merge, faker = True)
114-
xiami_download_lyric(lrc_url, file_name, output_dir)
120+
try:
121+
xiami_download_lyric(lrc_url, file_name, output_dir)
122+
except:
123+
pass
115124
if not pic_exist:
116125
xiami_download_pic(pic_url, 'cover', output_dir)
117126
pic_exist = True

0 commit comments

Comments
 (0)