2020-07-14 17:04:09 +08:00
|
|
|
from zzcore import StdAns, mysakuya
|
2020-03-16 16:47:54 +08:00
|
|
|
import requests
|
|
|
|
|
2020-03-17 14:20:21 +08:00
|
|
|
from config import LOLIKEY
|
|
|
|
|
2020-03-16 16:47:54 +08:00
|
|
|
class Ans(StdAns):
|
2020-07-12 22:41:00 +08:00
|
|
|
AllowGroup = [973510746, 805197917,343700338,125733077,1084566280,920863253,798595664,655057127,196268763, 204097403, 247022495, 474907856]
|
2020-03-16 16:47:54 +08:00
|
|
|
def GETMSG(self):
|
|
|
|
url = 'https://api.lolicon.app/setu/'
|
|
|
|
params = {
|
2020-03-17 14:20:21 +08:00
|
|
|
'apikey': LOLIKEY,
|
2020-03-16 16:47:54 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
if len(self.parms) < 2:
|
|
|
|
try:
|
|
|
|
resp = requests.get(url=url,params=params).json()
|
|
|
|
picurl = resp['data'][0]['url']
|
|
|
|
msg = picurl
|
|
|
|
except Exception as e:
|
|
|
|
print(e)
|
|
|
|
msg = '什么东西坏掉了,大概是Pixiv吧...不可能是咱!'
|
|
|
|
return msg
|
|
|
|
|
|
|
|
else:
|
2020-08-02 23:44:45 +08:00
|
|
|
keyword = self.parms[1]
|
2020-07-14 17:04:09 +08:00
|
|
|
if mysakuya(self, keyword) == False:
|
|
|
|
return "不许你们看咲夜的涩图!!"
|
|
|
|
|
2020-03-16 16:47:54 +08:00
|
|
|
params['keyword'] = keyword
|
|
|
|
try:
|
|
|
|
resp = requests.get(url=url,params=params).json()
|
|
|
|
picurl = resp['data'][0]['url']
|
2020-07-11 22:43:42 +08:00
|
|
|
msg = '[CQ:at,qq=' + str(self.uid) + ']' + '咱帮你🔍 ' + keyword + ' 找到了这个\n' + picurl
|
2020-08-02 23:44:45 +08:00
|
|
|
|
|
|
|
if len(self.parms) > 2 and self.parms[2] == 'p' :
|
|
|
|
msg = '[CQ:image,file=' + picurl + ']'
|
2020-07-11 22:43:42 +08:00
|
|
|
# .replace('https://i.pixiv.cat', 'https://pximg.sihuan.workers.dev')
|
2020-05-10 13:13:15 +08:00
|
|
|
# msg = picurl.replace('https://i.pixiv.cat', 'https://original.img.cheerfun.dev')
|
2020-03-16 16:47:54 +08:00
|
|
|
except Exception as e:
|
|
|
|
print(e)
|
2020-07-11 22:43:42 +08:00
|
|
|
msg = '[CQ:at,qq=' + str(self.uid) + ']咱没查到 ' + keyword + ' 也有可能是Pixiv坏掉了'
|
2020-06-25 19:15:16 +08:00
|
|
|
return msg
|