V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
o618
V2EX  ›  问与答

怎么让python的程序支持虾米音乐链接解析播放?

  •  
  •   o618 · Feb 6, 2014 · 3207 views
    This topic created in 4477 days ago, the information mentioned may be changed or developed.
    弄了一晚上还是不行,代码如下:
    content = re.sub(r'http://www.xiami.com/song/(\w+)', r'<embed src="http://xiami.com/widget/0_\1/singlePlayer.swf" type="application/x-shockwave-flash" width="257" height="33" wmode="transparent"></embed>', content)
    return content
    4 replies    1970-01-01 08:00:00 +08:00
    faceair
        1
    faceair  
       Feb 6, 2014
    大哥。。你应该是去抓音乐的api吧,你怎么好像是想让python解析flash
    faceair
        2
    faceair  
       Feb 6, 2014
    <embed src="http://www.xiami.com/widget/55712_1770016497/singlePlayer.swf" type="application/x-shockwave-flash" width="257" height="33" wmode="transparent"/>

    主要参数时是这两个,55712_1770016497,前一个是歌手ID,后一个是歌曲ID。
    liyangjie
        3
    liyangjie  
       Feb 6, 2014
    如果是要获得虾米歌曲的真实地址可以参考:https://github.com/liyangjie/xiami-downloader/blob/master/xiami.py
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   1239 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 45ms · UTC 17:28 · PVG 01:28 · LAX 10:28 · JFK 13:28
    ♥ Do have faith in what you're doing.