-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvote.py
executable file
·65 lines (43 loc) · 1.29 KB
/
vote.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
import requests
import pprint
from pathlib import Path
import toml
credentials = toml.load(Path("credentials.toml"))
id_= credentials['program_credentials']
def vote_image(img_id):
cookies = {
}
headers = {
'User-Agent': 'SktchyForiPhone/3.0.0 (iPhone; iOS 14.0; Scale/3.00)',
'Content-Type': 'application/x-www-form-urlencoded',
'Accept-Language': 'en-US;q=1',
}
data = {
'_appv': '465',
'imgID': f'{img_id}',
'inEmail':id_['inEmail'],
'inPass': id_['inPass'],
'lang': 'en-US',
'zip': '1'
}
response = requests.post('https://api.sktchy.com/api/v1/graph/vote', headers=headers, cookies=cookies, data=data)
pprint.pprint(response.json())
return response.json()
def unvote(img_id):
cookies = {
}
headers = {
'User-Agent': 'SktchyForiPhone/3.0.0 (iPhone; iOS 14.0; Scale/3.00)',
'Content-Type': 'application/x-www-form-urlencoded',
'Accept-Language': 'en-US;q=1',
}
data = {
'_appv': '465',
'imgID': f'{img_id}',
'inEmail':id_['inEmail'],
'inPass': id_['inPass'],
'lang': 'en-US',
'zip': '1'
}
response = requests.post('https://api.sktchy.com/api/v1/graph/unvote', headers=headers, cookies=cookies, data=data)
pprint.pprint(response.json())