mirror of
https://github.com/Ytong825/mao.git
synced 2025-12-19 16:25:13 +08:00
0.o
This commit is contained in:
24
dml.py
24
dml.py
@@ -5,19 +5,25 @@ import time
|
|||||||
import requests
|
import requests
|
||||||
import json
|
import json
|
||||||
import notify
|
import notify
|
||||||
response = requests.get("https://mkjt.jdmk.xyz/mkjt.txt")
|
|
||||||
response.encoding = 'utf-8'
|
|
||||||
txt = response.text
|
|
||||||
print(txt)
|
|
||||||
message = ''
|
message = ''
|
||||||
from dotenv import load_dotenv
|
from dotenv import load_dotenv
|
||||||
load_dotenv()
|
load_dotenv()
|
||||||
accounts = os.getenv('dmlck')
|
accounts = os.getenv('dmlck')
|
||||||
|
#推送加 token
|
||||||
|
plustoken = os.getenv("plustoken")
|
||||||
|
|
||||||
|
def Push(contents):
|
||||||
|
# plustoken推送
|
||||||
|
headers = {'Content-Type': 'application/json'}
|
||||||
|
json = {"token": plustoken, 'title': '达美乐披萨中奖推送', 'content': contents.replace('\n', '<br>'), "template": "json"}
|
||||||
|
resp = requests.post(f'http://www.pushplus.plus/send', json=json, headers=headers).json()
|
||||||
|
print('push+推送成功' if resp['code'] == 200 else 'push+推送失败')
|
||||||
|
|
||||||
if accounts is None:
|
if accounts is None:
|
||||||
print('叼毛CK都没跑个毛啊?')
|
print('叼毛CK都没跑个毛啊?')
|
||||||
else:
|
else:
|
||||||
accounts_list = os.environ.get('dmlck').split('@')
|
accounts_list = os.environ.get('dmlck').split('&')
|
||||||
|
|
||||||
num_of_accounts = len(accounts_list)
|
num_of_accounts = len(accounts_list)
|
||||||
|
|
||||||
@@ -31,7 +37,7 @@ else:
|
|||||||
|
|
||||||
print(f"\n=======达美乐开始执行账号{i}=======")
|
print(f"\n=======达美乐开始执行账号{i}=======")
|
||||||
|
|
||||||
url = "https://game.dominos.com.cn/burgundy/game/gameDone"
|
url = "https://game.dominos.com.cn/bulgogi/game/gameDone"
|
||||||
|
|
||||||
payload = f"openid={Cookie}&score=d8XtWSEx0zRy%2BxdeJriXZeoTek6ZVZdadlxdTFiN9yrxt%2BSIax0%2BRccbkObBZsisYFTquPg%2FG2cnGPBlGV2f32C6D5q3FFhgvcfJP9cKg%2BXs6l7J%2BEcahicPml%2BZWp3P4o1pOQvNdDUTQgtO6NGY0iijZ%2FLAmITy5EJU8dAc1EnbvhOYG36Qg1Ji4GDRoxAfRgmELvpLM6JSFlCEKG2C2s%2BJCevOJo7kwsLJCvwbVgeewhKSAyCZYnJQ4anmPgvrv6iUIiFQP%2Bj6%2B5p1VETe5xfawQ4FQ4w0mttXP0%2BhX39n1dzDrfcSkYkUaWPkIFlHAX7QPT3IgG6MhIKCvB%2BUcw%3D%3D&tempId=16408240716151126162"
|
payload = f"openid={Cookie}&score=d8XtWSEx0zRy%2BxdeJriXZeoTek6ZVZdadlxdTFiN9yrxt%2BSIax0%2BRccbkObBZsisYFTquPg%2FG2cnGPBlGV2f32C6D5q3FFhgvcfJP9cKg%2BXs6l7J%2BEcahicPml%2BZWp3P4o1pOQvNdDUTQgtO6NGY0iijZ%2FLAmITy5EJU8dAc1EnbvhOYG36Qg1Ji4GDRoxAfRgmELvpLM6JSFlCEKG2C2s%2BJCevOJo7kwsLJCvwbVgeewhKSAyCZYnJQ4anmPgvrv6iUIiFQP%2Bj6%2B5p1VETe5xfawQ4FQ4w0mttXP0%2BhX39n1dzDrfcSkYkUaWPkIFlHAX7QPT3IgG6MhIKCvB%2BUcw%3D%3D&tempId=16408240716151126162"
|
||||||
|
|
||||||
@@ -44,19 +50,21 @@ else:
|
|||||||
}
|
}
|
||||||
|
|
||||||
while True:
|
while True:
|
||||||
shrurl = "https://game.dominos.com.cn/burgundy/game/sharingDone"
|
shrurl = "https://game.dominos.com.cn/bulgogi/game/sharingDone"
|
||||||
payload2 = f"openid={Cookie}&from=1&target=0"
|
payload2 = f"openid={Cookie}&from=1&target=0"
|
||||||
res = requests.post(shrurl, data=payload2, headers=headers).json()
|
res = requests.post(shrurl, data=payload2, headers=headers).json()
|
||||||
if res['errorMessage'] == "今日分享已用完,请明日再来":
|
if res['errorMessage'] == "今日分享已用完,请明日再来":
|
||||||
print(f'账号{i}分享已达上限,明天再来吧')
|
print(f'账号{i}分享已达上限,明天再来吧')
|
||||||
break
|
break
|
||||||
while True:
|
for a in range(3):
|
||||||
response = requests.post(url, data=payload, headers=headers)
|
response = requests.post(url, data=payload, headers=headers)
|
||||||
response = response.json()
|
response = response.json()
|
||||||
if response["statusCode"] == 0:
|
if response["statusCode"] == 0:
|
||||||
prize = response['content']['name']
|
prize = response['content']['name']
|
||||||
print(f"\n账号{i}\n{prize}")
|
print(f"\n账号{i}\n{prize}")
|
||||||
message += f"\n{prize}"
|
message += f"\n{prize}"
|
||||||
|
if '一等奖' in prize:
|
||||||
|
Push(contents="账号{i}\n{prize}")
|
||||||
if response["statusCode"] != 0:
|
if response["statusCode"] != 0:
|
||||||
print(response)
|
print(response)
|
||||||
err = response['errorMessage']
|
err = response['errorMessage']
|
||||||
|
|||||||
200
nfsq.py
200
nfsq.py
@@ -1,200 +0,0 @@
|
|||||||
"""
|
|
||||||
name: 农夫山泉76行定位地址直接改有水地址并发便可,本脚本是并发本
|
|
||||||
Author: MK集团本部
|
|
||||||
Date: 0000-00-00
|
|
||||||
export nfsq="备注#apitoken"
|
|
||||||
cron: 0 5 * * *
|
|
||||||
"""
|
|
||||||
#import notify
|
|
||||||
import requests, json, re, os, sys, time, random, datetime, execjs
|
|
||||||
response = requests.get("https://mkjt.jdmk.xyz/mkjt.txt")
|
|
||||||
response.encoding = 'utf-8'
|
|
||||||
txt = response.text
|
|
||||||
print(txt)
|
|
||||||
environ = "nfsq"
|
|
||||||
name = "农夫༒山泉"
|
|
||||||
session = requests.session()
|
|
||||||
#---------------------主代码区块---------------------
|
|
||||||
|
|
||||||
def taskdo(apitoken,taskid,name):
|
|
||||||
header = {
|
|
||||||
"Host": "gateway.jmhd8.com",
|
|
||||||
"Connection": "keep-alive",
|
|
||||||
"unique_identity": "5400823e-b872-4187-8987-9721936191d2",
|
|
||||||
"apitoken": apitoken,
|
|
||||||
"content-type": "application/x-www-form-urlencoded",
|
|
||||||
"charset": "utf-8",
|
|
||||||
"User-Agent": "Mozilla/5.0 (Linux; Android 10; MI 8 Build/QKQ1.190828.002; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/130.0.6723.103 Mobile Safari/537.36 XWEB/1300259 MMWEBSDK/20241103 MMWEBID/6533 MicroMessenger/8.0.55.2780(0x28003737) WeChat/arm64 Weixin NetType/WIFI Language/zh_CN ABI/arm64 MiniProgramEnv/android",
|
|
||||||
}
|
|
||||||
url = f'https://gateway.jmhd8.com/geement.marketingplay/api/v1/task/join?action_time=2025-01-01%2008%3A07%3A27&task_id={taskid}'
|
|
||||||
try:
|
|
||||||
for i in range(100):
|
|
||||||
response = session.get(url=url, headers=header)
|
|
||||||
response = json.loads(response.text)
|
|
||||||
if "处理成功" in response["msg"]:
|
|
||||||
#print(f"☁️{name}:抽奖次数 +1")
|
|
||||||
pass
|
|
||||||
elif "已参与" in response["msg"]:
|
|
||||||
break
|
|
||||||
else:
|
|
||||||
break
|
|
||||||
except Exception as e:
|
|
||||||
print(e)
|
|
||||||
|
|
||||||
def task(apitoken):
|
|
||||||
header = {
|
|
||||||
"Host": "gateway.jmhd8.com",
|
|
||||||
"Connection": "keep-alive",
|
|
||||||
"unique_identity": "5400823e-b872-4187-8987-9721936191d2",
|
|
||||||
"apitoken": apitoken,
|
|
||||||
"content-type": "application/x-www-form-urlencoded",
|
|
||||||
"charset": "utf-8",
|
|
||||||
"User-Agent": "Mozilla/5.0 (Linux; Android 10; MI 8 Build/QKQ1.190828.002; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/130.0.6723.103 Mobile Safari/537.36 XWEB/1300259 MMWEBSDK/20241103 MMWEBID/6533 MicroMessenger/8.0.55.2780(0x28003737) WeChat/arm64 Weixin NetType/WIFI Language/zh_CN ABI/arm64 MiniProgramEnv/android",
|
|
||||||
}
|
|
||||||
url = 'https://gateway.jmhd8.com/geement.marketingplay/api/v1/task?pageNum=1&pageSize=10&task_status=2&status=1&group_id=24121016331837'
|
|
||||||
try:
|
|
||||||
response = session.get(url=url, headers=header)
|
|
||||||
response = json.loads(response.text)
|
|
||||||
if response["success"] == True:
|
|
||||||
for i in response["data"]:
|
|
||||||
taskid = i["id"]
|
|
||||||
name = i["name"]
|
|
||||||
taskdo(apitoken,taskid,name)
|
|
||||||
time.sleep(5)
|
|
||||||
except Exception as e:
|
|
||||||
print(e)
|
|
||||||
|
|
||||||
def gamelottery(apitoken):
|
|
||||||
header = {
|
|
||||||
"Host": "thirtypro.jmhd8.com",
|
|
||||||
"Connection": "keep-alive",
|
|
||||||
"unique_identity": "5400823e-b872-4187-8987-9721936191d2",
|
|
||||||
"apitoken": apitoken,
|
|
||||||
"Content-Length": "202",
|
|
||||||
"content-type": "application/json",
|
|
||||||
"charset": "utf-8",
|
|
||||||
"User-Agent": "Mozilla/5.0 (Linux; Android 10; MI 8 Build/QKQ1.190828.002; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/130.0.6723.103 Mobile Safari/537.36 XWEB/1300259 MMWEBSDK/20241103 MMWEBID/6533 MicroMessenger/8.0.55.2780(0x28003737) WeChat/arm64 Weixin NetType/WIFI Language/zh_CN ABI/arm64 MiniProgramEnv/android",
|
|
||||||
}
|
|
||||||
url = 'https://thirtypro.jmhd8.com/api/v1/nongfuwater/snake/checkerboard/lottery'
|
|
||||||
gamecode = "SCENE-24121018362724"
|
|
||||||
data = {"code":gamecode,"provice_name":"上海市","city_name":"上海市","area_name":"浦东新区","address":"上海市浦东新区泰公线人渡","longitude":121.506379,"dimension":31.245414}
|
|
||||||
try:
|
|
||||||
for m in range(100):
|
|
||||||
response = session.post(url=url, headers=header,json=data)
|
|
||||||
response = json.loads(response.text)
|
|
||||||
if response["success"] == True:
|
|
||||||
prize_name = response["data"]['prizedto']['prize_name']
|
|
||||||
prize_level = response["data"]['prizedto']["prize_level"]
|
|
||||||
for i in response["data"]['prizedto']["goods"]:
|
|
||||||
goods_name = i["goods_name"]
|
|
||||||
#print(f"☁️游戏:{prize_name}{prize_level}:{goods_name}")
|
|
||||||
print(f"☁️游戏:{goods_name}")
|
|
||||||
elif "用尽" in response['msg']:
|
|
||||||
#print(f"⭕游戏:次数用尽")
|
|
||||||
print(f"⭕游戏:{response['msg']}")
|
|
||||||
break
|
|
||||||
else:
|
|
||||||
print(f"⭕游戏:{response['msg']}")
|
|
||||||
break
|
|
||||||
except Exception as e:
|
|
||||||
print(e)
|
|
||||||
|
|
||||||
def marketinglottery(apitoken,code=True):
|
|
||||||
header = {
|
|
||||||
"Host": "gateway.jmhd8.com",
|
|
||||||
"Connection": "keep-alive",
|
|
||||||
"unique_identity": "5400823e-b872-4187-8987-9721936191d2",
|
|
||||||
"apitoken": apitoken,
|
|
||||||
"Content-Length": "202",
|
|
||||||
"content-type": "application/json",
|
|
||||||
"charset": "utf-8",
|
|
||||||
"User-Agent": "Mozilla/5.0 (Linux; Android 10; MI 8 Build/QKQ1.190828.002; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/130.0.6723.103 Mobile Safari/537.36 XWEB/1300259 MMWEBSDK/20241103 MMWEBID/6533 MicroMessenger/8.0.55.2780(0x28003737) WeChat/arm64 Weixin NetType/WIFI Language/zh_CN ABI/arm64 MiniProgramEnv/android",
|
|
||||||
}
|
|
||||||
url = 'https://gateway.jmhd8.com/geement.marketinglottery/api/v1/marketinglottery'
|
|
||||||
if code:
|
|
||||||
marketcode = "SCENE-24121018345681" #日常池3次
|
|
||||||
else:
|
|
||||||
marketcode = "SCENE-24121018352070" #任务池7次
|
|
||||||
data = {"code":marketcode,"provice_name":"上海市","city_name":"上海市","area_name":"浦东新区","address":"上海市浦东新区泰公线人渡","longitude":121.506379,"dimension":31.245414}
|
|
||||||
try:
|
|
||||||
for i in range(100):
|
|
||||||
response = session.post(url=url, headers=header,json=data)
|
|
||||||
response = json.loads(response.text)
|
|
||||||
if response["success"] == True:
|
|
||||||
prize_name = response["data"]['prizedto']['prize_name']
|
|
||||||
prize_level = response["data"]['prizedto']["prize_level"]
|
|
||||||
for i in response["data"]['prizedto']["goods"]:
|
|
||||||
goods_name = i["goods_name"]
|
|
||||||
print(f"☁️抽奖:{goods_name}")
|
|
||||||
elif "已经达到最大" in response['msg']:
|
|
||||||
#print(f"⭕抽奖:日常池次数用尽")
|
|
||||||
break
|
|
||||||
elif "不足" in response['msg']:
|
|
||||||
#print(f"⭕抽奖:任务池次数用尽")
|
|
||||||
print(f"⭕抽奖:次数用尽")
|
|
||||||
break
|
|
||||||
else:
|
|
||||||
print(f"⭕抽奖:{response['msg']}")
|
|
||||||
break
|
|
||||||
time.sleep(0.5)
|
|
||||||
except Exception as e:
|
|
||||||
print(e)
|
|
||||||
|
|
||||||
def info(apitoken):
|
|
||||||
header = {
|
|
||||||
"Host": "gateway.jmhd8.com",
|
|
||||||
"Connection": "keep-alive",
|
|
||||||
"unique_identity": "5400823e-b872-4187-8987-9721936191d2",
|
|
||||||
"apitoken": apitoken,
|
|
||||||
"content-type": "application/x-www-form-urlencoded",
|
|
||||||
"charset": "utf-8",
|
|
||||||
"User-Agent": "Mozilla/5.0 (Linux; Android 10; MI 8 Build/QKQ1.190828.002; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/130.0.6723.103 Mobile Safari/537.36 XWEB/1300259 MMWEBSDK/20241103 MMWEBID/6533 MicroMessenger/8.0.55.2780(0x28003737) WeChat/arm64 Weixin NetType/WIFI Language/zh_CN ABI/arm64 MiniProgramEnv/android",
|
|
||||||
}
|
|
||||||
url = 'https://gateway.jmhd8.com/geement.actjextra/api/v1/act/win/goods/simple?act_codes=ACT2412101428048%2CACT24121014352835%2CACT24121014371732'
|
|
||||||
header["apitoken"] = apitoken
|
|
||||||
try:
|
|
||||||
response = session.get(url=url, headers=header)
|
|
||||||
response = json.loads(response.text)
|
|
||||||
if response["success"] == True:
|
|
||||||
for i in response["data"]:
|
|
||||||
goods_name = i['win_goods_name']
|
|
||||||
prize_name = i['win_prize_name']
|
|
||||||
prize_level = i["win_prize_level"]
|
|
||||||
if ("特等奖" in prize_name or "特等奖" in prize_level or "一等奖" in prize_name or "一等奖" in prize_level or "乙巳蛇年典藏版玻璃瓶装天然矿泉水" in goods_name) and "十一等奖" not in prize_level:
|
|
||||||
print(f"🌈{prize_level}{prize_name}:{goods_name}")
|
|
||||||
except Exception as e:
|
|
||||||
print(e)
|
|
||||||
|
|
||||||
def main():
|
|
||||||
if os.environ.get(environ):
|
|
||||||
ck = os.environ.get(environ)
|
|
||||||
else:
|
|
||||||
ck = ""
|
|
||||||
if ck == "":
|
|
||||||
print("请设置变量")
|
|
||||||
sys.exit()
|
|
||||||
ck_run = ck.split('\n')
|
|
||||||
ck_run = [item for item in ck_run if item]
|
|
||||||
print(f"{' ' * 10}꧁༺ {name} ༻꧂\n")
|
|
||||||
for i, ck_run_n in enumerate(ck_run):
|
|
||||||
print(f'\n----------- 🍺账号【{i + 1}/{len(ck_run)}】执行🍺 -----------')
|
|
||||||
try:
|
|
||||||
id,two = ck_run_n.split('#',1)
|
|
||||||
#id = id[:3] + "*****" + id[-3:]
|
|
||||||
print(f"📱:{id}")
|
|
||||||
task(two)
|
|
||||||
print(f"-------棋盘-------")
|
|
||||||
gamelottery(two)
|
|
||||||
print(f"-------抽奖-------")
|
|
||||||
marketinglottery(two)
|
|
||||||
marketinglottery(two,False)
|
|
||||||
print(f"------------------")
|
|
||||||
info(two)
|
|
||||||
time.sleep(random.randint(1, 2))
|
|
||||||
except Exception as e:
|
|
||||||
print(e)
|
|
||||||
#notify.send('title', 'message')
|
|
||||||
print(f'\n----------- 🎊 执 行 结 束 🎊 -----------')
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
|
||||||
main()
|
|
||||||
193
农夫山泉抽水.py
Normal file
193
农夫山泉抽水.py
Normal file
@@ -0,0 +1,193 @@
|
|||||||
|
import time
|
||||||
|
import os
|
||||||
|
import requests
|
||||||
|
from datetime import datetime
|
||||||
|
import json
|
||||||
|
|
||||||
|
|
||||||
|
#抓取农夫山泉抽水小程序 获取apitoken值填入环境变量 变量名字为nfsq
|
||||||
|
# Constants
|
||||||
|
API_BASE_URL = "https://gateway.jmhd8.com"
|
||||||
|
USER_INFO_URL = f"{API_BASE_URL}/geement.usercenter/api/v1/user/information"
|
||||||
|
TASK_LIST_URL = f"{API_BASE_URL}/geement.marketingplay/api/v1/task"
|
||||||
|
JOIN_TASK_URL = f"{API_BASE_URL}/geement.marketingplay/api/v1/task/join"
|
||||||
|
LOTTERY_URL = "https://thirtypro.jmhd8.com/api/v1/nongfuwater/snake/checkerboard/lottery"
|
||||||
|
MARKETING_LOTTERY_URL = f"{API_BASE_URL}/geement.marketinglottery/api/v1/marketinglottery"
|
||||||
|
SENIORITY_URL = f"{API_BASE_URL}/geement.usercenter/api/v1/user/seniority"
|
||||||
|
TODAY_COUNT_URL = f"{API_BASE_URL}/geement.actjextra/api/v1/act/lottery/data/todaycount"
|
||||||
|
GOODS_SIMPLE_URL = f"{API_BASE_URL}/geement.actjextra/api/v1/act/win/goods/simple"
|
||||||
|
|
||||||
|
# Headers
|
||||||
|
HEADERS = {
|
||||||
|
'User-Agent': "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/122.0.0.0 Safari/537.36 MicroMessenger/7.0.20.1781(0x6700143B) NetType/WIFI MiniProgramEnv/Windows WindowsWechat/WMPF WindowsWechat(0x63090c11)XWEB/11581",
|
||||||
|
'content-type': "application/x-www-form-urlencoded",
|
||||||
|
'xweb_xhr': "1",
|
||||||
|
'unique_identity': "b78effb9-789e-416c-8e2b-84f7d9dadbb6",
|
||||||
|
'sec-fetch-site': "cross-site",
|
||||||
|
'sec-fetch-mode': "cors",
|
||||||
|
'sec-fetch-dest': "empty",
|
||||||
|
'referer': "https://servicewechat.com/wxd79ec05386a78727/86/page-frame.html",
|
||||||
|
'accept-language': "zh-CN,zh;q=0.9"
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
def get_apitokens():
|
||||||
|
tokenString = os.getenv("nfsq")
|
||||||
|
if not tokenString:
|
||||||
|
print('没有配置nfsq')
|
||||||
|
exit()
|
||||||
|
return tokenString.split("#")
|
||||||
|
|
||||||
|
|
||||||
|
def make_request(method, url, headers=None, params=None, json_data=None):
|
||||||
|
try:
|
||||||
|
if method == 'GET':
|
||||||
|
response = requests.get(url, headers=headers, params=params)
|
||||||
|
elif method == 'POST':
|
||||||
|
response = requests.post(url, headers=headers, json=json_data)
|
||||||
|
response.raise_for_status() # Check for HTTP errors
|
||||||
|
return response.json()
|
||||||
|
except requests.RequestException as e:
|
||||||
|
print(f"请求错误: {e}")
|
||||||
|
return None
|
||||||
|
|
||||||
|
|
||||||
|
def login(apitoken):
|
||||||
|
headers = {**HEADERS, 'apitoken': apitoken}
|
||||||
|
response = make_request('GET', USER_INFO_URL, headers=headers)
|
||||||
|
|
||||||
|
# 检查 token 是否失效
|
||||||
|
if response is None or (response and response.get('code') == 401): # 假设 401 表示未授权,即 token 失效
|
||||||
|
print(f"Token '{apitoken}' 失效,请检查!")
|
||||||
|
return None, None
|
||||||
|
|
||||||
|
if response and 'data' in response:
|
||||||
|
data = response['data']
|
||||||
|
return data['user_no'], data['nick_name']
|
||||||
|
return None, None
|
||||||
|
|
||||||
|
|
||||||
|
def get_task_list(apitoken):
|
||||||
|
headers = {**HEADERS, 'apitoken': apitoken}
|
||||||
|
params = {'pageNum': '1', 'pageSize': '10', 'task_status': '2', 'status': '1', 'group_id': '24121016331837'}
|
||||||
|
response = make_request('GET', TASK_LIST_URL, headers=headers, params=params)
|
||||||
|
return response['data'] if response else []
|
||||||
|
|
||||||
|
|
||||||
|
def do_task(taskId, apitoken):
|
||||||
|
headers = {**HEADERS, 'apitoken': apitoken}
|
||||||
|
params = {'action_time': datetime.now().strftime('%Y-%m-%d %H:%M:%S'), 'task_id': taskId}
|
||||||
|
response = make_request('GET', JOIN_TASK_URL, headers=headers, params=params)
|
||||||
|
print(response)
|
||||||
|
|
||||||
|
|
||||||
|
def lottery(apitoken):
|
||||||
|
payload = {
|
||||||
|
"code": "SCENE-24121018362724",
|
||||||
|
"provice_name": "上海市",
|
||||||
|
"city_name": "上海市",
|
||||||
|
"area_name": "浦东新区",
|
||||||
|
"address": "上海市浦东新区东方路121号",
|
||||||
|
"longitude": 121.520630,
|
||||||
|
"dimension": 31.239136
|
||||||
|
}
|
||||||
|
headers = {**HEADERS, 'apitoken': apitoken, 'Content-Type': "application/json"}
|
||||||
|
response = make_request('POST', LOTTERY_URL, headers=headers, json_data=payload)
|
||||||
|
return response
|
||||||
|
|
||||||
|
|
||||||
|
def marketing_lottery(apitoken, code):
|
||||||
|
payload = {
|
||||||
|
"code": code,
|
||||||
|
"provice_name": "上海市",
|
||||||
|
"city_name": "上海市",
|
||||||
|
"area_name": "浦东新区",
|
||||||
|
"address": "上海市浦东新区东方路121号",
|
||||||
|
"longitude": 121.520630,
|
||||||
|
"dimension": 31.239136
|
||||||
|
}
|
||||||
|
headers = {**HEADERS, 'apitoken': apitoken, 'Content-Type': "application/json"}
|
||||||
|
response = make_request('POST', MARKETING_LOTTERY_URL, headers=headers, json_data=payload)
|
||||||
|
if response and response['code'] == 500:
|
||||||
|
print(response['msg'])
|
||||||
|
elif response and 'data' in response:
|
||||||
|
print(response['data']['prizedto']['prize_name'])
|
||||||
|
|
||||||
|
|
||||||
|
def today_count(apitoken):
|
||||||
|
params = {'act_code': "ACT2412101428048"}
|
||||||
|
headers = {**HEADERS, 'apitoken': apitoken}
|
||||||
|
response = make_request('GET', TODAY_COUNT_URL, headers=headers, params=params)
|
||||||
|
return response['data'] if response else 0
|
||||||
|
|
||||||
|
|
||||||
|
def goods_simple(apitoken):
|
||||||
|
params = {'act_codes': "ACT2412101428048,ACT24121014352835,ACT24121014371732"}
|
||||||
|
headers = {**HEADERS, 'apitoken': apitoken}
|
||||||
|
response = make_request('GET', GOODS_SIMPLE_URL, headers=headers, params=params)
|
||||||
|
return response['data'] if response else []
|
||||||
|
|
||||||
|
|
||||||
|
def process_account(apitoken):
|
||||||
|
user_no, nick_name = login(apitoken)
|
||||||
|
|
||||||
|
# 增加检查,如果 token 失效则直接跳过
|
||||||
|
if user_no is None and nick_name is None:
|
||||||
|
return
|
||||||
|
|
||||||
|
print(f"============账号nick_name:{nick_name or user_no}============")
|
||||||
|
|
||||||
|
everydata_counted = today_count(apitoken)
|
||||||
|
print("每日赠送抽奖", f"[{everydata_counted}/3]")
|
||||||
|
|
||||||
|
if everydata_counted < 3:
|
||||||
|
code = "SCENE-24121018345681"
|
||||||
|
for _ in range(3 - everydata_counted):
|
||||||
|
marketing_lottery(apitoken, code)
|
||||||
|
time.sleep(1)
|
||||||
|
|
||||||
|
task_list = get_task_list(apitoken)
|
||||||
|
print("======执行任务======")
|
||||||
|
for task in task_list:
|
||||||
|
task_name = task["name"]
|
||||||
|
task_status = task["complete_status"]
|
||||||
|
task_id = task['id']
|
||||||
|
allow_complete_count = task["allow_complete_count"]
|
||||||
|
complete_count = task["complete_count"]
|
||||||
|
|
||||||
|
if task_status == 1:
|
||||||
|
print(f"{task_name} 已完成,跳过")
|
||||||
|
else:
|
||||||
|
print(f"开始 {task_name} [{complete_count}/{allow_complete_count}]")
|
||||||
|
for _ in range(allow_complete_count - complete_count):
|
||||||
|
do_task(task_id, apitoken)
|
||||||
|
time.sleep(1)
|
||||||
|
|
||||||
|
print("时来运转游戏")
|
||||||
|
for _ in range(3):
|
||||||
|
lottery_mes = lottery(apitoken)
|
||||||
|
if lottery_mes and lottery_mes["success"] == False:
|
||||||
|
print(lottery_mes['msg'])
|
||||||
|
break
|
||||||
|
else:
|
||||||
|
print(lottery_mes['data'] if lottery_mes else "请求失败")
|
||||||
|
time.sleep(1)
|
||||||
|
|
||||||
|
print("======任务完成情况======")
|
||||||
|
for task in task_list:
|
||||||
|
task_name = task["name"]
|
||||||
|
task_status = task["complete_status"]
|
||||||
|
complete_count = task["complete_count"]
|
||||||
|
allow_complete_count = task["allow_complete_count"]
|
||||||
|
print(f"[{'√' if task_status == 1 else '×'}] {task_name} [{complete_count}/{allow_complete_count}]")
|
||||||
|
|
||||||
|
print("======查询奖品======")
|
||||||
|
goods_list = goods_simple(apitoken)
|
||||||
|
for good in goods_list:
|
||||||
|
if good.get("win_goods_sub_type"):
|
||||||
|
print(good["win_goods_name"])
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
apitoken_list = get_apitokens()
|
||||||
|
for apitoken in apitoken_list:
|
||||||
|
process_account(apitoken)
|
||||||
680
味道馆.js
680
味道馆.js
@@ -1,680 +0,0 @@
|
|||||||
/*
|
|
||||||
小程序:味道馆
|
|
||||||
抓包域名ksf.plscn.com
|
|
||||||
查看encryptsessionid
|
|
||||||
export weidaohd=''
|
|
||||||
多号@或换行
|
|
||||||
*/
|
|
||||||
|
|
||||||
const $ = new Env('味道馆');
|
|
||||||
const axios = require('axios');
|
|
||||||
let request = require("request");
|
|
||||||
request = request.defaults({
|
|
||||||
jar: true
|
|
||||||
});
|
|
||||||
const {
|
|
||||||
log
|
|
||||||
} = console;
|
|
||||||
const Notify = 1; //0为关闭通知,1为打开通知,默认为1
|
|
||||||
const debug = 0; //0为关闭调试,1为打开调试,默认为0
|
|
||||||
|
|
||||||
let weidaohd = ($.isNode() ? process.env.weidaohd : $.getdata("weidaohd")) || ""
|
|
||||||
let weidaohdArr = [];
|
|
||||||
let data = '';
|
|
||||||
let msg = '';
|
|
||||||
var hours = new Date().getMonth();
|
|
||||||
var nian = new Date().getFullYear();
|
|
||||||
var day = new Date().getDate();
|
|
||||||
var yue = new Date().getMonth()+1;
|
|
||||||
var today = nian+'-'+yue+'-'+day
|
|
||||||
var timestamp = Math.round(new Date().getTime()).toString();
|
|
||||||
!(async () => {
|
|
||||||
if (typeof $request !== "undefined") {
|
|
||||||
await GetRewrite();
|
|
||||||
} else {
|
|
||||||
if (!(await Envs()))
|
|
||||||
return;
|
|
||||||
else {
|
|
||||||
|
|
||||||
log(`\n\n============================================= \n脚本执行 - 北京时间(UTC+8):${new Date(
|
|
||||||
new Date().getTime() + new Date().getTimezoneOffset() * 60 * 1000 +
|
|
||||||
8 * 60 * 60 * 1000).toLocaleString()} \n=============================================\n`);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
log(`\n============ 微信公众号:柠檬玩机交流 ============`)
|
|
||||||
log(`\n=================== 共找到 ${weidaohdArr.length} 个账号 ===================`)
|
|
||||||
if (debug) {
|
|
||||||
log(`【debug】 这是你的全部账号数组:\n ${weidaohdArr}`);
|
|
||||||
}
|
|
||||||
for (let index = 0; index < weidaohdArr.length; index++) {
|
|
||||||
|
|
||||||
let num = index + 1
|
|
||||||
addNotifyStr(`\n==== 开始【第 ${num} 个账号】====\n`, true)
|
|
||||||
|
|
||||||
weidaohd = weidaohdArr[index];
|
|
||||||
|
|
||||||
await req('vip/getinfo','itemid=1189&encryptsessionid='+weidaohd+'&qr=0×tamp='+timestamp+'&versionid=1.1.0')
|
|
||||||
if(res)
|
|
||||||
log('叼毛:'+res.result.vipname)
|
|
||||||
log('积分:'+res.result.vipbonus)
|
|
||||||
await req('bonus/signin','pageid=733&signday='+today+'&encryptsessionid='+weidaohd+'&qr=0×tamp='+timestamp+'&versionid=1.1.0')
|
|
||||||
if(res.result.currentsignbonus)
|
|
||||||
log('获得:'+res.result.currentsignbonus)
|
|
||||||
for(let i=0;i<2;i++){
|
|
||||||
await req('wxa/getarticleinfo','articleid=1794&encryptsessionid='+weidaohd+'&qr=0×tamp='+timestamp+'&versionid=1.1.0')
|
|
||||||
if(res)
|
|
||||||
log(res.result.title+res.result.subtitle)
|
|
||||||
await $.wait(11000)
|
|
||||||
await req('bonus/sendreadbonus','gameid=73&encryptsessionid='+weidaohd+'&qr=0×tamp='+timestamp+'&versionid=1.1.0')
|
|
||||||
if(res.errmsg)
|
|
||||||
log(res.errmsg)
|
|
||||||
await req('wxa/onitemevt','event=viewvideo&type=start&linkid=0&articleid=835&itemid=1010&encryptsessionid='+weidaohd+'&qr=0×tamp='+timestamp+'&versionid=1.1.0')
|
|
||||||
if(res)
|
|
||||||
log(res)
|
|
||||||
await $.wait(15000)
|
|
||||||
await req('wxa/onitemevt','event=viewvideo&type=ended&linkid=0&articleid=835&itemid=1010&encryptsessionid='+weidaohd+'&qr=0×tamp='+timestamp+'&versionid=1.1.0')
|
|
||||||
if(res)
|
|
||||||
log(res)
|
|
||||||
}
|
|
||||||
await req('bonus/getbywxstep','itemid=985&encryptsessionid='+weidaohd+'&qr=0×tamp='+timestamp+'&versionid=1.1.0')
|
|
||||||
if(res)
|
|
||||||
log(res)
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
//await SendMsg(msg);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})()
|
|
||||||
.catch((e) => log(e))
|
|
||||||
.finally(() => $.done())
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
async function req(api,bodys) {
|
|
||||||
return new Promise((resolve) => {
|
|
||||||
var options = {
|
|
||||||
method: 'POST',
|
|
||||||
url: 'https://ksf.plscn.com/brandwxa/api/'+api,
|
|
||||||
headers: {
|
|
||||||
'Host': 'ksf.plscn.com',
|
|
||||||
//Connection: 'keep-alive',
|
|
||||||
'x-account-key': 'd3hiNmQ5M2Q3YWY5M2YzMWRh',
|
|
||||||
'xweb_xhr': '1',
|
|
||||||
'user-agent': 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.138 Safari/537.36 MicroMessenger/7.0.4.501 NetType/WIFI MiniProgramEnv/Windows WindowsWechat/WMPF',
|
|
||||||
'x-account-sign': r(stringtojson(bodys)),
|
|
||||||
'Content-Type': 'application/x-www-form-urlencoded',
|
|
||||||
Accept: '*/*',
|
|
||||||
'Sec-Fetch-Site': 'cross-site',
|
|
||||||
'Sec-Fetch-Mode': 'cors',
|
|
||||||
'Sec-Fetch-Dest': 'empty',
|
|
||||||
Referer: 'https://servicewechat.com/wxb6d93d7af93f31da/81/page-frame.html',
|
|
||||||
'Accept-Language': 'en-us,en',
|
|
||||||
'Cache-Control': 'no-cache',
|
|
||||||
'Accept-Encoding': 'gzip, deflate',
|
|
||||||
},
|
|
||||||
data: bodys
|
|
||||||
};
|
|
||||||
if (debug) {
|
|
||||||
log(`\n【debug】=============== 这是 请求 url ===============`);
|
|
||||||
log(JSON.stringify(options));
|
|
||||||
}
|
|
||||||
|
|
||||||
axios.request(options).then(async function(response) {
|
|
||||||
try {
|
|
||||||
data = response.data;
|
|
||||||
if (debug) {
|
|
||||||
log(`\n\n【debug】===============这是 返回data==============`);
|
|
||||||
log(data)
|
|
||||||
}
|
|
||||||
if (data.errcode == 0) {
|
|
||||||
res = data
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
} catch (e) {
|
|
||||||
log(`异常:${data},原因:${data}`)
|
|
||||||
}
|
|
||||||
}).catch(function(error) {
|
|
||||||
console.error(data);
|
|
||||||
}).then(res => {
|
|
||||||
//这里处理正确返回
|
|
||||||
resolve();
|
|
||||||
});
|
|
||||||
})
|
|
||||||
|
|
||||||
}
|
|
||||||
!function(n) {
|
|
||||||
function r(n, r) {
|
|
||||||
var t = (65535 & n) + (65535 & r);
|
|
||||||
return (n >> 16) + (r >> 16) + (t >> 16) << 16 | 65535 & t;
|
|
||||||
}
|
|
||||||
function t(n, t, e, o, u, c) {
|
|
||||||
return r((f = r(r(t, n), r(o, c))) << (i = u) | f >>> 32 - i, e);
|
|
||||||
var f, i;
|
|
||||||
}
|
|
||||||
function e(n, r, e, o, u, c, f) {
|
|
||||||
return t(r & e | ~r & o, n, r, u, c, f);
|
|
||||||
}
|
|
||||||
function o(n, r, e, o, u, c, f) {
|
|
||||||
return t(r & o | e & ~o, n, r, u, c, f);
|
|
||||||
}
|
|
||||||
function u(n, r, e, o, u, c, f) {
|
|
||||||
return t(r ^ e ^ o, n, r, u, c, f);
|
|
||||||
}
|
|
||||||
function c(n, r, e, o, u, c, f) {
|
|
||||||
return t(e ^ (r | ~o), n, r, u, c, f);
|
|
||||||
}
|
|
||||||
function f(n, t) {
|
|
||||||
var f, i, a, h, g;
|
|
||||||
n[t >> 5] |= 128 << t % 32, n[14 + (t + 64 >>> 9 << 4)] = t;
|
|
||||||
var l = 1732584193, v = -271733879, d = -1732584194, C = 271733878;
|
|
||||||
for (f = 0; f < n.length; f += 16) i = l, a = v, h = d, g = C, l = e(l, v, d, C, n[f], 7, -680876936),
|
|
||||||
C = e(C, l, v, d, n[f + 1], 12, -389564586), d = e(d, C, l, v, n[f + 2], 17, 606105819),
|
|
||||||
v = e(v, d, C, l, n[f + 3], 22, -1044525330), l = e(l, v, d, C, n[f + 4], 7, -176418897),
|
|
||||||
C = e(C, l, v, d, n[f + 5], 12, 1200080426), d = e(d, C, l, v, n[f + 6], 17, -1473231341),
|
|
||||||
v = e(v, d, C, l, n[f + 7], 22, -45705983), l = e(l, v, d, C, n[f + 8], 7, 1770035416),
|
|
||||||
C = e(C, l, v, d, n[f + 9], 12, -1958414417), d = e(d, C, l, v, n[f + 10], 17, -42063),
|
|
||||||
v = e(v, d, C, l, n[f + 11], 22, -1990404162), l = e(l, v, d, C, n[f + 12], 7, 1804603682),
|
|
||||||
C = e(C, l, v, d, n[f + 13], 12, -40341101), d = e(d, C, l, v, n[f + 14], 17, -1502002290),
|
|
||||||
l = o(l, v = e(v, d, C, l, n[f + 15], 22, 1236535329), d, C, n[f + 1], 5, -165796510),
|
|
||||||
C = o(C, l, v, d, n[f + 6], 9, -1069501632), d = o(d, C, l, v, n[f + 11], 14, 643717713),
|
|
||||||
v = o(v, d, C, l, n[f], 20, -373897302), l = o(l, v, d, C, n[f + 5], 5, -701558691),
|
|
||||||
C = o(C, l, v, d, n[f + 10], 9, 38016083), d = o(d, C, l, v, n[f + 15], 14, -660478335),
|
|
||||||
v = o(v, d, C, l, n[f + 4], 20, -405537848), l = o(l, v, d, C, n[f + 9], 5, 568446438),
|
|
||||||
C = o(C, l, v, d, n[f + 14], 9, -1019803690), d = o(d, C, l, v, n[f + 3], 14, -187363961),
|
|
||||||
v = o(v, d, C, l, n[f + 8], 20, 1163531501), l = o(l, v, d, C, n[f + 13], 5, -1444681467),
|
|
||||||
C = o(C, l, v, d, n[f + 2], 9, -51403784), d = o(d, C, l, v, n[f + 7], 14, 1735328473),
|
|
||||||
l = u(l, v = o(v, d, C, l, n[f + 12], 20, -1926607734), d, C, n[f + 5], 4, -378558),
|
|
||||||
C = u(C, l, v, d, n[f + 8], 11, -2022574463), d = u(d, C, l, v, n[f + 11], 16, 1839030562),
|
|
||||||
v = u(v, d, C, l, n[f + 14], 23, -35309556), l = u(l, v, d, C, n[f + 1], 4, -1530992060),
|
|
||||||
C = u(C, l, v, d, n[f + 4], 11, 1272893353), d = u(d, C, l, v, n[f + 7], 16, -155497632),
|
|
||||||
v = u(v, d, C, l, n[f + 10], 23, -1094730640), l = u(l, v, d, C, n[f + 13], 4, 681279174),
|
|
||||||
C = u(C, l, v, d, n[f], 11, -358537222), d = u(d, C, l, v, n[f + 3], 16, -722521979),
|
|
||||||
v = u(v, d, C, l, n[f + 6], 23, 76029189), l = u(l, v, d, C, n[f + 9], 4, -640364487),
|
|
||||||
C = u(C, l, v, d, n[f + 12], 11, -421815835), d = u(d, C, l, v, n[f + 15], 16, 530742520),
|
|
||||||
l = c(l, v = u(v, d, C, l, n[f + 2], 23, -995338651), d, C, n[f], 6, -198630844),
|
|
||||||
C = c(C, l, v, d, n[f + 7], 10, 1126891415), d = c(d, C, l, v, n[f + 14], 15, -1416354905),
|
|
||||||
v = c(v, d, C, l, n[f + 5], 21, -57434055), l = c(l, v, d, C, n[f + 12], 6, 1700485571),
|
|
||||||
C = c(C, l, v, d, n[f + 3], 10, -1894986606), d = c(d, C, l, v, n[f + 10], 15, -1051523),
|
|
||||||
v = c(v, d, C, l, n[f + 1], 21, -2054922799), l = c(l, v, d, C, n[f + 8], 6, 1873313359),
|
|
||||||
C = c(C, l, v, d, n[f + 15], 10, -30611744), d = c(d, C, l, v, n[f + 6], 15, -1560198380),
|
|
||||||
v = c(v, d, C, l, n[f + 13], 21, 1309151649), l = c(l, v, d, C, n[f + 4], 6, -145523070),
|
|
||||||
C = c(C, l, v, d, n[f + 11], 10, -1120210379), d = c(d, C, l, v, n[f + 2], 15, 718787259),
|
|
||||||
v = c(v, d, C, l, n[f + 9], 21, -343485551), l = r(l, i), v = r(v, a), d = r(d, h),
|
|
||||||
C = r(C, g);
|
|
||||||
return [ l, v, d, C ];
|
|
||||||
}
|
|
||||||
function i(n) {
|
|
||||||
var r, t = "", e = 32 * n.length;
|
|
||||||
for (r = 0; r < e; r += 8) t += String.fromCharCode(n[r >> 5] >>> r % 32 & 255);
|
|
||||||
return t;
|
|
||||||
}
|
|
||||||
function a(n) {
|
|
||||||
var r, t = [];
|
|
||||||
for (t[(n.length >> 2) - 1] = void 0, r = 0; r < t.length; r += 1) t[r] = 0;
|
|
||||||
var e = 8 * n.length;
|
|
||||||
for (r = 0; r < e; r += 8) t[r >> 5] |= (255 & n.charCodeAt(r / 8)) << r % 32;
|
|
||||||
return t;
|
|
||||||
}
|
|
||||||
function h(n) {
|
|
||||||
var r, t, e = "";
|
|
||||||
for (t = 0; t < n.length; t += 1) r = n.charCodeAt(t), e += "0123456789abcdef".charAt(r >>> 4 & 15) + "0123456789abcdef".charAt(15 & r);
|
|
||||||
return e;
|
|
||||||
}
|
|
||||||
function g(n) {
|
|
||||||
return unescape(encodeURIComponent(n));
|
|
||||||
}
|
|
||||||
function l(n) {
|
|
||||||
return function(n) {
|
|
||||||
return i(f(a(n), 8 * n.length));
|
|
||||||
}(g(n));
|
|
||||||
}
|
|
||||||
function v(n, r) {
|
|
||||||
return function(n, r) {
|
|
||||||
var t, e, o = a(n), u = [], c = [];
|
|
||||||
for (u[15] = c[15] = void 0, o.length > 16 && (o = f(o, 8 * n.length)), t = 0; t < 16; t += 1) u[t] = 909522486 ^ o[t],
|
|
||||||
c[t] = 1549556828 ^ o[t];
|
|
||||||
return e = f(u.concat(a(r)), 512 + 8 * r.length), i(f(c.concat(e), 640));
|
|
||||||
}(g(n), g(r));
|
|
||||||
}
|
|
||||||
md5 = function(n, r, t) {
|
|
||||||
return r ? t ? v(r, n) : h(v(r, n)) : t ? l(n) : h(l(n));
|
|
||||||
};
|
|
||||||
}();
|
|
||||||
|
|
||||||
r = function(e) {
|
|
||||||
var n = [];
|
|
||||||
for (var t in e) n.push(e[t]);
|
|
||||||
var o = "wxb6d93d7af93f31da" + "wa_smartgo", i = n.sort(), r = "";
|
|
||||||
for (var t in i) r += "" + n[t];
|
|
||||||
return r += o, md5(r);
|
|
||||||
}
|
|
||||||
function stringtojson(str) {
|
|
||||||
str1 = str.replace(/=/g, "\":\"");
|
|
||||||
str2 = str1.replace(/&/g, "\",\"");
|
|
||||||
str3 = '{"' + str2 + '"}'
|
|
||||||
|
|
||||||
return eval('(' + str3 + ')')
|
|
||||||
|
|
||||||
}
|
|
||||||
async function Envs() {
|
|
||||||
if (weidaohd) {
|
|
||||||
if (weidaohd.indexOf("@") != -1) {
|
|
||||||
weidaohd.split("@").forEach((item) => {
|
|
||||||
|
|
||||||
weidaohdArr.push(item);
|
|
||||||
});
|
|
||||||
} else if (weidaohd.indexOf("\n") != -1) {
|
|
||||||
weidaohd.split("\n").forEach((item) => {
|
|
||||||
weidaohdArr.push(item);
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
weidaohdArr.push(weidaohd);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
log(`\n 【${$.name}】:未填写变量 weidaohd`)
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
function addNotifyStr(str, is_log = true) {
|
|
||||||
if (is_log) {
|
|
||||||
log(`${str}\n`)
|
|
||||||
}
|
|
||||||
msg += `${str}\n`
|
|
||||||
}
|
|
||||||
|
|
||||||
// ============================================发送消息============================================ \\
|
|
||||||
async function SendMsg(message) {
|
|
||||||
if (!message)
|
|
||||||
return;
|
|
||||||
|
|
||||||
if (Notify > 0) {
|
|
||||||
if ($.isNode()) {
|
|
||||||
var notify = require('./sendNotify');
|
|
||||||
await notify.sendNotify($.name, message);
|
|
||||||
} else {
|
|
||||||
$.msg(message);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
log(message);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
function Env(t, e) {
|
|
||||||
"undefined" != typeof process && JSON.stringify(process.env).indexOf("GITHUB") > -1 && process.exit(0);
|
|
||||||
|
|
||||||
class s {
|
|
||||||
constructor(t) {
|
|
||||||
this.env = t
|
|
||||||
}
|
|
||||||
|
|
||||||
send(t, e = "GET") {
|
|
||||||
t = "string" == typeof t ? {
|
|
||||||
url: t
|
|
||||||
} : t;
|
|
||||||
let s = this.get;
|
|
||||||
return "POST" === e && (s = this.post), new Promise((e, i) => {
|
|
||||||
s.call(this, t, (t, s, r) => {
|
|
||||||
t ? i(t) : e(s)
|
|
||||||
})
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
get(t) {
|
|
||||||
return this.send.call(this.env, t)
|
|
||||||
}
|
|
||||||
|
|
||||||
post(t) {
|
|
||||||
return this.send.call(this.env, t, "POST")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return new class {
|
|
||||||
constructor(t, e) {
|
|
||||||
this.name = t, this.http = new s(this), this.data = null, this.dataFile = "box.dat", this.logs = [], this.isMute = !1, this.isNeedRewrite = !1, this.logSeparator = "\n", this.startTime = (new Date).getTime(), Object.assign(this, e), this.log("", `🔔${this.name}, 开始!`)
|
|
||||||
}
|
|
||||||
|
|
||||||
isNode() {
|
|
||||||
return "undefined" != typeof module && !!module.exports
|
|
||||||
}
|
|
||||||
|
|
||||||
isQuanX() {
|
|
||||||
return "undefined" != typeof $task
|
|
||||||
}
|
|
||||||
|
|
||||||
isSurge() {
|
|
||||||
return "undefined" != typeof $httpClient && "undefined" == typeof $loon
|
|
||||||
}
|
|
||||||
|
|
||||||
isLoon() {
|
|
||||||
return "undefined" != typeof $loon
|
|
||||||
}
|
|
||||||
|
|
||||||
toObj(t, e = null) {
|
|
||||||
try {
|
|
||||||
return JSON.parse(t)
|
|
||||||
} catch {
|
|
||||||
return e
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
toStr(t, e = null) {
|
|
||||||
try {
|
|
||||||
return JSON.stringify(t)
|
|
||||||
} catch {
|
|
||||||
return e
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
getjson(t, e) {
|
|
||||||
let s = e;
|
|
||||||
const i = this.getdata(t);
|
|
||||||
if (i) try {
|
|
||||||
s = JSON.parse(this.getdata(t))
|
|
||||||
} catch {}
|
|
||||||
return s
|
|
||||||
}
|
|
||||||
|
|
||||||
setjson(t, e) {
|
|
||||||
try {
|
|
||||||
return this.setdata(JSON.stringify(t), e)
|
|
||||||
} catch {
|
|
||||||
return !1
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
getScript(t) {
|
|
||||||
return new Promise(e => {
|
|
||||||
this.get({
|
|
||||||
url: t
|
|
||||||
}, (t, s, i) => e(i))
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
runScript(t, e) {
|
|
||||||
return new Promise(s => {
|
|
||||||
let i = this.getdata("@chavy_boxjs_userCfgs.httpapi");
|
|
||||||
i = i ? i.replace(/\n/g, "").trim() : i;
|
|
||||||
let r = this.getdata("@chavy_boxjs_userCfgs.httpapi_timeout");
|
|
||||||
r = r ? 1 * r : 20, r = e && e.timeout ? e.timeout : r;
|
|
||||||
const [o, h] = i.split("@"), n = {
|
|
||||||
url: `http://${h}/v1/scripting/evaluate`,
|
|
||||||
body: {
|
|
||||||
script_text: t,
|
|
||||||
mock_type: "cron",
|
|
||||||
timeout: r
|
|
||||||
},
|
|
||||||
headers: {
|
|
||||||
"X-Key": o,
|
|
||||||
Accept: "*/*"
|
|
||||||
}
|
|
||||||
};
|
|
||||||
this.post(n, (t, e, i) => s(i))
|
|
||||||
}).catch(t => this.logErr(t))
|
|
||||||
}
|
|
||||||
|
|
||||||
loaddata() {
|
|
||||||
if (!this.isNode()) return {}; {
|
|
||||||
this.fs = this.fs ? this.fs : require("fs"), this.path = this.path ? this.path : require("path");
|
|
||||||
const t = this.path.resolve(this.dataFile),
|
|
||||||
e = this.path.resolve(process.cwd(), this.dataFile),
|
|
||||||
s = this.fs.existsSync(t),
|
|
||||||
i = !s && this.fs.existsSync(e);
|
|
||||||
if (!s && !i) return {}; {
|
|
||||||
const i = s ? t : e;
|
|
||||||
try {
|
|
||||||
return JSON.parse(this.fs.readFileSync(i))
|
|
||||||
} catch (t) {
|
|
||||||
return {}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
writedata() {
|
|
||||||
if (this.isNode()) {
|
|
||||||
this.fs = this.fs ? this.fs : require("fs"), this.path = this.path ? this.path : require("path");
|
|
||||||
const t = this.path.resolve(this.dataFile),
|
|
||||||
e = this.path.resolve(process.cwd(), this.dataFile),
|
|
||||||
s = this.fs.existsSync(t),
|
|
||||||
i = !s && this.fs.existsSync(e),
|
|
||||||
r = JSON.stringify(this.data);
|
|
||||||
s ? this.fs.writeFileSync(t, r) : i ? this.fs.writeFileSync(e, r) : this.fs.writeFileSync(t, r)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
lodash_get(t, e, s) {
|
|
||||||
const i = e.replace(/\[(\d+)\]/g, ".$1").split(".");
|
|
||||||
let r = t;
|
|
||||||
for (const t of i)
|
|
||||||
if (r = Object(r)[t], void 0 === r) return s;
|
|
||||||
return r
|
|
||||||
}
|
|
||||||
|
|
||||||
lodash_set(t, e, s) {
|
|
||||||
return Object(t) !== t ? t : (Array.isArray(e) || (e = e.toString().match(/[^.[\]]+/g) || []), e.slice(0, -1).reduce((t, s, i) => Object(t[s]) === t[s] ? t[s] : t[s] = Math.abs(e[i + 1]) >> 0 == +e[i + 1] ? [] : {}, t)[e[e.length - 1]] = s, t)
|
|
||||||
}
|
|
||||||
|
|
||||||
getdata(t) {
|
|
||||||
let e = this.getval(t);
|
|
||||||
if (/^@/.test(t)) {
|
|
||||||
const [, s, i] = /^@(.*?)\.(.*?)$/.exec(t), r = s ? this.getval(s) : "";
|
|
||||||
if (r) try {
|
|
||||||
const t = JSON.parse(r);
|
|
||||||
e = t ? this.lodash_get(t, i, "") : e
|
|
||||||
} catch (t) {
|
|
||||||
e = ""
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return e
|
|
||||||
}
|
|
||||||
|
|
||||||
setdata(t, e) {
|
|
||||||
let s = !1;
|
|
||||||
if (/^@/.test(e)) {
|
|
||||||
const [, i, r] = /^@(.*?)\.(.*?)$/.exec(e), o = this.getval(i),
|
|
||||||
h = i ? "null" === o ? null : o || "{}" : "{}";
|
|
||||||
try {
|
|
||||||
const e = JSON.parse(h);
|
|
||||||
this.lodash_set(e, r, t), s = this.setval(JSON.stringify(e), i)
|
|
||||||
} catch (e) {
|
|
||||||
const o = {};
|
|
||||||
this.lodash_set(o, r, t), s = this.setval(JSON.stringify(o), i)
|
|
||||||
}
|
|
||||||
} else s = this.setval(t, e);
|
|
||||||
return s
|
|
||||||
}
|
|
||||||
|
|
||||||
getval(t) {
|
|
||||||
return this.isSurge() || this.isLoon() ? $persistentStore.read(t) : this.isQuanX() ? $prefs.valueForKey(t) : this.isNode() ? (this.data = this.loaddata(), this.data[t]) : this.data && this.data[t] || null
|
|
||||||
}
|
|
||||||
|
|
||||||
setval(t, e) {
|
|
||||||
return this.isSurge() || this.isLoon() ? $persistentStore.write(t, e) : this.isQuanX() ? $prefs.setValueForKey(t, e) : this.isNode() ? (this.data = this.loaddata(), this.data[e] = t, this.writedata(), !0) : this.data && this.data[e] || null
|
|
||||||
}
|
|
||||||
|
|
||||||
initGotEnv(t) {
|
|
||||||
this.got = this.got ? this.got : require("got"), this.cktough = this.cktough ? this.cktough : require("tough-cookie"), this.ckjar = this.ckjar ? this.ckjar : new this.cktough.CookieJar, t && (t.headers = t.headers ? t.headers : {}, void 0 === t.headers.Cookie && void 0 === t.cookieJar && (t.cookieJar = this.ckjar))
|
|
||||||
}
|
|
||||||
|
|
||||||
get(t, e = (() => {})) {
|
|
||||||
t.headers && (delete t.headers["Content-Type"], delete t.headers["Content-Length"]), this.isSurge() || this.isLoon() ? (this.isSurge() && this.isNeedRewrite && (t.headers = t.headers || {}, Object.assign(t.headers, {
|
|
||||||
"X-Surge-Skip-Scripting": !1
|
|
||||||
})), $httpClient.get(t, (t, s, i) => {
|
|
||||||
!t && s && (s.body = i, s.statusCode = s.status), e(t, s, i)
|
|
||||||
})) : this.isQuanX() ? (this.isNeedRewrite && (t.opts = t.opts || {}, Object.assign(t.opts, {
|
|
||||||
hints: !1
|
|
||||||
})), $task.fetch(t).then(t => {
|
|
||||||
const {
|
|
||||||
statusCode: s,
|
|
||||||
statusCode: i,
|
|
||||||
headers: r,
|
|
||||||
body: o
|
|
||||||
} = t;
|
|
||||||
e(null, {
|
|
||||||
status: s,
|
|
||||||
statusCode: i,
|
|
||||||
headers: r,
|
|
||||||
body: o
|
|
||||||
}, o)
|
|
||||||
}, t => e(t))) : this.isNode() && (this.initGotEnv(t), this.got(t).on("redirect", (t, e) => {
|
|
||||||
try {
|
|
||||||
if (t.headers["set-cookie"]) {
|
|
||||||
const s = t.headers["set-cookie"].map(this.cktough.Cookie.parse).toString();
|
|
||||||
s && this.ckjar.setCookieSync(s, null), e.cookieJar = this.ckjar
|
|
||||||
}
|
|
||||||
} catch (t) {
|
|
||||||
this.logErr(t)
|
|
||||||
}
|
|
||||||
}).then(t => {
|
|
||||||
const {
|
|
||||||
statusCode: s,
|
|
||||||
statusCode: i,
|
|
||||||
headers: r,
|
|
||||||
body: o
|
|
||||||
} = t;
|
|
||||||
e(null, {
|
|
||||||
status: s,
|
|
||||||
statusCode: i,
|
|
||||||
headers: r,
|
|
||||||
body: o
|
|
||||||
}, o)
|
|
||||||
}, t => {
|
|
||||||
const {
|
|
||||||
message: s,
|
|
||||||
response: i
|
|
||||||
} = t;
|
|
||||||
e(s, i, i && i.body)
|
|
||||||
}))
|
|
||||||
}
|
|
||||||
|
|
||||||
post(t, e = (() => {})) {
|
|
||||||
if (t.body && t.headers && !t.headers["Content-Type"] && (t.headers["Content-Type"] = "application/x-www-form-urlencoded"), t.headers && delete t.headers["Content-Length"], this.isSurge() || this.isLoon()) this.isSurge() && this.isNeedRewrite && (t.headers = t.headers || {}, Object.assign(t.headers, {
|
|
||||||
"X-Surge-Skip-Scripting": !1
|
|
||||||
})), $httpClient.post(t, (t, s, i) => {
|
|
||||||
!t && s && (s.body = i, s.statusCode = s.status), e(t, s, i)
|
|
||||||
});
|
|
||||||
else if (this.isQuanX()) t.method = "POST", this.isNeedRewrite && (t.opts = t.opts || {}, Object.assign(t.opts, {
|
|
||||||
hints: !1
|
|
||||||
})), $task.fetch(t).then(t => {
|
|
||||||
const {
|
|
||||||
statusCode: s,
|
|
||||||
statusCode: i,
|
|
||||||
headers: r,
|
|
||||||
body: o
|
|
||||||
} = t;
|
|
||||||
e(null, {
|
|
||||||
status: s,
|
|
||||||
statusCode: i,
|
|
||||||
headers: r,
|
|
||||||
body: o
|
|
||||||
}, o)
|
|
||||||
}, t => e(t));
|
|
||||||
else if (this.isNode()) {
|
|
||||||
this.initGotEnv(t);
|
|
||||||
const {
|
|
||||||
url: s,
|
|
||||||
...i
|
|
||||||
} = t;
|
|
||||||
this.got.post(s, i).then(t => {
|
|
||||||
const {
|
|
||||||
statusCode: s,
|
|
||||||
statusCode: i,
|
|
||||||
headers: r,
|
|
||||||
body: o
|
|
||||||
} = t;
|
|
||||||
e(null, {
|
|
||||||
status: s,
|
|
||||||
statusCode: i,
|
|
||||||
headers: r,
|
|
||||||
body: o
|
|
||||||
}, o)
|
|
||||||
}, t => {
|
|
||||||
const {
|
|
||||||
message: s,
|
|
||||||
response: i
|
|
||||||
} = t;
|
|
||||||
e(s, i, i && i.body)
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
time(t, e = null) {
|
|
||||||
const s = e ? new Date(e) : new Date;
|
|
||||||
let i = {
|
|
||||||
"M+": s.getMonth() + 1,
|
|
||||||
"d+": s.getDate(),
|
|
||||||
"H+": s.getHours(),
|
|
||||||
"m+": s.getMinutes(),
|
|
||||||
"s+": s.getSeconds(),
|
|
||||||
"q+": Math.floor((s.getMonth() + 3) / 3),
|
|
||||||
S: s.getMilliseconds()
|
|
||||||
};
|
|
||||||
/(y+)/.test(t) && (t = t.replace(RegExp.$1, (s.getFullYear() + "").substr(4 - RegExp.$1.length)));
|
|
||||||
for (let e in i) new RegExp("(" + e + ")").test(t) && (t = t.replace(RegExp.$1, 1 == RegExp.$1.length ? i[e] : ("00" + i[e]).substr(("" + i[e]).length)));
|
|
||||||
return t
|
|
||||||
}
|
|
||||||
|
|
||||||
msg(e = t, s = "", i = "", r) {
|
|
||||||
const o = t => {
|
|
||||||
if (!t) return t;
|
|
||||||
if ("string" == typeof t) return this.isLoon() ? t : this.isQuanX() ? {
|
|
||||||
"open-url": t
|
|
||||||
} : this.isSurge() ? {
|
|
||||||
url: t
|
|
||||||
} : void 0;
|
|
||||||
if ("object" == typeof t) {
|
|
||||||
if (this.isLoon()) {
|
|
||||||
let e = t.openUrl || t.url || t["open-url"],
|
|
||||||
s = t.mediaUrl || t["media-url"];
|
|
||||||
return {
|
|
||||||
openUrl: e,
|
|
||||||
mediaUrl: s
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (this.isQuanX()) {
|
|
||||||
let e = t["open-url"] || t.url || t.openUrl,
|
|
||||||
s = t["media-url"] || t.mediaUrl;
|
|
||||||
return {
|
|
||||||
"open-url": e,
|
|
||||||
"media-url": s
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (this.isSurge()) {
|
|
||||||
let e = t.url || t.openUrl || t["open-url"];
|
|
||||||
return {
|
|
||||||
url: e
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
if (this.isMute || (this.isSurge() || this.isLoon() ? $notification.post(e, s, i, o(r)) : this.isQuanX() && $notify(e, s, i, o(r))), !this.isMuteLog) {
|
|
||||||
let t = ["", "==============📣系统通知📣=============="];
|
|
||||||
t.push(e), s && t.push(s), i && t.push(i), console.log(t.join("\n")), this.logs = this.logs.concat(t)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
log(...t) {
|
|
||||||
t.length > 0 && (this.logs = [...this.logs, ...t]), console.log(t.join(this.logSeparator))
|
|
||||||
}
|
|
||||||
|
|
||||||
logErr(t, e) {
|
|
||||||
const s = !this.isSurge() && !this.isQuanX() && !this.isLoon();
|
|
||||||
s ? this.log("", `❗️${this.name}, 错误!`, t.stack) : this.log("", `❗️${this.name}, 错误!`, t)
|
|
||||||
}
|
|
||||||
|
|
||||||
wait(t) {
|
|
||||||
return new Promise(e => setTimeout(e, t))
|
|
||||||
}
|
|
||||||
|
|
||||||
done(t = {}) {
|
|
||||||
const e = (new Date).getTime(),
|
|
||||||
s = (e - this.startTime) / 1e3;
|
|
||||||
this.log("", `🔔${this.name}, 结束! 🕛 ${s} 秒`), this.log(), (this.isSurge() || this.isQuanX() || this.isLoon()) && $done(t)
|
|
||||||
}
|
|
||||||
}(t, e)
|
|
||||||
}
|
|
||||||
92
福彩抽奖.py
Normal file
92
福彩抽奖.py
Normal file
@@ -0,0 +1,92 @@
|
|||||||
|
#!/usr/bin/python3
|
||||||
|
# -- coding: utf-8 --
|
||||||
|
# -------------------------------
|
||||||
|
# @Author : github@wd210010 https://github.com/wd210010/only_for_happly
|
||||||
|
# @Time : 2024/1/15 9:23
|
||||||
|
# -------------------------------
|
||||||
|
# cron "0 0 8 * * *" script-path=xxx.py,tag=匹配cron用
|
||||||
|
# const $ = new Env('福彩抽奖')
|
||||||
|
import requests,json,os,random,time
|
||||||
|
from urllib.parse import quote
|
||||||
|
|
||||||
|
#活动路径 中国福彩公众号 右下角新年活动
|
||||||
|
#手机号登录后 抓取https://ssqcx-serv.cwlo.com.cn域名下的请求头的Authorization 放入青龙变量或者放入config.sh 变量名为zgfcau 放在config.sh的话 多账号用&分割 放在青龙变量就多建几个变量
|
||||||
|
zgfcaulist =os.getenv("zgfcau").split('&')
|
||||||
|
#推送加 token
|
||||||
|
plustoken =os.getenv("plustoken")
|
||||||
|
|
||||||
|
|
||||||
|
def Push(contents):
|
||||||
|
# plustoken推送
|
||||||
|
headers = {'Content-Type': 'application/json'}
|
||||||
|
json = {"token": plustoken, 'title': '中国福彩抽奖', 'content': contents.replace('\n', '<br>'), "template": "json"}
|
||||||
|
resp = requests.post(f'http://www.pushplus.plus/send', json=json, headers=headers).json()
|
||||||
|
print('push+推送成功' if resp['code'] == 200 else 'push+推送失败')
|
||||||
|
|
||||||
|
wish = ['财运亨通','事业有成','身体健康','家庭和睦','笑口常开','步步高升','心想事成','万事如意','龙马精神','福禄双全']
|
||||||
|
wishidlist =[]
|
||||||
|
for i in range(len(zgfcaulist)):
|
||||||
|
print(f'账号{i+1}')
|
||||||
|
headers ={
|
||||||
|
'Content-Type': 'application/x-www-form-urlencoded',
|
||||||
|
'User-Agent': 'Mozilla/5.0 (iPhone; CPU iPhone OS 15_6 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 MicroMessenger/8.0.45(0x18002d2a) NetType/WIFI Language/zh_CN',
|
||||||
|
'Authorization': zgfcaulist[i],
|
||||||
|
}
|
||||||
|
data = random.choice(wish)
|
||||||
|
params = quote(data)
|
||||||
|
print('**开始发送愿望**')
|
||||||
|
try:
|
||||||
|
for j in range(3):
|
||||||
|
resp = requests.post('https://ssqcx-serv.cwlo.com.cn/api/wish/send',headers=headers,data=f'wish={params}')
|
||||||
|
result = json.loads(resp.text)
|
||||||
|
print(result['msg'])
|
||||||
|
if j == 0:
|
||||||
|
wish_id = result['data']['wish_id']
|
||||||
|
wishidlist.append(wish_id)
|
||||||
|
except:
|
||||||
|
print('该Authorization可能无效!')
|
||||||
|
print('**开始抽奖**')
|
||||||
|
try:
|
||||||
|
for i in range(3):
|
||||||
|
resp2 = requests.post('https://ssqcx-serv.cwlo.com.cn/api/lottery/start', headers=headers)
|
||||||
|
result2 = json.loads(resp2.text)
|
||||||
|
# print(result2)
|
||||||
|
success = result2['msg']
|
||||||
|
if success =='成功' and len(result2['data']['lottery_sn'])>0:
|
||||||
|
massage = f'账号{i+1}中奖了!请自行查看'
|
||||||
|
print(massage)
|
||||||
|
Push(contents=massage)
|
||||||
|
elif success =='成功' and len(result2['data']['lottery_sn'])==0:
|
||||||
|
print('未中奖')
|
||||||
|
else:
|
||||||
|
print(success)
|
||||||
|
time.sleep(2)
|
||||||
|
except:
|
||||||
|
print('该Authorization可能无效!')
|
||||||
|
print(wishidlist)
|
||||||
|
print('**开始点赞**')
|
||||||
|
for a in range(len(wishidlist)):
|
||||||
|
for b in range(len(zgfcaulist)):
|
||||||
|
headers2 = {
|
||||||
|
'Content-Type': 'application/x-www-form-urlencoded',
|
||||||
|
'User-Agent': 'Mozilla/5.0 (iPhone; CPU iPhone OS 15_6 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 MicroMessenger/8.0.45(0x18002d2a) NetType/WIFI Language/zh_CN',
|
||||||
|
'Authorization': zgfcaulist[b],
|
||||||
|
}
|
||||||
|
resp3 = requests.post('https://ssqcx-serv.cwlo.com.cn/api/wish/zan',headers=headers2,data=f'wish_id={wishidlist[a]}')
|
||||||
|
result3 = json.loads(resp3.text)
|
||||||
|
print(result3)
|
||||||
|
for c in range(len(zgfcaulist)):
|
||||||
|
headers3 = {
|
||||||
|
'Content-Type': 'application/x-www-form-urlencoded',
|
||||||
|
'User-Agent': 'Mozilla/5.0 (iPhone; CPU iPhone OS 15_6 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 MicroMessenger/8.0.45(0x18002d2a) NetType/WIFI Language/zh_CN',
|
||||||
|
'Authorization': zgfcaulist[c],
|
||||||
|
}
|
||||||
|
resp4 = requests.post('https://ssqcx-serv.cwlo.com.cn/api/user/prize', headers=headers3)
|
||||||
|
try:
|
||||||
|
result4 = json.loads(resp4.text)['data']['prize']
|
||||||
|
print(f'账号{c+1}获取已经获得奖品:')
|
||||||
|
print(f'获得奖品数量:{str(len(result4))}')
|
||||||
|
for d in range(len(result4)):
|
||||||
|
print(result4[d]['prize_title'])
|
||||||
|
except:
|
||||||
|
print('*****')
|
||||||
110
达美乐.py
Normal file
110
达美乐.py
Normal file
@@ -0,0 +1,110 @@
|
|||||||
|
'''
|
||||||
|
author:你的jige
|
||||||
|
2024 10.15更新
|
||||||
|
优化查券功能,简化推送。五等奖跟六等奖一样,不用管,只看一等奖。
|
||||||
|
达美乐,开一把游戏抓取openid的值。
|
||||||
|
每次活动更新一定要在我的奖品那重新绑定好手机号!
|
||||||
|
变量名1:dmlck,多账号用@隔开。备注信息用#隔开 如openid的值#大帅比
|
||||||
|
变量名2:pzid 填活动id。自己抓吧
|
||||||
|
|
||||||
|
'''
|
||||||
|
import os
|
||||||
|
import time
|
||||||
|
import requests
|
||||||
|
import json
|
||||||
|
import notify
|
||||||
|
message = ''
|
||||||
|
# from dotenv import load_dotenv
|
||||||
|
# load_dotenv()
|
||||||
|
accounts = os.getenv('dmlck')
|
||||||
|
pzid = os.getenv('pzid')
|
||||||
|
|
||||||
|
if accounts is None:
|
||||||
|
print('你没有填入ck,咋运行?')
|
||||||
|
else:
|
||||||
|
accounts_list = os.environ.get('dmlck').split('@')
|
||||||
|
|
||||||
|
num_of_accounts = len(accounts_list)
|
||||||
|
|
||||||
|
print(f"获取到 {num_of_accounts} 个账号")
|
||||||
|
|
||||||
|
for i, account in enumerate(accounts_list, start=1):
|
||||||
|
|
||||||
|
values = account.split('#')
|
||||||
|
Cookie = values[0]
|
||||||
|
account_no = values[1] if len(values) > 1 else ""
|
||||||
|
print(f"\n=======开始执行账号{i} {account_no}=======")
|
||||||
|
url = f"https://game.dominos.com.cn/{pzid}/game/gameDone"
|
||||||
|
payload = f"openid={Cookie}&score=t5%2Bhzvt2h6jpwH7D%2BJkNWvT%2Fb6J2mWDStIgcC4ZSrhkqPEqXtcDrCC9LVFvQLRtGkeVQ7z0W6RYqcXxmeXi9596r4HZ1Pt0E5PpRLYWZZL%2BXQXEpyc0WX8c4ewMqQymjBgGMcSRFp3aaLTDNaRLvLcnnh2t5PpL70pW%2B7LcM8tnhtP1J2rLaTe0Dno7%2B9Qf32LuHUS%2BUXCgQ6YbCJwj%2BWrmhP1zbFvGthkH6HB9lkI9mS%2F%2BY9582WQeFREMF9OflJpRVjgPd1%2FPWFRWKWrl%2F7VGztrHpQLZvLQ9HRINK99cN4FBBvPVkkHxyACadINkuFwxgC9ODPYInHXXpn5iElg%3D%3D"
|
||||||
|
headers = {
|
||||||
|
'User-Agent': "Mozilla/5.0 (iPod; U; CPU iPhone OS 4_2 like Mac OS X; sd-PK) AppleWebKit/535.42.7 (KHTML, like Gecko) Version/4.0.5 Mobile/8B111 Safari/6535.42.7",
|
||||||
|
'Accept-Encoding': "gzip,compress,br,deflate",
|
||||||
|
'Content-Type': "application/x-www-form-urlencoded",
|
||||||
|
'charset': "utf-8",
|
||||||
|
'Referer': "https://servicewechat.com/wx887bf6ad752ca2f3/63/page-frame.html"
|
||||||
|
}
|
||||||
|
|
||||||
|
while True:
|
||||||
|
shrurl = f"https://game.dominos.com.cn/{pzid}/game/sharingDone"
|
||||||
|
payload2 = f"openid={Cookie}&from=1&target=0"
|
||||||
|
res = requests.post(shrurl, data=payload2, headers=headers).json()
|
||||||
|
if res['errorMessage'] == "今日分享已用完,请明日再来":
|
||||||
|
print(f'账号{i}分享已达上限,开始抽奖\n')
|
||||||
|
break
|
||||||
|
message += f"\n账号{i}:"
|
||||||
|
while True:
|
||||||
|
response = requests.post(url, data=payload, headers=headers)
|
||||||
|
response = response.json()
|
||||||
|
if response["statusCode"] == 0:
|
||||||
|
prize = response['content']['name']
|
||||||
|
print(f"{prize}")
|
||||||
|
time.sleep(1)
|
||||||
|
|
||||||
|
if response["statusCode"] != 0:
|
||||||
|
print(response)
|
||||||
|
err = response['errorMessage']
|
||||||
|
message += f'\n {err}'
|
||||||
|
break
|
||||||
|
#查询优惠券
|
||||||
|
checkurl = "https://game.dominos.com.cn/bulgogi//game/myPrize"
|
||||||
|
params = {
|
||||||
|
'openid': Cookie
|
||||||
|
}
|
||||||
|
checkresponse = requests.get(checkurl, params=params, headers=headers)
|
||||||
|
json_data = checkresponse.json()
|
||||||
|
prize_mapping = {
|
||||||
|
"001": "一等奖",
|
||||||
|
"002": "二等奖",
|
||||||
|
"003": "三等奖",
|
||||||
|
"004": "四等奖",
|
||||||
|
"005": "五等奖",
|
||||||
|
"006": "六等奖"
|
||||||
|
}
|
||||||
|
|
||||||
|
# 初始化计数器
|
||||||
|
prize_count = {
|
||||||
|
"一等奖": 0,
|
||||||
|
"二等奖": 0,
|
||||||
|
"三等奖": 0,
|
||||||
|
"四等奖": 0,
|
||||||
|
"五等奖": 0,
|
||||||
|
"六等奖": 0
|
||||||
|
}
|
||||||
|
|
||||||
|
# 遍历 content 列表并统计每个奖项的获奖次数
|
||||||
|
for item in json_data["content"]:
|
||||||
|
id_value = item["id"]
|
||||||
|
if id_value in prize_mapping:
|
||||||
|
prize_name = prize_mapping[id_value]
|
||||||
|
prize_count[prize_name] += 1
|
||||||
|
|
||||||
|
# 输出每个奖项的获奖次数
|
||||||
|
for prize, count in prize_count.items():
|
||||||
|
mes = (f"\n{prize}: {count}张")
|
||||||
|
message += mes
|
||||||
|
|
||||||
|
try:
|
||||||
|
notify.send('达美乐',message)
|
||||||
|
except Exception as e:
|
||||||
|
print(e)
|
||||||
|
print('推送失败')
|
||||||
31
雨云签到.py
Normal file
31
雨云签到.py
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
#!/usr/bin/python3
|
||||||
|
# -- coding: utf-8 --
|
||||||
|
# @Time : 2023/6/30 10:23
|
||||||
|
# -------------------------------
|
||||||
|
# cron "0 0 6,8,20 * * *" script-path=xxx.py,tag=匹配cron用
|
||||||
|
# const $ = new Env('雨云签到');
|
||||||
|
|
||||||
|
import json,requests,os,time
|
||||||
|
|
||||||
|
|
||||||
|
##变量雨云账号密码 注册地址https://www.rainyun.com/NTY1NzY=_ 登录后积分中心里面 赚钱积分 (如绑定微信 直接就有2000分)就可以用积分兑换主机 需要每天晚上八点蹲点
|
||||||
|
|
||||||
|
# yyusername =os .getenv ("yyusername")#line:12
|
||||||
|
# yypassword =os .getenv ("yypassword")#line:13
|
||||||
|
def login_sign ():#line:17
|
||||||
|
O00OOO00O0OO0OO00 =requests .session ()#line:18
|
||||||
|
OOOO000000000O0O0 =O00OOO00O0OO0OO00 .post ('https://api.v2.rainyun.com/user/login',headers ={"Content-Type":"application/json"},data =json .dumps ({"field":f"{yyusername}","password":f"{yypassword}"}))#line:19
|
||||||
|
if OOOO000000000O0O0 .text .find ("200")>-1 :#line:20
|
||||||
|
print ("登录成功")#line:21
|
||||||
|
O000OOOOO000OOO0O =OOOO000000000O0O0 .cookies .get_dict ()['X-CSRF-Token']#line:22
|
||||||
|
else :#line:24
|
||||||
|
print (f"登录失败,响应信息:{OOOO000000000O0O0.text}")#line:25
|
||||||
|
O000O0OOOO00OOOOO ={'x-csrf-token':O000OOOOO000OOO0O ,}#line:31
|
||||||
|
O0O0O000OOOO0OOO0 =O00OOO00O0OO0OO00 .post ('https://api.v2.rainyun.com/user/reward/tasks',headers =O000O0OOOO00OOOOO ,data =json .dumps ({"task_name":"每日签到","verifyCode":""}))#line:32
|
||||||
|
print ('开始签到:签到结果 '+O0O0O000OOOO0OOO0 .text )#line:33
|
||||||
|
|
||||||
|
if __name__ =='__main__':#line:44
|
||||||
|
for i in range(len(os.getenv("yyusername").split('#'))):
|
||||||
|
yyusername=os.getenv("yyusername").split('#')[i]
|
||||||
|
yypassword=os.getenv("yypassword").split('#')[i]
|
||||||
|
login_sign ()#line:45
|
||||||
113
霸王茶姬.py
Normal file
113
霸王茶姬.py
Normal file
@@ -0,0 +1,113 @@
|
|||||||
|
'''
|
||||||
|
有点潦草,凑合一下
|
||||||
|
抓包qm_user_token。
|
||||||
|
青龙环境变量名bwcjck。多账户换行
|
||||||
|
'''
|
||||||
|
|
||||||
|
import requests
|
||||||
|
import os
|
||||||
|
import time
|
||||||
|
import random
|
||||||
|
global gpstr
|
||||||
|
import json
|
||||||
|
gpstr = ''
|
||||||
|
from dotenv import load_dotenv
|
||||||
|
load_dotenv()
|
||||||
|
def get_env_variable(var_name):
|
||||||
|
value = os.getenv(var_name)
|
||||||
|
if value is None:
|
||||||
|
print(f'环境变量{var_name}未设置,请检查。')
|
||||||
|
return None
|
||||||
|
accounts = value.strip().split('\n')
|
||||||
|
num_accounts = len(accounts)
|
||||||
|
print(f'-----------本次账号运行数量:{num_accounts}-----------')
|
||||||
|
print(f'----------项目:霸王茶姬 -1.1----------')
|
||||||
|
return accounts
|
||||||
|
|
||||||
|
def ck(qm_user_token):
|
||||||
|
global gpstr
|
||||||
|
headers = {
|
||||||
|
'User-Agent': "Mozilla/5.0 (Linux; Android 12; M2012K11AC Build/SKQ1.211006.001; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/122.0.6261.120 Mobile Safari/537.36 XWEB/1220133 MMWEBSDK/20240301 MMWEBID/8518 MicroMessenger/8.0.48.2580(0x28003036) WeChat/arm64 Weixin NetType/WIFI Language/zh_CN ABI/arm64 MiniProgramEnv/android",
|
||||||
|
'Accept': "v=1.0",
|
||||||
|
'Accept-Encoding': "gzip,compress,br,deflate",
|
||||||
|
'Content-Type': "application/json",
|
||||||
|
'qm-from': "wechat",
|
||||||
|
'qm-user-token': qm_user_token,
|
||||||
|
'charset': "utf-8",
|
||||||
|
'qm-from-type': "catering",
|
||||||
|
'Referer': "https://servicewechat.com/wxafec6f8422cb357b/179/page-frame.html"
|
||||||
|
}
|
||||||
|
|
||||||
|
payload = json.dumps({
|
||||||
|
"activityId": "947079313798000641",
|
||||||
|
"appid": "wxafec6f8422cb357b"
|
||||||
|
})
|
||||||
|
|
||||||
|
while True:
|
||||||
|
try:
|
||||||
|
response = requests.post('https://webapi2.qmai.cn/web/cmk-center/sign/takePartInSign', headers=headers,
|
||||||
|
data=payload)
|
||||||
|
response.raise_for_status() # 主动抛出异常,如果状态码不是200
|
||||||
|
response_json = response.json()
|
||||||
|
# print(response_json)
|
||||||
|
|
||||||
|
# 检查响应是否为"上限已达"消息
|
||||||
|
if response_json.get('code') == 0 and response_json.get('message') == '该用户今日已签到':
|
||||||
|
print("已达上限,停止请求。")
|
||||||
|
gpstr += f'今天已签到\n'
|
||||||
|
break
|
||||||
|
|
||||||
|
# 成功获取奖品的情况
|
||||||
|
if response_json.get('code') == 0 and 'data' in response_json:
|
||||||
|
num = response_json['data']['rewardDetailList'][0]['sendNum']
|
||||||
|
print(f"签到成功!积分+{num}")
|
||||||
|
response1 = requests.post('https://webapi2.qmai.cn/web/cmk-center/sign/userSignStatistics',
|
||||||
|
headers=headers, data=payload).json()
|
||||||
|
sign_days = response1["data"]["signDays"]
|
||||||
|
print(f'靓仔你已经连续签到{sign_days}天啦!')
|
||||||
|
response2 = requests.post('https://webapi.qmai.cn/web/catering/crm/points-info',headers=headers, data=data).json()
|
||||||
|
total_points = response2["data"]["totalPoints"]
|
||||||
|
print(f'当前总共获得了{total_points}积分')
|
||||||
|
gpstr += f'签到成功!获得积分{num},已经签到{sign_days}天,总共获得{total_points}积分'
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
except requests.exceptions.HTTPError as http_err:
|
||||||
|
print(f"发生HTTP错误: {http_err}")
|
||||||
|
except requests.exceptions.RequestException as e:
|
||||||
|
print(f"请求异常: {e}")
|
||||||
|
|
||||||
|
# 不论成功或异常,均等待1-3秒
|
||||||
|
time.sleep(random.randint(1, 3))
|
||||||
|
|
||||||
|
# 调用函数,传入qm-user-token的值
|
||||||
|
# 主函数
|
||||||
|
def main():
|
||||||
|
var_name = 'bwcjck'
|
||||||
|
tokens = get_env_variable(var_name)
|
||||||
|
if not tokens:
|
||||||
|
print(f'环境变量{var_name}未设置,请检查。')
|
||||||
|
return
|
||||||
|
|
||||||
|
total_accounts = len(tokens)
|
||||||
|
for i, token in enumerate(tokens):
|
||||||
|
parts = token.split('#')
|
||||||
|
if len(parts) < 1:
|
||||||
|
print("令牌格式不正确。跳过处理。")
|
||||||
|
continue
|
||||||
|
|
||||||
|
token = parts[0] # Token 值
|
||||||
|
account_no = parts[1] if len(parts) > 1 else "" # 备注信息
|
||||||
|
print(f'------账号 {i+1}/{total_accounts} {account_no} 签到-------')
|
||||||
|
ck(token)
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
main()
|
||||||
|
try:
|
||||||
|
import notify
|
||||||
|
|
||||||
|
notify.send('霸王茶姬', gpstr)
|
||||||
|
except Exception as e:
|
||||||
|
print(e)
|
||||||
|
print('推送失败')
|
||||||
Reference in New Issue
Block a user