|
|
@ -0,0 +1,67 @@
|
|
|
|
|
|
|
|
import json
|
|
|
|
|
|
|
|
import requests
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
headers ={
|
|
|
|
|
|
|
|
"User-agent": "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4606.71 Safari/537.36 Core/1.94.169.400 QQBrowser/11.0.5130.400",
|
|
|
|
|
|
|
|
"Cookie": "kg_mid=14e57fa8f8bd5163efe72e9847a80e64; kg_dfid=0jICDR1Z9i6c3Xwh3n02F2uD; Hm_lvt_aedee6983d4cfc62f509129360d6bb3d=1668051000,1668243927; kg_dfid_collect=d41d8cd98f00b204e9800998ecf8427e; kg_mid_temp=14e57fa8f8bd5163efe72e9847a80e64; Hm_lpvt_aedee6983d4cfc62f509129360d6bb3d=1668245258",
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
list_url ='https://complexsearch.kugou.com/v2/search/song?callback=callback123&srcappid=2919&clientver=1000&clienttime=1668257140471&mid=14e57fa8f8bd5163efe72e9847a80e64&uuid=14e57fa8f8bd5163efe72e9847a80e64&dfid=0jICDR1Z9i6c3Xwh3n02F2uD&keyword=%E5%8F%AA%E5%9B%A0%E4%BD%A0%E5%A4%AA%E7%BE%8E&page=1&pagesize=30&bitrate=0&isfuzzy=0&inputtype=0&platform=WebFilter&userid=0&iscorrection=1&privilege_filter=0&filter=10&token=&appid=1014&signature=5d256cf87e57f93badbdceaad2e1eb33'
|
|
|
|
|
|
|
|
req_list = requests.get(url=list_url,headers=headers)
|
|
|
|
|
|
|
|
char='{'
|
|
|
|
|
|
|
|
n =req_list.text.find(char)
|
|
|
|
|
|
|
|
list_json = json.loads(req_list.text[n:-2])
|
|
|
|
|
|
|
|
url ='https://wwwapi.kugou.com/yy/index.php?r=play/getdata&hash='
|
|
|
|
|
|
|
|
for i in list_json['data']['lists']:
|
|
|
|
|
|
|
|
url1 = url +i.get('FileHash')+"&album_id="+str(i.get('AlbumID'))
|
|
|
|
|
|
|
|
req = requests.get(url=url1,headers=headers)
|
|
|
|
|
|
|
|
req_json = json.loads(req.text)
|
|
|
|
|
|
|
|
song_url = req_json['data'].get('play_url')
|
|
|
|
|
|
|
|
print(song_url)
|
|
|
|
|
|
|
|
req1 = requests.get(url=song_url)
|
|
|
|
|
|
|
|
with open(f'{req_json["data"].get("audio_name")}.mp3','wb') as f:
|
|
|
|
|
|
|
|
f.write(req1.content)
|
|
|
|
|
|
|
|
f.close()
|
|
|
|
|
|
|
|
req1.close()
|
|
|
|
|
|
|
|
req.close()
|
|
|
|
|
|
|
|
req_list.close()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# url1 = url +list_json['data']['lists'][0].get('FileHash')+"&album_id="+str(list_json['data']['lists'][0].get('AlbumID'))
|
|
|
|
|
|
|
|
# req = requests.get(url=url1,headers=headers)
|
|
|
|
|
|
|
|
# req_json = json.loads(req.text)
|
|
|
|
|
|
|
|
# song_url = req_json['data'].get('play_url')
|
|
|
|
|
|
|
|
# req1 = requests.get(url=song_url)
|
|
|
|
|
|
|
|
# with open(f'{req_json["data"].get("audio_name")}.mp3','wb') as f:
|
|
|
|
|
|
|
|
# f.write(req1.content)
|
|
|
|
|
|
|
|
#https://wwwapi.kugou.com/yy/index.php?r=play/getdata&callback=jQuery19107826705776976817_1668256148578&hash=D80A9FB3362FB91C2D06D70E321F4BC5&dfid=0jICDR1Z9i6c3Xwh3n02F2uD&appid=1014&mid=14e57fa8f8bd5163efe72e9847a80e64&platid=4&album_id=1944022&_=1668256148598
|
|
|
|
|
|
|
|
#https://www.kugou.com/mixsong/vjjt936.html?fromsearch=只因你太美#hash=D80A9FB3362FB91C2D06D70E321F4BC5&album_id=1944022&album_audio_id=52980237
|
|
|
|
|
|
|
|
#https://wwwapi.kugou.com/yy/index.php?r=play/getdata&callback=jQuery191038106222049194827_1668261761236&hash=D80A9FB3362FB91C2D06D70E321F4BC5&dfid=0jICDR1Z9i6c3Xwh3n02F2uD&appid=1014&mid=14e57fa8f8bd5163efe72e9847a80e64&platid=4&album_id=1944022&_=1668261761246
|
|
|
|
|
|
|
|
# url = 'https://wwwapi.kugou.com/yy/index.php?r=play/getdata&hash='
|
|
|
|
|
|
|
|
# for i in songlist:
|
|
|
|
|
|
|
|
# print(url+i.get("FileHash"))
|
|
|
|
|
|
|
|
# req = requests.get(url=url)
|
|
|
|
|
|
|
|
# with open(f'{i.get("SongName")}.mp3','wb') as f:
|
|
|
|
|
|
|
|
# # # f.write(req.content)
|
|
|
|
|
|
|
|
# url='https://voice.baidu.com/api/newpneumonia?from=page&callback=jsonp_1668237727742_73497'
|
|
|
|
|
|
|
|
# headers = {
|
|
|
|
|
|
|
|
# 'user-agent':'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4606.71 Safari/537.36 Core/1.94.169.400 QQBrowser/11.0.5130.400'
|
|
|
|
|
|
|
|
# }
|
|
|
|
|
|
|
|
# req = requests.get(url=url,headers=headers)
|
|
|
|
|
|
|
|
# reqjson = json.loads(req.text[26:-2])
|
|
|
|
|
|
|
|
# with open('疫情.csv','w',encoding='UTF-8') as f:
|
|
|
|
|
|
|
|
# f.write(f'{"省市地区"}, {"新增确诊"}, {"新增无症状"}, {"累计确诊"}, {"风险地区"}\n')
|
|
|
|
|
|
|
|
# # for i in reqjson['data']['resumes']['chinaProvince']:
|
|
|
|
|
|
|
|
# # for j in reqjson['data']['resumes']['chinaProvince'][f'{i}']['list']:
|
|
|
|
|
|
|
|
# # f.write(f'{j.get("area")},{j.get("asymptomaticLocalRelative")},{j.get("asymptomaticRelative")},{j.get("confirmed")}\n')
|
|
|
|
|
|
|
|
# for i in reqjson['data']['resumes']['china']['list']:
|
|
|
|
|
|
|
|
# f.write(f'{i.get("province")},{i.get("nativeRelative")},{i.get("asymptomaticLocalRelative")},{i.get("confirmed")},{i.get("asymptomaticRelative")}\n')
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# #导入csv文件模块:
|
|
|
|
|
|
|
|
# import csv # 该模块为内置模块不用安装!
|
|
|
|
|
|
|
|
# list3 = [["姓名","爱好","年龄","性别"],["特斯拉",'喜欢核辐射','未知','雄性'],["迪迦",'打怪兽','未知','雄性'] ]
|
|
|
|
|
|
|
|
#
|
|
|
|
|
|
|
|
# for i in list3:
|
|
|
|
|
|
|
|
# print(i)
|
|
|
|
|
|
|
|
# fp =open('adi.csv',mode='a+',newline='') # ps:此处记得用“a+” 不然首行会变成空行!
|
|
|
|
|
|
|
|
# dp = csv.writer(fp)
|
|
|
|
|
|
|
|
# dp.writerow(i)
|
|
|
|
|
|
|
|
# fp.close()
|