From caea11342cbaa5a3a18ae60d831642282f1e7fe2 Mon Sep 17 00:00:00 2001 From: AAA <35992542+TNTcraftHIM@users.noreply.github.com> Date: Mon, 24 Aug 2020 13:10:24 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=9A=A9=20acg=20cosplay=20meizi=20-=20?= =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=9B=BE=E6=BA=90=E4=B8=8EAPI=20(#14)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- acg-multi.py | 21 ++++++++++++++++++++- cosplay-multi.py | 6 +++++- list.json | 14 +++++++------- meizi.py | 22 +++++++++++++++++----- 4 files changed, 49 insertions(+), 14 deletions(-) diff --git a/acg-multi.py b/acg-multi.py index 4f0f77e..ad54220 100644 --- a/acg-multi.py +++ b/acg-multi.py @@ -1,3 +1,4 @@ +import json from random import randint from time import sleep from requests import get @@ -11,7 +12,7 @@ async def joke(context): await context.edit("获取中 . . .") status = False for _ in range (20): #最多重试20次 - website = randint(0, 3) + website = randint(0, 9) if website == 0: img = get("http://api.btstu.cn/sjbz/?lx=m_dongman") elif website == 1: @@ -20,7 +21,25 @@ async def joke(context): img = get("https://img.xjh.me/random_img.php?type=bg&ctype=acg&return=302&device=mobile") elif website == 3: img = get("https://www.yunboys.cn/sjbz/api.php?method=mobile&lx=dongman") + elif website == 4: + img = get("http://www.dmoe.cc/random.php") + elif website == 5: + img = get("https://api.vvhan.com/api/acgimg") + elif website == 6: + img = get("http://api.mtyqx.cn/api/random.php") + elif website == 7: + img = get("http://random.firefliestudio.com/") + elif website == 8: + img = get("https://api.mmcee.cn/acgimg/acgurl.php") + elif website == 9: + img = get('https://api.lolicon.app/setu/?r18=0') if img.status_code == 200: + if website == 9: + tmp = json.loads(img.content) + img = tmp['data'][0]['url'] + img = get(img) + if img.status_code != 200: + continue #如果返回不正常就赶紧下一回 with open(r'tu.png', 'wb') as f: await context.edit("正在上传图片") f.write(img.content) diff --git a/cosplay-multi.py b/cosplay-multi.py index 7adb63e..6ff4628 100644 --- a/cosplay-multi.py +++ b/cosplay-multi.py @@ -11,7 +11,7 @@ async def joke(context): await context.edit("获取中 . . .") status = False for _ in range (20): #最多重试20次 - website = randint(0, 4) + website = randint(0, 6) if website == 0: img = get("https://api.helloworld.la/xiezhen_cosplay.php") elif website == 1: @@ -22,6 +22,10 @@ async def joke(context): img = get("http://api.rosysun.cn/cos") elif website == 4: img = get("https://uploadbeta.com/api/pictures/random/?key=%E5%8A%A8%E6%BC%AB") + elif website == 5: + img = get("https://uploadbeta.com/api/pictures/random/?key=%E4%BA%8C%E6%AC%A1%E5%85%83") + elif website == 6: + img = get("https://xn--wcs142h.herokuapp.com/") if img.status_code == 200: if website == 3: img = get(img.content) diff --git a/list.json b/list.json index d96802b..9da1fa8 100644 --- a/list.json +++ b/list.json @@ -152,7 +152,7 @@ }, { "name": "portball", - "version": "1.21", + "version": "1.2", "section": "chat", "maintainer": "Pentacene", "size": "3.6 kb", @@ -212,30 +212,30 @@ }, { "name": "cosplay-multi", - "version": "1.0", + "version": "1.1", "section": "profile", "maintainer": "TNTcraftHIM", - "size": "1.8 kb", + "size": "2.0 kb", "supported": true, "des-short": "多网站随机获取Cos图", "des": "在不同的几个网站中随机获取Cosplay图片,解决了cosplay单个API流量用尽后无法获取的问题。命令:cosm。" }, { "name": "meizi", - "version": "1.0", + "version": "1.1", "section": "profile", "maintainer": "TNTcraftHIM", - "size": "2.0 kb", + "size": "2.6 kb", "supported": true, "des-short": "多网站随机获取写真", "des": "从不同的网站中调取妹子写真,但是无漏点,放心使用(安全版ghs)。命令:meizi。" }, { "name": "acg-multi", - "version": "1.0", + "version": "1.1", "section": "profile", "maintainer": "TNTcraftHIM", - "size": "1.4 kb", + "size": "2.4 kb", "supported": true, "des-short": "多网站随机获取ACG图", "des": "从几个不同的图库中随机获取二刺螈(bushi)ACG图片,基本都是手机尺寸的图。命令:acgm。" diff --git a/meizi.py b/meizi.py index 01aede4..06dd5b8 100644 --- a/meizi.py +++ b/meizi.py @@ -7,19 +7,19 @@ from os import remove @listener(is_plugin=True, outgoing=True, command="meizi", description="多网站随机获取性感(可能)的写真") -async def joke(context): +async def meizi(context): await context.edit("获取中 . . .") status = False for _ in range (20): #最多重试20次 - website = randint(0, 7) + website = randint(0, 13) if website == 0: img = get("https://mm.52.mk") elif website == 1: img = get("https://api.helloworld.la/xiezhen_xinggan.php") elif website == 2: - img = get("https://api.helloworld.la/bizhi_meizi.php") + img = get("https://api.qicaiyun.top/sjbz/api.php?lx=meizi") elif website == 3: - img = get("https://uploadbeta.com/api/pictures/random/?key=%E5%A4%A7%E5%B0%BA%E5%BA%A6") + img = get("http://api.btstu.cn/sjbz/?lx=meizi") elif website == 4: img = get("https://cdn.seovx.com/?mom=302") elif website == 5: @@ -27,7 +27,19 @@ async def joke(context): elif website == 6: img = get("https://uploadbeta.com/api/pictures/random/?key=%E6%8E%A8%E5%A5%B3%E9%83%8E") elif website == 7: - img = get("https://uploadbeta.com/api/pictures/random/?key=%E5%A5%B3%E7%A5%9E") + img = get("https://uploadbeta.com/api/pictures/random/?key=%E7%BE%8E%E5%A5%B3") + elif website == 8: + img = get("https://api.941ka.cn/api/mnxz") + elif website == 9: + img = get("https://api.lyiqk.cn/sexylady") + elif website == 10: + img = get("https://api.pingping6.com/tools/acg3/index.php") + elif website == 11: + img = get("https://api.pingping6.com/tools/acg3") + elif website == 12: + img = get("https://api.diskgirl.com/image/api.php?t=&v=0.9451485087333713") + elif website == 13: + img = get("https://api.diskgirl.com/image/api.php?t=&v=" + str(random.uniform(0, 100))) if img.status_code == 200: with open(r'tu.png', 'wb') as f: await context.edit("正在上传图片")