首页 > 其他 > 详细

输入歌手给出前十首歌

时间:2020-01-11 20:12:00      阅读:83      评论:0      收藏:0      [点我收藏+]
#bs4的使用
import re
import requests
from urllib import error
from bs4 import BeautifulSoup
import os
url = ‘https://c.y.qq.com/soso/fcgi-bin/client_search_cp‘
list_singer  = input("请输入你所需要十大评论的人名:")
headers = {"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:67.0) Gecko/20100101 Firefox/67.0",}
singer = list_singer
params = {
        ‘ct‘: ‘24‘,
        ‘qqmusic_ver‘: ‘1298‘,
        ‘new_json‘: ‘1‘,
        ‘remoteplace‘: ‘txt.yqq.song‘,
        ‘searchid‘: ‘59258368198185505‘,
        ‘t‘: ‘0‘,
        ‘aggr‘: ‘1‘,
        ‘cr‘: ‘1‘,
        ‘catZhida‘: ‘1‘,
        ‘lossless‘: ‘0‘,
        ‘flag_qc‘: ‘0‘,
        ‘p‘: ‘1‘,
        ‘n‘: ‘10‘,
        ‘w‘: ‘‘,
        ‘g_tk‘: ‘5381‘,
        ‘loginUin‘: ‘0‘,
        ‘hostUin‘: ‘0‘,
        ‘format‘: ‘json‘,
        ‘inCharset‘: ‘utf8‘,
        ‘outCharset‘: ‘utf-8‘,
        ‘notice‘: ‘0‘,
        ‘platform‘: ‘yqq.json‘,
        ‘needNewCode‘: ‘0‘
    }
params[‘w‘] = list_singer
res = requests.get(url,params=params,headers = headers)
m_json = res.json()
list_song_name = m_json[‘data‘][‘song‘][‘list‘]
#for song in list_song_name:
    #print(song[‘name‘])


输入歌手给出前十首歌

原文:https://www.cnblogs.com/kyx599/p/12180779.html

踩
(0)
赞
(0)
   
举报
评论 一句话评论(0)
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!