From d398d360a692bc4007828bf45fe2f794b3ffa131 Mon Sep 17 00:00:00 2001 From: SiHuan Date: Mon, 16 Mar 2020 15:42:57 +0800 Subject: [PATCH] music change api --- config.py | 4 +++- main.py | 5 ++--- worker/music.py | 6 ++++-- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/config.py b/config.py index 1301d36..381f5b2 100644 --- a/config.py +++ b/config.py @@ -4,4 +4,6 @@ APIURL = 'http://127.0.0.1:5700/' AUTHORIZATION = '' -PORT = 5580 \ No newline at end of file +PORT = 5580 + + diff --git a/main.py b/main.py index c138b5c..0b7e4b0 100644 --- a/main.py +++ b/main.py @@ -9,6 +9,5 @@ def whenmsg(): ZZRouter(request.get_json()) return '' -app.run(host='0.0.0.0', port=PORT) -if __name__ == '__main__': - app.run() +app.run(host='0.0.0.0',debug=True) + diff --git a/worker/music.py b/worker/music.py index 0d5aacb..59a4fbc 100644 --- a/worker/music.py +++ b/worker/music.py @@ -6,10 +6,12 @@ class Ans(StdAns): if len(self.parms) < 2: return '不加参数是坏文明!' - url = 'http://47.100.45.234/search' + url = 'https://api.imjad.cn/cloudmusic/' params = { - 'keywords':self.raw_msg['message'][6:], + 'type': 'search', + 'search_type': 1, 'limit': 1, + 's':self.raw_msg['message'][6:], } try: resp = requests.get(url=url,params=params).json()