更新 叮叮联盟_api.py
This commit is contained in:
parent
4b74687072
commit
d90aff3f06
70
叮叮联盟_api.py
70
叮叮联盟_api.py
@ -46,7 +46,6 @@ from functools import wraps
|
|||||||
import requests
|
import requests
|
||||||
import time
|
import time
|
||||||
import os
|
import os
|
||||||
from notify import send
|
|
||||||
import json
|
import json
|
||||||
import hashlib
|
import hashlib
|
||||||
import random
|
import random
|
||||||
@ -58,6 +57,7 @@ from base64 import b64encode
|
|||||||
import uuid
|
import uuid
|
||||||
from datetime import datetime,timedelta
|
from datetime import datetime,timedelta
|
||||||
import re
|
import re
|
||||||
|
from notify import send
|
||||||
logging.basicConfig(level=logging.INFO, format='[%(levelname)s] ===> %(message)s')
|
logging.basicConfig(level=logging.INFO, format='[%(levelname)s] ===> %(message)s')
|
||||||
code = "叮叮联盟_api版"
|
code = "叮叮联盟_api版"
|
||||||
ver = "1.8"
|
ver = "1.8"
|
||||||
@ -537,47 +537,45 @@ class yuanshen:
|
|||||||
logging.info(f'当前账号[{name}]余额[{m}]')
|
logging.info(f'当前账号[{name}]余额[{m}]')
|
||||||
url = 'https://api.jiudingliliang.com/user/withdraw'
|
url = 'https://api.jiudingliliang.com/user/withdraw'
|
||||||
r = requests.post(url,headers=self.h,json={}).json()
|
r = requests.post(url,headers=self.h,json={}).json()
|
||||||
|
|
||||||
if r['code'] == 10000:
|
if r['code'] == 10000:
|
||||||
lessmoney = r["result"]["transfer"][0]["m"]
|
lessmoney = r["result"]["transfer"][0]["m"]
|
||||||
|
|
||||||
# 检查是否可以提现并发送提醒
|
|
||||||
if m >= lessmoney:
|
|
||||||
send("叮叮可提现通知📢", f'当前账号[{name}]余额[{m}],可以提现啦')
|
|
||||||
|
|
||||||
# 检查是否有推送设置
|
|
||||||
if appToken and uid:
|
|
||||||
if m >= lessmoney:
|
if m >= lessmoney:
|
||||||
# 尝试提现
|
send("叮叮可提现通知📢",f'当前账号[{name}]余额[{m}],可以提现啦🎉')
|
||||||
url = 'https://api.jiudingliliang.com/user/transfer'
|
if appToken and uid:
|
||||||
data = {'amount': lessmoney, 'type': 'alipay'}
|
if m >= lessmoney:
|
||||||
r = requests.post(url, json=data, headers=self.h).json()
|
send("叮叮可提现通知📢",f'当前账号[{name}]余额[{m}],可以提现啦🎉')
|
||||||
if r['code'] == 10000:
|
url = 'https://api.jiudingliliang.com/user/transfer'
|
||||||
logging.info(f'提现成功[{r}]')
|
data = {'amount':lessmoney, 'type':'alipay'}
|
||||||
kl = r["result"]["alipay_kl"]
|
r = requests.post(url,json=data,headers=self.h).json()
|
||||||
data = {
|
logging.info(r)
|
||||||
"appToken": appToken,
|
if r['code'] == 10000:
|
||||||
"content": f'叮叮联盟提现成功,口令[{kl}]',
|
logging.info(f'提现成功[{r}]')
|
||||||
"summary": f'叮叮联盟提现成功,口令[{kl}]',
|
kl = r["result"]["alipay_kl"]
|
||||||
"contentType": 1,
|
send(f"叮叮提现成功通知📢",f'当前账号[{name}]余额[{m}],提现成功🎉,支付宝口令:\n{kl}\n请速度兑换')
|
||||||
"uids": [uid],
|
data = {
|
||||||
"verifyPayType": 0
|
"appToken":appToken,
|
||||||
}
|
"content":f'叮叮联盟提现成功,口令[{kl}]',
|
||||||
r = requests.post('https://wxpusher.zjiecode.com/api/send/message', json=data).json()
|
"summary":f'叮叮联盟提现成功,口令[{kl}]',
|
||||||
if r['code'] == 1000:
|
"contentType":1,
|
||||||
logging.info('通知已发送')
|
"uids":[
|
||||||
|
uid
|
||||||
|
],
|
||||||
|
"verifyPayType":0
|
||||||
|
}
|
||||||
|
r = requests.post('https://wxpusher.zjiecode.com/api/send/message',json=data).json()
|
||||||
|
if r['code'] == 1000:
|
||||||
|
logging.info('通知已发送')
|
||||||
|
else:
|
||||||
|
logging.error('通知发送失败')
|
||||||
else:
|
else:
|
||||||
logging.error('通知发送失败')
|
logging.error(f'提现失败[{r}]')
|
||||||
else:
|
else:
|
||||||
logging.error(f'提现失败[{r}]')
|
logging.info(f'余额不足,跳过提现')
|
||||||
else:
|
else:
|
||||||
logging.info(f'余额不足,跳过提现')
|
logging.info(f'未设置wxpusher信息,跳过提现')
|
||||||
else:
|
|
||||||
logging.info(f'未设置wxpusher信息,跳过提现')
|
|
||||||
else:
|
else:
|
||||||
logging.error(f'获取用户信息失败[{r}]')
|
logging.error(f'获取用户信息失败[{r}]')
|
||||||
else:
|
|
||||||
logging.error(f'获取用户信息失败[{r}]')
|
|
||||||
|
|
||||||
|
|
||||||
def main(self):
|
def main(self):
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user