music 163 lyrics

def lyric(song):
    html = urllib.urlopen('http://s.music.163.com/search/get/?type=1&s=%s&limit=9' % song).read()
    text = json.loads(html)
    name = text['result']['songs'][2]['name']
    id1 = text['result']['songs'][2]['id']
    page = text['result']['songs'][2]['page']

    print name
    print id1
    print page

    url_lyric = urllib.urlopen('http://music.163.com/api/song/lyric?os=pc&id=%s&lv=-1&kv=-1&tv=-1' % id1).read()
    text = json.loads(url_lyric)
    # print text
    print text['lrc']['lyric']
posted @ 2017-04-16 22:09  idlewith  阅读(386)  评论(0编辑  收藏  举报