def baidu_download_song(sid, output_dir='.', merge=True, info_only=False):
    data = baidu_get_song_data(sid)
    if (data is not None):
        url = baidu_get_song_url(data)
        title = baidu_get_song_title(data)
        artist = baidu_get_song_artist(data)
        album = baidu_get_song_album(data)
        lrc = baidu_get_song_lyric(data)
        file_name = ('%s - %s - %s' % (title, album, artist))
    else:
        html = get_html(('http://music.baidu.com/song/%s' % sid))
        url = r1('data_url="([^"]+)"', html)
        title = r1('data_name="([^"]+)"', html)
        file_name = title
    (type, ext, size) = url_info(url, faker=True)
    print_info(site_info, title, type, size)
    if (not info_only):
        download_urls([url], file_name, ext, size, output_dir, merge=merge, faker=True)
    try:
        (type, ext, size) = url_info(lrc, faker=True)
        print_info(site_info, title, type, size)
        if (not info_only):
            download_urls([lrc], file_name, ext, size, output_dir, faker=True)
    except:
        pass
def baidu_download_song(sid, output_dir='.', merge=True, info_only=False):
    data = baidu_get_song_data(sid)
    if (data is not None):
        url = baidu_get_song_url(data)
        title = baidu_get_song_title(data)
        artist = baidu_get_song_artist(data)
        album = baidu_get_song_album(data)
        lrc = baidu_get_song_lyric(data)
        file_name = ('%s - %s - %s' % (title, album, artist))
    else:
        html = get_html(('http://music.baidu.com/song/%s' % sid))
        url = r1('data_url="([^"]+)"', html)
        title = r1('data_name="([^"]+)"', html)
        file_name = title
    (type, ext, size) = url_info(url, faker=True)
    print_info(site_info, title, type, size)
    if (not info_only):
        download_urls([url], file_name, ext, size, output_dir, merge=merge, faker=True)
    try:
        (type, ext, size) = url_info(lrc, faker=True)
        print_info(site_info, title, type, size)
        if (not info_only):
            download_urls([lrc], file_name, ext, size, output_dir, faker=True)
    except:
        pass