mirror of
https://github.com/TeamPGM/PagerMaid_Plugins.git
synced 2024-11-22 07:47:39 +00:00
🚩 Added acgm to moreAPI (#10)
This commit is contained in:
parent
b44f5aa811
commit
409e804b9b
43
acg-multi.py
Normal file
43
acg-multi.py
Normal 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()
|
10
list.json
10
list.json
@ -229,6 +229,16 @@
|
|||||||
"supported": true,
|
"supported": true,
|
||||||
"des-short": "多网站随机获取写真",
|
"des-short": "多网站随机获取写真",
|
||||||
"des": "从不同的网站中调取妹子写真,但是无漏点,放心使用(安全版ghs)。命令:meizi。"
|
"des": "从不同的网站中调取妹子写真,但是无漏点,放心使用(安全版ghs)。命令:meizi。"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "acg-multi",
|
||||||
|
"version": "1.0",
|
||||||
|
"section": "profile",
|
||||||
|
"maintainer": "TNTcraftHIM",
|
||||||
|
"size": "1.4 kb",
|
||||||
|
"supported": true,
|
||||||
|
"des-short": "多网站随机获取ACG图",
|
||||||
|
"des": "从几个不同的图库中随机获取二刺螈(bushi)ACG图片,基本都是手机尺寸的图。命令:acgm。"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user