zoukankan      html  css  js  c++  java
  • 喜玛拉雅——徐薇翻唱合集

    import requests
    import json
    import re

    # 获取URL网址
    start_url = 'https://www.ximalaya.com/revision/play/album?albumId=243032&pageNum={}&sort=-1&pageSize=30'
    page=1
    for page in range(1,3):
    url=start_url.format(page)
    headers={'User-Agent':'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:65.0) Gecko/20100101 Firefox/65.0'}
    json_str=requests.get(url,headers=headers).text
    # print(json_str)
    re_url='src":(.*?),"hasBuy"'
    re_title = '"trackName":(.*?),"trackUrl"'
    music_title=re.findall(re_title,json_str)
    music_url=re.findall(re_url,json_str)

    for xima_title,xima_music in zip(music_title,music_url):
    title = xima_title
    music_wz=xima_music
    remove_str_title= json.loads(title)
    remove_str_url = json.loads(music_wz)
    print(remove_str_title)
    print(remove_str_url)
    print(type(remove_str_title))
    print(type(remove_str_url))




    music=requests.get(remove_str_url,headers=headers)

    with open('徐薇/{}.mp3'.format(remove_str_title),'wb') as f:
    f.write(music.content)
    print('正在下载{}'.format(remove_str_title))






  • 相关阅读:
    第07组 Beta冲刺(1/5)
    软工实践个人总结
    SDN大作业
    第08组 Beta版本演示
    2019 SDN上机第7次作业
    第08组 Beta冲刺(5/5)
    第08组 Beta冲刺(4/5)
    第08组 Beta冲刺(3/5)
    第08组 Beta冲刺(2/5)
    2019 SDN上机第6次作业
  • 原文地址:https://www.cnblogs.com/LQ970811/p/10518920.html
Copyright © 2011-2022 走看看