📦 xtao-some : 修改 pixiv 反代 api , 优化逻辑 , 提醒 (#66)

* 👷 更新 CI 通知范围

* 👷 修改提醒间隔时间

* 📦 修改 pixiv 反代 api , 优化逻辑 , 提醒

* Update list.json
This commit is contained in:
Xtao_dada 2020-11-08 00:17:37 +08:00 committed by GitHub
parent df928519f3
commit 2b5987ec68
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 12 additions and 17 deletions

View File

@ -1,6 +1,9 @@
name: Github commit to telegram name: Github commit to telegram
on: [push] on:
push:
branches:
- master
jobs: jobs:
build: build:

View File

@ -62,7 +62,7 @@
}, },
{ {
"name": "xtao-some", "name": "xtao-some",
"version": "1.01", "version": "1.10",
"section": "daily", "section": "daily",
"maintainer": "xtaodada", "maintainer": "xtaodada",
"size": "18.8 kb", "size": "18.8 kb",

View File

@ -2,8 +2,6 @@ import json, time, sys
from requests import get, post from requests import get, post
token = str(sys.argv[1]) token = str(sys.argv[1])
time.sleep(30)
main = json.loads(get("https://api.github.com/repos/xtaodada/PagerMaid_Plugins/commits/master").content) main = json.loads(get("https://api.github.com/repos/xtaodada/PagerMaid_Plugins/commits/master").content)
push_content = {} push_content = {}
push_content['chat_id'] = '-1001441461877' push_content['chat_id'] = '-1001441461877'

View File

@ -14,9 +14,7 @@ from os import remove
async def guess(context): async def guess(context):
reply = await context.get_reply_message() reply = await context.get_reply_message()
await context.edit("获取中 . . .") await context.edit("获取中 . . .")
if reply: if not reply:
pass
else:
context.edit("宁需要回复一句话") context.edit("宁需要回复一句话")
return True return True
text = {'text': str(reply.message.replace("/guess ", "").replace(" ", ""))} text = {'text': str(reply.message.replace("/guess ", "").replace(" ", ""))}
@ -48,7 +46,7 @@ async def admin(context):
try: try:
admins = await context.client.get_participants(chat, filter=ChannelParticipantsAdmins) admins = await context.client.get_participants(chat, filter=ChannelParticipantsAdmins)
except: except:
await context.edit('请在群组中运行') await context.edit('请在群组中使用')
return True return True
admin_list = [] admin_list = []
for admin in admins: for admin in admins:
@ -278,11 +276,9 @@ async def pixiv(context):
try: try:
await context.edit('正在下载图片中 ...') await context.edit('正在下载图片中 ...')
try: try:
r = requests.get('https://daidr.me/imageProxy/?url=' + r = requests.get(pixiv_json['illust']['meta_single_page']['original_image_url'].replace('i.pximg.net','i.pixiv.cat'))
pixiv_json['illust']['meta_single_page']['original_image_url'])
except: except:
r = requests.get('https://daidr.me/imageProxy/?url=' + r = requests.get(pixiv_json['illust']['meta_pages'][pixiv_page - 1]['image_urls']['original'].replace('i.pximg.net','i.pixiv.cat'))
pixiv_json['illust']['meta_pages'][pixiv_page - 1]['image_urls']['original'])
with open("pixiv.jpg", "wb") as code: with open("pixiv.jpg", "wb") as code:
code.write(r.content) code.write(r.content)
await context.edit('正在上传图片中 ...') await context.edit('正在上传图片中 ...')
@ -333,11 +329,9 @@ async def pixiv(context):
try: try:
await context.edit('正在下载图片中 ...') await context.edit('正在下载图片中 ...')
try: try:
r = requests.get('https://daidr.me/imageProxy/?url=' + r = requests.get(pixiv_json['illust']['meta_single_page']['original_image_url'].replace('i.pximg.net','i.pixiv.cat'))
pixiv_json['illust']['meta_single_page']['original_image_url'])
except: except:
r = requests.get('https://daidr.me/imageProxy/?url=' + r = requests.get(pixiv_json['illust']['meta_pages'][pixiv_page - 1]['image_urls']['original'].replace('i.pximg.net','i.pixiv.cat'))
pixiv_json['illust']['meta_pages'][pixiv_page - 1]['image_urls']['original'])
with open("pixiv.jpg", "wb") as code: with open("pixiv.jpg", "wb") as code:
code.write(r.content) code.write(r.content)
await context.edit('正在上传图片中 ...') await context.edit('正在上传图片中 ...')