run一下,很快啊~
本教程适用于微信小游戏,其他平台如抖音,应该也行吧,没测试。
0、先给出HTTPDebugger、exe成品、py源码等下载链接:
https://sxf1024.lanzouv.com/b09tl5o9i
密码:8pzc
1、下载并按照HTTP Debugger破解版(见上方下载链接)
2、打开HTTP Debugger和微信,在微信上打开“羊了个羊”
微信打开小游戏,如果提示登录,就先登录,然后再去HTTP Debugger上看。
3、随便点一个包含“cat-match”的URL,获取t值
4、将t复制到代码中:
import time
import requests
import threading
# 关闭warning
import warnings
warnings.filterwarnings('ignore')
import math
from tqdm import tqdm
# from concurrent.futures import as_completed
# from concurrent.futures.thread import ThreadPoolExecutor
import os
print('>> 教程请看:http://xfxuezhang.cn/index.php/archives/471/')
print()
# HTTP Debugger 抓包获取
skip_t = False
if os.path.exists('t.txt'):
content = open('t.txt', 'r', encoding='utf-8').read().strip()
if content:
print('>> 已有t,不需要输入(如果要,请先删除t.txt再启动)')
t = content
skip_t = True
if not skip_t:
t = input('>> 请输入HTTP Debugger抓包获取的t值:').strip() or 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE2OTQ0NDg0ODIsIm5iZiI6MTY2MzM0NjI4MiwiaWF0IjoxNjYzMzQ0NDgyLCJqdGkiOiJDTTpjYXRfbWF0Y2g6bHQxMjM0NTYiLCJvcGVuX2lkIjoiIiwidWlkIjozMzI5NDQyMiwiZGVidWciOiIiLCJsYW5nIjoiIn0.wTZdhGJWhXolYAM8UoGWQ8i6qnHEcP6BUHRpqq-3Cbc'
open('t.txt', 'w+', encoding='utf-8').write(t)
loop_cnt = input('>> 请输入刷多少轮(默认99):').strip() or '99'
loop_cnt = int(loop_cnt)
sleep_time = input('>> 请输入每次中间延时多久(默认1,可为0):').strip() or '1'
sleep_time = int(sleep_time)
threads_num = input('>> 请输入多少个线程(默认1):').strip() or '1'
threads_num = int(threads_num)
def process():
def thread_find(id):
total_length = loop_cnt
gap = math.ceil(total_length / threads_num)
start = gap * id
end = gap * (id + 1)
end = end if end <= total_length else total_length
print('>> [{}]当前线程分配区域: [{}~{})'.format(id, start, end))
url = "https://cat-match.easygame2021.com/sheep/v1/game/game_over?rank_score=1&rank_state=1&rank_time=12&rank_role=1&skin=1"
headers = {
'User-Agent': "Mozilla/5.0 (iPhone; CPU iPhone OS 16_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 MicroMessenger/8.0.28(0x18001c25) NetType/WIFI Language/en",
"t": t,
'Host': 'cat-match.easygame2021.com',
'Accept': 'gzip,compress,br,deflate',
'Connection': 'keep-alive',
'Accept-Encoding': 'gzip, deflate, br',
'Referer': 'https://servicewechat.com/wx141bfb9b73c970a9/15/page-frame.html',
}
for _ in tqdm(range(start, end), desc=str(id)):
try:
r = requests.get(url=url, headers=headers, verify=False, timeout=10).json()
print(r)
except Exception as e:
print('>> [{}]出现异常(不影响): {}'.format(id, str(e)))
time.sleep(sleep_time)
return True
# with ThreadPoolExecutor(threads_num) as executor: # 创建 ThreadPoolExecutor
# future_list = [executor.submit(thread_find, id) for id in range(threads_num)]
# results = []
# for future in as_completed(future_list):
# results.append(future.result()) # 获取任务结果
thread_pool = []
for id in range(threads_num):
t_handle = threading.Thread(target=thread_find, args=(id, ))
thread_pool.append(t_handle)
t_handle.setDaemon(True)
t_handle.start()
for t_handle in thread_pool:
t_handle.join()
if __name__ == '__main__':
process()
print('>> 运行结束')
input('>> 输入任意键退出...')
5、运行这个脚本即可,对于没有安装Python环境的,我也为大家打包了一下exe。成品与源码下载链接(见最上方下载链接)。
6、如果报错“SSL module is not available”,就安装一下“Win64OpenSSL_Light-1_1_1k.exe”,下载链接:
https://sxf1024.lanzouv.com/i5mjp0bruycf
7、如果报错“连接的主机没有反应”,就是服务器挂了,等官方恢复了再运行。
{'err_code': 10003, 'err_msg': '没有权限', 'data': None} 这是怎么回事
抓包一下拿到t,填进代码里
输入任意键退出...
安装一下“Win64OpenSSL_Light-1_1_1k.exe”:https://sxf1024.lanzouv.com/i5mjp0bruycf
或者代码中改为:r = requests.get(url = url, headers = headers, verify=False).json()
游戏服务器崩了