-
Notifications
You must be signed in to change notification settings - Fork 2
/
apkInfo.py
74 lines (67 loc) · 1.86 KB
/
apkInfo.py
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
import json
import urllib3
url = 'https://api.cafebazaar.ir'
app_detail_url = '/rest-v1/process/AppDetailsV2Request'
properties = {
"androidClientInfo": {
"adId": "",
"adOptOut": False,
"androidId": "488o50b88f5x228d",
"city": "NA",
"country": "NA",
"cpu": "armeabi-v7a,armeabi",
"device": "",
"dpi": 510,
"hardware": "",
"height": 1920,
"locale": "",
"manufacturer": "huawei",
"mcc": 432,
"mnc": 20,
"model": "p50-pro",
"osBuild": "",
"product": "p50",
"province": "NA",
"sdkVersion": 23,
"width": 1080
},
"appThemeState": 0,
"clientID": "DFztC8oYTRuFZSf4565xu52",
"clientVersion": "8.11.2",
"clientVersionCode": 801102,
"isKidsEnabled": False,
"language": 2
}
def app_detail(packageName, link):
globals()
payload = {
"properties": properties,
"singleRequest": {
"appDetailsV2Request": {
"packageName": packageName,
"referrers": [{
"type": 11,
"extraJson": "{\"services\":\"vitrin\",\"slug\":\"home\"}"
}, {
"type": 21,
"extraJson": "{\"services\":\"vitrin\",\"slug\":\"home\"}"
}, {
"type": 1,
"extraJson": "{\"services\":\"vitrin\",\"index\":7,\"title\":\"بهروزشدههای برگزیده\",\"source\":\"normal\",\"is_shuffled\":false,\"referrer_identifier\":\"query_Best New Updates\"}"
}, {
"type": 2,
"extraJson": "{\"services\":\"vitrin\",\"index\":1,\"referrer_identifier\":\"\"}"
}
]
}
}
}
http = urllib3.PoolManager()
encoded_data = json.dumps(payload).encode('utf-8')
r = http.request('POST', url + app_detail_url, body=encoded_data)
response = json.loads(r.data.decode('utf-8'))
if response['properties']['statusCode'] == 200:
apkName = response['singleReply']['appDetailsV2Reply']['meta']['name']
return apkName
else:
raise Exception('Not Found!')