├── .idea ├── .gitignore ├── inspectionProfiles │ └── profiles_settings.xml ├── misc.xml ├── modules.xml └── ylgy.iml └── gettoken.py /.idea/.gitignore: -------------------------------------------------------------------------------- 1 | # Default ignored files 2 | /shelf/ 3 | /workspace.xml 4 | # Editor-based HTTP Client requests 5 | /httpRequests/ 6 | # Datasource local storage ignored files 7 | /dataSources/ 8 | /dataSources.local.xml 9 | -------------------------------------------------------------------------------- /.idea/inspectionProfiles/profiles_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | -------------------------------------------------------------------------------- /.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /.idea/ylgy.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 18 | 19 | -------------------------------------------------------------------------------- /gettoken.py: -------------------------------------------------------------------------------- 1 | 2 | import json 3 | 4 | import requests 5 | 6 | 7 | def getToken(uid): 8 | # 获取Openid 9 | try: 10 | headers = { 11 | 'Accept': '*/*', 12 | 'Accept-Encoding': 'gzip,compress,br,deflate', 13 | 'Connection': 'keep-alive', 14 | 'content-type': 'application/json', 15 | 'Referer': 'https://servicewechat.com/wx141bfb9b73c970a9/16/page-frame.html', 16 | 'User-Agent': 'Mozilla/5.0 (Linux; Android 12; M2012K11C Build/SKQ1.211006.001; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/86.0.4240.99 XWEB/4313 MMWEBSDK/20220805 Mobile Safari/537.36 MMWEBID/4629 MicroMessenger/8.0.27.2220(0x28001B37) WeChat/arm64 Weixin NetType/WIFI Language/zh_CN ABI/arm64 MiniProgramEnv/android', 17 | 't': 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE2OTQ1MDI0NDUsIm5iZiI6MTY2MzQwMDI0NSwiaWF0IjoxNjYzMzk4NDQ1LCJqdGkiOiJDTTpjYXRfbWF0Y2g6bHQxMjM0NTYiLCJvcGVuX2lkIjoiIiwidWlkIjo0NTk0MjYwMiwiZGVidWciOiIiLCJsYW5nIjoiIn0.1lXIcb1WL_SdsXG5N_i1drjjACRhRZUS2uadHlT6zIY' 18 | } 19 | resp = requests.get(f"https://cat-match.easygame2021.com/sheep/v1/game/user_info?uid={uid}", headers=headers) 20 | if resp.status_code == 200 and 'wx_open_id' in resp.text: 21 | res = resp.json() 22 | openid = res['data']['wx_open_id'] 23 | data = { 24 | "uuid": openid 25 | } 26 | resp = requests.post("https://cat-match.easygame2021.com/sheep/v1/user/login_tourist", data=json.dumps(data), 27 | headers=headers) 28 | print(resp.text) 29 | else: 30 | return False 31 | except Exception as e: 32 | return False 33 | 34 | 35 | if __name__ == '__main__': 36 | 37 | getToken("xxxxxx") --------------------------------------------------------------------------------