From d3184ebb775a454ef183fe2da17e78bcc0fd11a5 Mon Sep 17 00:00:00 2001 From: SiHuan Date: Fri, 21 Aug 2020 11:20:27 +0800 Subject: [PATCH 1/2] bing use mkt zh-CN --- worker/bing.py | 1 + 1 file changed, 1 insertion(+) diff --git a/worker/bing.py b/worker/bing.py index f291aeb..0626aed 100644 --- a/worker/bing.py +++ b/worker/bing.py @@ -12,6 +12,7 @@ class Ans(StdAns): params = { 'q':self.raw_msg['message'][5:], 'count': 1, + 'mkt': 'zh-CN' } headers = { 'Ocp-Apim-Subscription-Key': BINGKEY, From 5c890fbe3fd9ac25716775a5d1ab5048b77b0126 Mon Sep 17 00:00:00 2001 From: Kontor Date: Fri, 21 Aug 2020 11:26:21 +0800 Subject: [PATCH 2/2] QQMusic Mod (Experimental) --- worker/qymusic.py | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 worker/qymusic.py diff --git a/worker/qymusic.py b/worker/qymusic.py new file mode 100644 index 0000000..57ffcea --- /dev/null +++ b/worker/qymusic.py @@ -0,0 +1,36 @@ +from zzcore import StdAns +import requests + +class Ans(StdAns): + def GETMSG(self): + if len(self.parms) < 2: + return '歌名都不指定就能搜到歌了?' + url = 'https://c.y.qq.com/soso/fcgi-bin/client_search_cp' + params = { + 'ct': 24, + 'qqmusic_ver': 1298, + 'new_json': 1, + 'remoteplace': 'txt.yqq.song', + 'searchid': '', + 't': 0, + 'aggr': 1, + 'cr': 1, + 'catZhida': 1, + 'loseless': 0, + 'flag_qc': 0, + 'p': 1, + 'n': 20, + 'w':self.raw_msg['message'][8:], + } + try: + resp = requests.get(url=url,params=params) + resp = re.match("callback%((.+)%)", resp).json() + if resp['data']['song']['totalnum'] == 0: + return '辣鸡曲库没这首,或者你的关键词有问题' + mid = resp['data']['song']['list'][0]['mid'] + mname = resp['data']['song']['list'][0]['name'] + msg = '[CQ:share,url=https://y.qq.com/n/yqq/song/' + str(mid) + '.html,title=' + str(mname) + ']' + except Exception as e: + print(e) + msg = '辣鸡q音,太弟弟了(' + return msg