(phone, password)
| 42 | |
| 43 | # 签名并获取认证码 |
| 44 | def sign(phone, password): |
| 45 | url_encoded_data = jm(password) |
| 46 | url = "https://passport.tmuyun.com/web/oauth/credential_auth" |
| 47 | payload = f"client_id=10019&password={url_encoded_data}&phone_number={phone}" |
| 48 | print(payload) |
| 49 | headers = { |
| 50 | 'User-Agent': "ANDROID;13;10019;6.0.2;1.0;null;MEIZU 20", |
| 51 | 'Connection': "Keep-Alive", |
| 52 | 'Accept-Encoding': "gzip", |
| 53 | 'Content-Type': "application/x-www-form-urlencoded", |
| 54 | 'Cache-Control': "no-cache", |
| 55 | 'X-SIGNATURE': "185d21c6f3e9ec4af43e0065079b8eb7f1bb054134481e57926fcc45e304b896", |
| 56 | } |
| 57 | |
| 58 | response = requests.post(url, data=payload, headers=headers) |
| 59 | print(response.json()) |
| 60 | code = response.json()['data']['authorization_code']['code'] |
| 61 | |
| 62 | url = "https://vapp.taizhou.com.cn/api/zbtxz/login" |
| 63 | payload = f"check_token=&code={code}&token=&type=-1&union_id=" |
| 64 | headers = { |
| 65 | 'User-Agent': "6.0.2;{deviceid};Meizu MEIZU 20;Android;13;tencent;6.10.0", |
| 66 | 'Connection': "Keep-Alive", |
| 67 | 'Accept-Encoding': "gzip", |
| 68 | 'Content-Type': "application/x-www-form-urlencoded", |
| 69 | 'X-SESSION-ID': "66586b383f293a7173e4c8f4", |
| 70 | 'X-REQUEST-ID': "110c1987-1637-4f4e-953e-e35272bb891e", |
| 71 | 'X-TIMESTAMP': "1717072109065", |
| 72 | 'X-SIGNATURE': "a69f171e284594a5ecc4baa1b2299c99167532b9795122bae308f27592e94381", |
| 73 | 'X-TENANT-ID': "64", |
| 74 | 'Cache-Control': "no-cache" |
| 75 | } |
| 76 | response = requests.post(url, data=payload, headers=headers) |
| 77 | message = response.json()['message'] |
| 78 | account_id = response.json()['data']['account']['id'] |
| 79 | session_id = response.json()['data']['session']['id'] |
| 80 | name = response.json()['data']['account']['nick_name'] |
| 81 | |
| 82 | return message, account_id, session_id, name |
| 83 | |
| 84 | |
| 85 | #生成验证码 |
no test coverage detected