Merge pull request #25 from TNTcraftHIM/master

meizi增加视频(指令meizisp)!
This commit is contained in:
Pentacene 2020-08-25 22:59:35 +08:00 committed by GitHub
commit cb11fec650
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 32 additions and 3 deletions

View File

@ -222,13 +222,13 @@
}, },
{ {
"name": "meizi", "name": "meizi",
"version": "1.3", "version": "1.4",
"section": "profile", "section": "profile",
"maintainer": "TNTcraftHIM", "maintainer": "TNTcraftHIM",
"size": "2.6 kb", "size": "3.7 kb",
"supported": true, "supported": true,
"des-short": "多网站随机获取写真", "des-short": "多网站随机获取写真",
"des": "从不同的网站中调取妹子写真但是无漏点放心使用安全版ghs。命令meizi。" "des": "从不同的网站中调取妹子写真/视频但是无漏点放心使用安全版ghs。命令meizimeizisp。"
}, },
{ {
"name": "acg-multi", "name": "acg-multi",

View File

@ -61,3 +61,32 @@ async def meizi(context):
await context.edit("出错了呜呜呜 ~ 试了好多好多次都无法访问到 API 服务器(没有妹子看啦!) 。") await context.edit("出错了呜呜呜 ~ 试了好多好多次都无法访问到 API 服务器(没有妹子看啦!) 。")
sleep(2) sleep(2)
await context.delete() await context.delete()
@listener(is_plugin=True, outgoing=True, command="meizisp",
description="随机获取妹子的视频")
async def meizisp(context):
await context.edit("获取中 . . .")
status = False
for _ in range (20): #最多重试20次
vid = get("https://mv.52.mk/video.php")
if vid.status_code == 200:
with open(r'vid.mp4', 'wb') as f:
await context.edit("正在上传视频")
f.write(vid.content)
await context.client.send_file(
context.chat_id,
"vid.mp4",
reply_to=None,
caption=None
)
try:
remove('vid.mp4')
except:
pass
status = True
break #成功了就赶紧结束啦!
if not status:
await context.edit("出错了呜呜呜 ~ 试了好多好多次都无法访问到 API 服务器(没有妹子视频看啦!) 。")
sleep(2)
await context.delete()