mirror of
https://github.com/TeamPGM/PagerMaid_Plugins.git
synced 2024-11-21 23:55:34 +00:00
📦 xtao-some : 修改 pixiv 反代 api , 优化逻辑 , 提醒 (#66)
* 👷 更新 CI 通知范围 * 👷 修改提醒间隔时间 * 📦 修改 pixiv 反代 api , 优化逻辑 , 提醒 * Update list.json
This commit is contained in:
parent
df928519f3
commit
2b5987ec68
7
.github/workflows/python.yml
vendored
7
.github/workflows/python.yml
vendored
@ -1,6 +1,9 @@
|
||||
name: Github commit to telegram
|
||||
|
||||
on: [push]
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
|
||||
jobs:
|
||||
build:
|
||||
@ -25,4 +28,4 @@ jobs:
|
||||
|
||||
# 发送通知
|
||||
- name: Send notice
|
||||
run: python telegram_update.py ${{ secrets.TG_BOT_TOKEN }}
|
||||
run: python telegram_update.py ${{ secrets.TG_BOT_TOKEN }}
|
||||
|
@ -62,7 +62,7 @@
|
||||
},
|
||||
{
|
||||
"name": "xtao-some",
|
||||
"version": "1.01",
|
||||
"version": "1.10",
|
||||
"section": "daily",
|
||||
"maintainer": "xtaodada",
|
||||
"size": "18.8 kb",
|
||||
|
@ -2,8 +2,6 @@ import json, time, sys
|
||||
from requests import get, post
|
||||
|
||||
token = str(sys.argv[1])
|
||||
|
||||
time.sleep(30)
|
||||
main = json.loads(get("https://api.github.com/repos/xtaodada/PagerMaid_Plugins/commits/master").content)
|
||||
push_content = {}
|
||||
push_content['chat_id'] = '-1001441461877'
|
||||
|
18
xtao-some.py
18
xtao-some.py
@ -14,9 +14,7 @@ from os import remove
|
||||
async def guess(context):
|
||||
reply = await context.get_reply_message()
|
||||
await context.edit("获取中 . . .")
|
||||
if reply:
|
||||
pass
|
||||
else:
|
||||
if not reply:
|
||||
context.edit("宁需要回复一句话")
|
||||
return True
|
||||
text = {'text': str(reply.message.replace("/guess ", "").replace(" ", ""))}
|
||||
@ -48,7 +46,7 @@ async def admin(context):
|
||||
try:
|
||||
admins = await context.client.get_participants(chat, filter=ChannelParticipantsAdmins)
|
||||
except:
|
||||
await context.edit('请在群组中运行。')
|
||||
await context.edit('请在群组中使用。')
|
||||
return True
|
||||
admin_list = []
|
||||
for admin in admins:
|
||||
@ -278,11 +276,9 @@ async def pixiv(context):
|
||||
try:
|
||||
await context.edit('正在下载图片中 ...')
|
||||
try:
|
||||
r = requests.get('https://daidr.me/imageProxy/?url=' +
|
||||
pixiv_json['illust']['meta_single_page']['original_image_url'])
|
||||
r = requests.get(pixiv_json['illust']['meta_single_page']['original_image_url'].replace('i.pximg.net','i.pixiv.cat'))
|
||||
except:
|
||||
r = requests.get('https://daidr.me/imageProxy/?url=' +
|
||||
pixiv_json['illust']['meta_pages'][pixiv_page - 1]['image_urls']['original'])
|
||||
r = requests.get(pixiv_json['illust']['meta_pages'][pixiv_page - 1]['image_urls']['original'].replace('i.pximg.net','i.pixiv.cat'))
|
||||
with open("pixiv.jpg", "wb") as code:
|
||||
code.write(r.content)
|
||||
await context.edit('正在上传图片中 ...')
|
||||
@ -333,11 +329,9 @@ async def pixiv(context):
|
||||
try:
|
||||
await context.edit('正在下载图片中 ...')
|
||||
try:
|
||||
r = requests.get('https://daidr.me/imageProxy/?url=' +
|
||||
pixiv_json['illust']['meta_single_page']['original_image_url'])
|
||||
r = requests.get(pixiv_json['illust']['meta_single_page']['original_image_url'].replace('i.pximg.net','i.pixiv.cat'))
|
||||
except:
|
||||
r = requests.get('https://daidr.me/imageProxy/?url=' +
|
||||
pixiv_json['illust']['meta_pages'][pixiv_page - 1]['image_urls']['original'])
|
||||
r = requests.get(pixiv_json['illust']['meta_pages'][pixiv_page - 1]['image_urls']['original'].replace('i.pximg.net','i.pixiv.cat'))
|
||||
with open("pixiv.jpg", "wb") as code:
|
||||
code.write(r.content)
|
||||
await context.edit('正在上传图片中 ...')
|
||||
|
Loading…
Reference in New Issue
Block a user