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