Xiami: fix default MIME type (audio/mpeg)

This commit is contained in:
Mort Yao 2013-07-23 09:41:41 +08:00
parent 2159e9f11c
commit ade1252a06
2 changed files with 4 additions and 3 deletions

1
.gitignore vendored
View File

@ -11,6 +11,7 @@ _*/
*.3gp *.3gp
*.asf *.asf
*.flv *.flv
*.lrc
*.mkv *.mkv
*.mp3 *.mp3
*.mp4 *.mp4

View File

@ -52,10 +52,10 @@ def xiami_download_song(sid, output_dir = '.', merge = True, info_only = False):
url = location_dec(i.getElementsByTagName("location")[0].firstChild.nodeValue) url = location_dec(i.getElementsByTagName("location")[0].firstChild.nodeValue)
lrc_url = i.getElementsByTagName("lyric")[0].firstChild.nodeValue lrc_url = i.getElementsByTagName("lyric")[0].firstChild.nodeValue
type, ext, size = url_info(url, faker = True) type, ext, size = url_info(url, faker = True)
if not type: if not ext:
type = 'mp3' ext = 'mp3'
print_info(site_info, song_title, type, size) print_info(site_info, song_title, ext, size)
if not info_only: if not info_only:
file_name = "%s - %s - %s" % (song_title, album_name, artist) file_name = "%s - %s - %s" % (song_title, album_name, artist)
download_urls([url], file_name, ext, size, output_dir, merge = merge, faker = True) download_urls([url], file_name, ext, size, output_dir, merge = merge, faker = True)