代码拉取完成,页面将自动刷新
同步操作将从 B2FH/score 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
import json
import requests
import random
import time
url = "https://mt.fjii.com/api/wechatShareTask/shareSum"
# 获取从键盘输入的值赋值给userId和token
with open('token.json', 'r') as f:
userInfo = json.load(f)
print(userInfo)
userId = userInfo['id']
token = userInfo['token']
# userId = input("请输入userId:")
print(userId)
# token = input('请输入token:')
print(token)
# token = "074fc07a-279a-4ebb-b5e5-54c01533457e"
# userId = 1684743956111429632
# payload="{\"isLoadTip\":\"...\",\"user_id\":\"1316927879329746944\",\"wechat_share_task_id\":\"1414761988562751488\",\"type\":2,\"token_header\":\"xOjqTc9vix%2FIQVwVMZmkpCwp4B2WafoeT991Rnx%2FJhmYF6H9Xv46EkHqmsU%2BjVVIZyeIygoJ8sDqdM7d4AfPy19p0ULjujQFFQMUEzFwNVRNw%2FJo8ou6CGPkfB%2B%2FLMlgX2y%2BudFF9SrsZ5kWvffVJg%3D%3D\"}"
headers = {
'POSThttps': '//mt.fjii.com/api/wechatShareTask/shareSumHTTP/1.1',
'Host': 'mt.fjii.com',
'Connection': 'keep-alive',
'Content-Length': '302',
'Accept': 'application/json,text/plain,*/*',
'User-Agent': 'Mozilla/5.0(Linux;Android10;ALP-AL00Build/HUAWEIALP-AL00;wv)AppleWebKit/537.36(KHTML,likeGecko)Version/4.0Chrome/83.0.4103.106MobileSafari/537.36wpsystem',
'Content-Type': 'application/json;charset=UTF-8',
'Origin': 'https://mt.fjii.com',
'X-Requested-With': 'com.fuzhou.wpsystem',
'Sec-Fetch-Site': 'same-origin',
'Sec-Fetch-Mode': 'cors',
'Sec-Fetch-Dest': 'empty',
'Accept-Encoding': 'gzip,deflate',
'Accept-Language': 'zh-CN,zh;q=0.9,en-US;q=0.8,en;q=0.7',
'Cookie': f'token={token}'
}
# 从ids.json文件中读取id
with open('ids.json', 'r') as f:
ids = json.load(f)
# payload="{\"isLoadTip\":\"...\",\"user_id\":\"1684743956111429632\",\"wechat_share_task_id\":\""
payload = "{\"isLoadTip\":\"...\",\"user_id\":" + \
f"{userId}"+",\"wechat_share_task_id\":\""
# 从nums.json文件中读取上次刷到的id
with open('nums.json', 'r') as f:
nums_init = json.load(f)
#
nums = nums_init
for i in range(nums, len(ids)):
end = "\",\"type\":1,\"appVersion\":\"2.9.10\"}"
# end="\",\"type\":1,\"token_header\":\"xOjqTc9vix%2FIQVwVMZmkpCwp4B2WafoeT991Rnx%2FJhmYF6H9Xv46EkHqmsU%2BjVVIZyeIygoJ8sDqdM7d4AfPy19p0ULjujQFFQMUEzFwNVRNw%2FJo8ou6CGPkfB%2B%2FLMlgX2y%2BudFF9SrsZ5kWvffVJg%3D%3D\"}"
payloads = payload+ids[i]+end
# print(payloads)
try:
response = requests.request("POST", url, headers=headers, data=payloads)
except Exception as error:
#抓取异常信息,存储到log.txt文件中
with open('log.txt', 'a') as f:
f.write(f"{error}\n")
# 将nums存入json文件
with open('nums.json', 'w') as f:
json.dump(nums, f)
print("出现错误,程序终止")
break
print(response.text)
res_text = response.text
if res_text.find("分享成功") == -1:
if res_text.find("成功") != -1:
with open('log.txt', 'a') as f:
f.write(f"{res_text}token过期\n")
print("token过期")
break
if res_text.find("频繁分享") != -1:
print("频繁分享,程序休眠10分钟")
# 将nums存入json文件
with open('nums.json', 'w') as f:
json.dump(nums, f)
nums_init = nums
# 休眠601秒并显示倒计时
for i in range(601):
print(f"程序将在{601-i}秒后继续执行", end="\r")
time.sleep(1)
else:
#抓取异常信息
with open('log.txt', 'a') as f:
f.write(f"{res_text}程序错误,终止执行\n")
# 将nums存入json文件
with open('nums.json', 'w') as f:
json.dump(nums, f)
break
# 生成随机数
time.sleep(random.randint(1, 2))
print(nums)
nums = nums+1
# 将nums存入json文件
with open('nums.json', 'w') as f:
json.dump(nums, f)
print("刷分结束")
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。