def searchSinger(key):
url = uapi.search_api
data = {'s': key, 'offset': 0, 'limit': 10, 'type': "100"}
req = requests.post(url, headers=uapi.header, data=data, timeout=10)
if req.json()["result"]['artistCount'] == 0:
pylog.log.warn("??? {} ????????".format(key))
return
artists = req.json()["result"]['artists']
song_table = AsciiTable([["ID", "??", "????", "MV??"]])
for item in artists:
id = str(item['id'])
name = item['name'].encode("utf-8")
acount = str(item['albumSize'])
mcount = str(item['mvSize'])
song_table.table_data.append([id, name, acount, mcount])
print(pylog.Blue("? \"{}\" ?????".format(key)))
print(song_table.table)
评论列表
文章目录