Skip to content

Commit

Permalink
robustness: skip unavailable tracks in Xiami showcollect downloading
Browse files Browse the repository at this point in the history
  • Loading branch information
Eskibear committed Mar 10, 2015
1 parent b61e995 commit e384e45
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions src/you_get/extractors/xiami.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,16 @@ def xiami_download_showcollect(cid, output_dir = '.', merge = True, info_only =
tracks = doc.getElementsByTagName("track")
track_nr = 1
for i in tracks:
artist = i.getElementsByTagName("artist")[0].firstChild.nodeValue
album_name = i.getElementsByTagName("album_name")[0].firstChild.nodeValue
song_title = i.getElementsByTagName("title")[0].firstChild.nodeValue
url = location_dec(i.getElementsByTagName("location")[0].firstChild.nodeValue)
artist=album_name=song_title=url=""
try:
song_id = i.getElementsByTagName("song_id")[0].firstChild.nodeValue
artist = i.getElementsByTagName("artist")[0].firstChild.nodeValue
album_name = i.getElementsByTagName("album_name")[0].firstChild.nodeValue
song_title = i.getElementsByTagName("title")[0].firstChild.nodeValue
url = location_dec(i.getElementsByTagName("location")[0].firstChild.nodeValue)
except:
log.e("Song %s failed. [Info Missing] artist:%s, album:%s, title:%s, url:%s" % (song_id, artist, album_name, song_title, url))
continue
try:
lrc_url = i.getElementsByTagName("lyric")[0].firstChild.nodeValue
except:
Expand Down

0 comments on commit e384e45

Please sign in to comment.