-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdebug_lotto.py
More file actions
43 lines (36 loc) · 1.45 KB
/
debug_lotto.py
File metadata and controls
43 lines (36 loc) · 1.45 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
import requests
import json
headers = {
'Accept': 'text/plain, */*; q=0.01',
'Accept-Language': 'en-US,en;q=0.9',
'X-AjaxPro-Method': 'GetDrawResult',
'Content-Type': 'text/plain; charset=UTF-8',
'Origin': 'https://vietlott.vn',
'Referer': 'https://vietlott.vn/vi/trung-thuong/ket-qua-trung-thuong/max-4d',
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.75 Safari/537.36',
}
methods = [
('GameMax4DResultWebPart', 'GetDrawResult'),
('GameMax4DResultWebPart', 'ServerSideDrawResult'),
('GameMax4DCompareWebPart', 'ServerSideDrawResult'),
]
for webpart, method in methods:
url = f'https://vietlott.vn/ajaxpro/Vietlott.PlugIn.WebParts.{webpart},Vietlott.PlugIn.WebParts.ashx'
headers['X-AjaxPro-Method'] = method
# Try different bodies
bodies = [
{"GameDrawId": 0},
{"PageIndex": 1, "GameDrawId": 0},
{"PageIndex": 1},
]
print(f"Testing {webpart} / {method}...")
for b in bodies:
try:
resp = requests.post(url, headers=headers, json=b, timeout=5)
print(f" Body: {b}")
print(f" Status: {resp.status_code}, Len: {len(resp.text)}")
if "error" not in resp.text.lower() and len(resp.text) > 200:
print(f" SUCCESS? Content: {resp.text[:200]}...")
except Exception as e:
print(f" Error: {e}")
print("-" * 40)