更新 叮叮联盟_api.py
This commit is contained in:
parent
3246bc2a86
commit
75776e8e58
88
叮叮联盟_api.py
88
叮叮联盟_api.py
@ -8,6 +8,7 @@
|
||||
#
|
||||
# 变量名:yuanshen_api
|
||||
#
|
||||
qj = True #23-26篇强制推送 开启True 关闭False
|
||||
# 如需自动提现 填写wxpusher的apptoken到 yuanshen_apptoken
|
||||
# 使用接受推送的微信号关注你自己的主题填写uid到 yuanshen_wxpusheruid
|
||||
# uid 可以在wxpusher微信公众号 下方我的-我的uid找到
|
||||
@ -58,9 +59,10 @@ import uuid
|
||||
from datetime import datetime,timedelta
|
||||
import re
|
||||
from notify import send
|
||||
|
||||
logging.basicConfig(level=logging.INFO, format='[%(levelname)s] ===> %(message)s')
|
||||
code = "叮叮联盟_api版"
|
||||
ver = "1.8"
|
||||
ver = "1.9"
|
||||
envname = "yuanshen_api"
|
||||
|
||||
debug = False #debug模式 开启即从脚本内部获取环境变量
|
||||
@ -488,45 +490,50 @@ class yuanshen:
|
||||
logging.info(f"遇到检测文章:推送结果[{r}]")
|
||||
@retry()
|
||||
def read(self):
|
||||
#print(self.k)
|
||||
|
||||
data = {"k":self.k}
|
||||
url = 'https://api.jiudingliliang.com/task/read-article'
|
||||
r = requests.post(url,json=data,headers=self.readh).json()
|
||||
if r['code'] == 10000:
|
||||
self.read_url = r["result"]["articleUrl"]
|
||||
va, date_string = self.get_readtime(self.read_url)
|
||||
logging.info(f'获取文章成功[{self.read_url}],发布时间[{date_string}]')
|
||||
j = urlparse(self.read_url.replace('\\',''))
|
||||
biz = parse_qs(j.query).get('__biz', [''])[0] if '__biz' in parse_qs(j.query) else ''
|
||||
|
||||
if 'biz' not in self.read_url or biz in bizlist or va:
|
||||
self.tuisong()
|
||||
time.sleep(random.randint(20,25))
|
||||
else:
|
||||
time.sleep(random.randint(8,10))
|
||||
now = 0
|
||||
while True:
|
||||
data = {"k":self.k}
|
||||
url = 'https://api.jiudingliliang.com/task/read-article'
|
||||
r = requests.post(url,json=data,headers=self.readh).json()
|
||||
if r['code'] == 10000:
|
||||
self.read_url = r["result"]["articleUrl"]
|
||||
thisnum = r["result"]["readingNumber"]
|
||||
va, date_string = self.get_readtime(self.read_url)
|
||||
logging.info(f'获取文章成功[{self.read_url}],发布时间[{date_string}]')
|
||||
j = urlparse(self.read_url.replace('\\',''))
|
||||
biz = parse_qs(j.query).get('__biz', [''])[0] if '__biz' in parse_qs(j.query) else ''
|
||||
|
||||
k = r["result"]["k"]
|
||||
if 'biz' not in self.read_url or biz in bizlist or va:
|
||||
self.tuisong()
|
||||
time.sleep(random.randint(20,25))
|
||||
elif thisnum in [23, 24, 25, 26] and qj:
|
||||
logging.info('触发强检')
|
||||
self.tuisong()
|
||||
time.sleep(random.randint(20,25))
|
||||
else:
|
||||
time.sleep(random.randint(8,10))
|
||||
|
||||
k = r["result"]["k"]
|
||||
|
||||
else:
|
||||
logging.error(f'获取文章失败[{r}]')
|
||||
break
|
||||
|
||||
else:
|
||||
logging.error(f'获取文章失败[{r}]')
|
||||
return False
|
||||
|
||||
|
||||
url = 'https://api.jiudingliliang.com/task/read-article-completed'
|
||||
data = {'k':k}
|
||||
r = requests.post(url,json=data,headers=self.readh).json()
|
||||
if r['code'] == 10000:
|
||||
now = r["result"]["readingNumber"]
|
||||
all = r["result"]["totalReading"]
|
||||
logging.info(f'第[{now}/{all}]篇文章阅读成功')
|
||||
if now == all:
|
||||
logging.info("本轮阅读完成")
|
||||
return False
|
||||
self.k = r["result"]["k"]
|
||||
return True
|
||||
else:
|
||||
logging.error(f'阅读失败[{r}]')
|
||||
|
||||
url = 'https://api.jiudingliliang.com/task/read-article-completed'
|
||||
data = {'k':k}
|
||||
r = requests.post(url,json=data,headers=self.readh).json()
|
||||
if r['code'] == 10000:
|
||||
now = r["result"]["readingNumber"]
|
||||
all = r["result"]["totalReading"]
|
||||
logging.info(f'第[{now}/{all}]篇文章阅读成功')
|
||||
if now == all:
|
||||
logging.info("本轮阅读完成")
|
||||
break
|
||||
self.k = r["result"]["k"]
|
||||
else:
|
||||
logging.error(f'阅读失败[{r}]')
|
||||
break
|
||||
@retry()
|
||||
def userinfo(self):
|
||||
url = 'https://api.jiudingliliang.com/user/info'
|
||||
@ -544,7 +551,6 @@ class yuanshen:
|
||||
send("叮叮可提现通知📢",f'当前账号[{name}]余额[{m}],可以提现啦🎉')
|
||||
if appToken and uid:
|
||||
if m >= lessmoney:
|
||||
send("叮叮可提现通知📢",f'当前账号[{name}]余额[{m}],可以提现啦🎉')
|
||||
url = 'https://api.jiudingliliang.com/user/transfer'
|
||||
data = {'amount':lessmoney, 'type':'alipay'}
|
||||
r = requests.post(url,json=data,headers=self.h).json()
|
||||
@ -552,7 +558,6 @@ class yuanshen:
|
||||
if r['code'] == 10000:
|
||||
logging.info(f'提现成功[{r}]')
|
||||
kl = r["result"]["alipay_kl"]
|
||||
send(f"叮叮提现成功通知📢",f'当前账号[{name}]余额[{m}],提现成功🎉,支付宝口令:\n{kl}\n请速度兑换')
|
||||
data = {
|
||||
"appToken":appToken,
|
||||
"content":f'叮叮联盟提现成功,口令[{kl}]',
|
||||
@ -583,8 +588,7 @@ class yuanshen:
|
||||
self.login()
|
||||
if self.getread():
|
||||
print('='*30)
|
||||
while self.read():
|
||||
time.sleep(random.randint(0,1))
|
||||
self.read()
|
||||
else:
|
||||
logging.error('获取阅读入口失败')
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user