commit
849e44734d
1 changed files with 34 additions and 32 deletions
|
@ -1,5 +1,6 @@
|
||||||
from zzcore import StdAns
|
from zzcore import StdAns
|
||||||
import requests
|
import requests
|
||||||
|
import json
|
||||||
|
|
||||||
class Ans(StdAns):
|
class Ans(StdAns):
|
||||||
def GETMSG(self):
|
def GETMSG(self):
|
||||||
|
@ -23,8 +24,9 @@ class Ans(StdAns):
|
||||||
'w':self.raw_msg['message'][8:],
|
'w':self.raw_msg['message'][8:],
|
||||||
}
|
}
|
||||||
try:
|
try:
|
||||||
resp = requests.get(url=url,params=params)
|
resp = requests.get(url=url,params=params).text
|
||||||
resp = re.match("callback%((.+)%)", resp).json()
|
resp = json.loads(list(resp.split('callback('))[1][:-1])
|
||||||
|
# print(resp)
|
||||||
if resp['data']['song']['totalnum'] == 0:
|
if resp['data']['song']['totalnum'] == 0:
|
||||||
return '辣鸡曲库没这首,或者你的关键词有问题'
|
return '辣鸡曲库没这首,或者你的关键词有问题'
|
||||||
mid = resp['data']['song']['list'][0]['mid']
|
mid = resp['data']['song']['list'][0]['mid']
|
||||||
|
|
Loading…
Reference in a new issue