🚩 Added acgm to moreAPI (#10)

This commit is contained in:
AAA 2020-08-23 23:55:00 +08:00 committed by GitHub
parent b44f5aa811
commit 409e804b9b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 53 additions and 0 deletions

43
acg-multi.py Normal file
View File

@ -0,0 +1,43 @@
from random import randint
from time import sleep
from requests import get
from pagermaid.listener import listener
from os import remove
@listener(is_plugin=True, outgoing=True, command="acgm",
description="多网站随机获取二刺螈bushi ACG图片")
async def joke(context):
await context.edit("获取中 . . .")
status = False
for _ in range (20): #最多重试20次
website = randint(0, 3)
if website == 0:
img = get("http://api.btstu.cn/sjbz/?lx=m_dongman")
elif website == 1:
img = get("https://acg.yanwz.cn/api.php")
elif website == 2:
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")
if img.status_code == 200:
with open(r'tu.png', 'wb') as f:
await context.edit("正在上传图片")
f.write(img.content)
await context.client.send_file(
context.chat_id,
"tu.png",
reply_to=None,
caption=None
)
try:
remove('tu.png')
except:
pass
status = True
break #成功了就赶紧结束啦!
if not status:
await context.edit("出错了呜呜呜 ~ 试了好多好多次都无法访问到 API 服务器 。")
sleep(2)
await context.delete()

View File

@ -229,6 +229,16 @@
"supported": true,
"des-short": "多网站随机获取写真",
"des": "从不同的网站中调取妹子写真但是无漏点放心使用安全版ghs。命令meizi。"
},
{
"name": "acg-multi",
"version": "1.0",
"section": "profile",
"maintainer": "TNTcraftHIM",
"size": "1.4 kb",
"supported": true,
"des-short": "多网站随机获取ACG图",
"des": "从几个不同的图库中随机获取二刺螈bushiACG图片基本都是手机尺寸的图。命令acgm。"
}
]
}