music change api

This commit is contained in:
SiHuan 2020-03-16 15:42:57 +08:00
parent f8752efc05
commit d398d360a6
3 changed files with 9 additions and 6 deletions

View file

@ -4,4 +4,6 @@ APIURL = 'http://127.0.0.1:5700/'
AUTHORIZATION = '' AUTHORIZATION = ''
PORT = 5580 PORT = 5580

View file

@ -9,6 +9,5 @@ def whenmsg():
ZZRouter(request.get_json()) ZZRouter(request.get_json())
return '' return ''
app.run(host='0.0.0.0', port=PORT) app.run(host='0.0.0.0',debug=True)
if __name__ == '__main__':
app.run()

View file

@ -6,10 +6,12 @@ class Ans(StdAns):
if len(self.parms) < 2: if len(self.parms) < 2:
return '不加参数是坏文明!' return '不加参数是坏文明!'
url = 'http://47.100.45.234/search' url = 'https://api.imjad.cn/cloudmusic/'
params = { params = {
'keywords':self.raw_msg['message'][6:], 'type': 'search',
'search_type': 1,
'limit': 1, 'limit': 1,
's':self.raw_msg['message'][6:],
} }
try: try:
resp = requests.get(url=url,params=params).json() resp = requests.get(url=url,params=params).json()