Xiami: do not raise exception if no lyric found

This commit is contained in:
Mort Yao 2013-08-10 16:57:09 +08:00
parent 3a4abe0bc0
commit 11a13bd83a

View File

@ -59,7 +59,10 @@ def xiami_download_song(sid, output_dir = '.', merge = True, info_only = False):
if not info_only:
file_name = "%s - %s - %s" % (song_title, album_name, artist)
download_urls([url], file_name, ext, size, output_dir, merge = merge, faker = True)
xiami_download_lyric(lrc_url, file_name, output_dir)
try:
xiami_download_lyric(lrc_url, file_name, output_dir)
except:
pass
def xiami_download_showcollect(cid, output_dir = '.', merge = True, info_only = False):
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 =
if not info_only:
file_name = "%02d.%s - %s - %s" % (track_nr, song_title, artist, album_name)
download_urls([url], file_name, ext, size, output_dir, merge = merge, faker = True)
xiami_download_lyric(lrc_url, file_name, output_dir)
try:
xiami_download_lyric(lrc_url, file_name, output_dir)
except:
pass
track_nr += 1
@ -111,7 +117,10 @@ def xiami_download_album(aid, output_dir = '.', merge = True, info_only = False)
if not info_only:
file_name = "%02d.%s" % (track_nr, song_title)
download_urls([url], file_name, ext, size, output_dir, merge = merge, faker = True)
xiami_download_lyric(lrc_url, file_name, output_dir)
try:
xiami_download_lyric(lrc_url, file_name, output_dir)
except:
pass
if not pic_exist:
xiami_download_pic(pic_url, 'cover', output_dir)
pic_exist = True