xiami album 3332 UnicodeEncodeError

This commit is contained in:
zuoht 2013-04-16 17:00:45 +08:00
parent 9c464cb75f
commit 30a22e457f

View File

@ -30,7 +30,7 @@ def location_dec(str):
def xiami_download_lyric(lrc_url, file_name, output_dir):
lrc = get_html(lrc_url, faker = True)
if len(lrc) > 0:
with open(output_dir + "/" + file_name.replace('/', '-') + '.lrc', 'w') as x:
with open(output_dir + "/" + file_name.replace('/', '-') + '.lrc', 'w', encoding='utf-8') as x:
x.write(lrc)
def xiami_download_song(sid, output_dir = '.', merge = True, info_only = False):