V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
o618
V2EX  ›  问与答

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

  •  
  •   o618 · 2014 年 2 月 6 日 · 3096 次点击
    这是一个创建于 4376 天前的主题,其中的信息可能已经有所发展或是发生改变。
    弄了一晚上还是不行,代码如下:
    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 条回复    1970-01-01 08:00:00 +08:00
    faceair
        1
    faceair  
       2014 年 2 月 6 日
    大哥。。你应该是去抓音乐的api吧,你怎么好像是想让python解析flash
    faceair
        2
    faceair  
       2014 年 2 月 6 日
    <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  
       2014 年 2 月 6 日
    如果是要获得虾米歌曲的真实地址可以参考:https://github.com/liyangjie/xiami-downloader/blob/master/xiami.py
    关于   ·   帮助文档   ·   自助推广系统   ·   博客   ·   API   ·   FAQ   ·   Solana   ·   4432 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 24ms · UTC 01:25 · PVG 09:25 · LAX 17:25 · JFK 20:25
    ♥ Do have faith in what you're doing.