Repository navigation
Expand file tree
/
Copy pathCCJC.py
More file actions
98 lines (91 loc) · 2.74 KB
/
Copy pathCCJC.py
File metadata and controls
98 lines (91 loc) · 2.74 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
import os
import time
import asyncio
import base64
import json
import re
import requests
import datetime
from telethon import TelegramClient,sync
from telethon.tl.types import InputMessagesFilterPhotos
proxy = None
# =============需要被替换的值=================
'''
api_id 你的api id
api_hash 你的api hash
channel_link 要下载图片的频道链接
proxy 将localhost改成代理地址,12345改成代理端口
picture_storage_path 图片下载到的路径
'''
api_id = 5672799
api_hash = "e08529171140eac69071c630f03f1a7a"
channel_link = "EmbyCc_bot"
QDmeg = "/start"
#proxy =("socks5","localhost",12345) #不需要代理的话删掉该行
# ==========================================
client = TelegramClient('shexiaoyu',api_id=api_id,api_hash=api_hash,proxy=proxy).start()
#微信提醒
def GetWXMeg(text):
url = 'http://wxpusher.zjiecode.com/api/send/message'
data = {
'appToken':'AT_OdRi5Z4hzWMr225NfPVHhXVSmfN59GeR',
'content':text,
'summary':'CC公益服自动查看异常提醒',
'contentType':1,
'uids':['UID_8krNXTxaevo6ogJ1g1W3wTnhZpZR'],
'url':'https%3A%2F%2Fpornemby.club%2Fweb%2Findex.html'
}
response = requests.post(url = url, json = data)
data = response.json()
return 'ok'
def HQXX():
for message in client.iter_messages(channel_link):
return message
def captcha_solver(f):
with open(f, "rb") as image_file:
encoded_string = base64.b64encode(image_file.read()).decode('ascii')
url = 'https://api.apitruecaptcha.org/one/gettext'
data = {
'userid':'sheriqiang@gmail.com',
'apikey':'L7GYXVaB2BreQrGhzh3I',
'data':encoded_string
}
response = requests.post(url = url, json = data)
data = response.json()
return data['result']
def setjson(key,text):
with open("/home/tgqd/qd.json", "r",encoding='utf-8') as jsonFile:
data = json.load(jsonFile)
tmp = data[key]
data[key] = text
with open("/home/tgqd/qd.json", "w") as jsonFile:
json.dump(data, jsonFile,ensure_ascii=False)
def getjson(key):
with open("/home/tgqd/qd.json", "r",encoding='utf-8') as jsonFile:
data = json.load(jsonFile)
return data[key]
client.send_message(channel_link, QDmeg)
time.sleep(10)
newmeg = HQXX()
for button in newmeg.buttons[0]:
if "号" in button.text:
print("点击账号按钮")
button.click()
time.sleep(3)
newmeg = HQXX()
for button2 in newmeg.buttons[2]:
if "号信息" in button2.text:
print("点击帐号信息按钮")
button2.click()
time.sleep(3)
newmeg = HQXX()
time.sleep(3)
dqsj = str(datetime.date.today())
if dqsj in newmeg.text:
print("CC公益服自动浏览正常")
else:
print("CC公益服自动浏览异常")
GetWXMeg(newmeg.text)
client.send_read_acknowledge(channel_link) #将机器人回应设为已读
client.disconnect()
print("脚本结束")