This repository has been archived by the owner on Dec 1, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 9
/
signatures.py
147 lines (109 loc) · 8.31 KB
/
signatures.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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
import hashlib
import random
import time
import urllib
RANDOMISE_CNONCE = True
def get_cnonce() -> str:
if RANDOMISE_CNONCE:
buf = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789'
cnonce = ''
length = random.randint(0,19) + 30
for i in range(length):
cnonce += random.choice(buf)
else:
cnonce = 'o5oorrrlBlbWKHRVuH7lBQdVCQEVKeXeTkAyA9H6FY8DT904sq'
return cnonce
def crypt(inp:str):
#sha256 alg + sol
sol = '0woz2wTimes9izs0vFQjLmwqqSzAPNFtmWNcbOL6xJva5Molyb'#Fucking sol
return hashlib.sha256(bytes(inp+sol,'utf-8')).hexdigest()
def get_timestamp()->str:
return str(int(time.time()))
def to_url(input:str):
return urllib.quote(input.encode('utf-8')).replace('\\+','%20')
def signature_v6_numcy_subscription_comment_add(access_token:str,cnonce:str,comment_id:int,timestamp:str):
source = 'POSTapi.numbuster.com/api/v6/numcy/subscription/comment/addaccess_token='+access_token+'&cnonce='+cnonce+'&comment_id='+str(comment_id)+'×tamp='+timestamp
return crypt(source)
def signature_v6_dailyquest_get(access_token:str,cnonce:str,timestamp:str):
source = 'GETapi.numbuster.com/api/v6/dailyquest/getaccess_token='+access_token+'&cnonce='+cnonce+'×tamp='+timestamp
return crypt(source)
def signature_v6_comment_list_my(access_token:str,cnonce:str,limit:int,offset:int,timestamp:str):
source = 'GETapi.numbuster.com/api/v6/comment/list/myaccess_token='+access_token+'&cnonce='+cnonce+'&limit='+str(limit)+'&offset='+str(offset)+'×tamp='+timestamp
return crypt(source)
def signature_v6_comment_list(access_token:str,cnonce:str,limit:int,offset:int,phone:str,timestamp:str):
source = 'GETapi.numbuster.com/api/v6/comment/listaccess_token='+access_token+'&cnonce='+cnonce+'&limit='+str(limit)+'&offset='+str(offset)+'&phone='+phone+'×tamp='+timestamp
return crypt(source)
def signature_v6_dailyquest_result_final(access_token:str,cnonce:str,daily_quest_id:int,timestamp:str):
source = 'GETapi.numbuster.com/api/v6/dailyquest/result/finalaccess_token='+access_token+'&cnonce='+cnonce+'&daily_quest_id='+str(daily_quest_id)+'×tamp='+timestamp
return crypt(source)
def signature_v6_dailyquest_result(access_token:str,cnonce:str,daily_quest_id:int,opened_item:int,result_number:int,timestamp:str):
source = 'POSTapi.numbuster.com/api/v6/dailyquest/resultaccess_token='+access_token+'&cnonce='+cnonce+'&daily_quest_id='+str(daily_quest_id)+'&opened_item='+str(opened_item)+'&result_number='+str(result_number)+'×tamp='+timestamp
return crypt(source)
def signature_v6_comment_delete(access_token:str,cnonce:str,phone:str,timestamp:str):
source = 'POSTapi.numbuster.com/api/v6/comment/deleteaccess_token='+access_token+'&cnonce='+cnonce+'&phone='+phone+'×tamp='+timestamp
return crypt(source)
def signature_v6_comment_add(access_token:str,cnonce:str,phone:str,text:str,timestamp:str):
source = 'POSTapi.numbuster.com/api/v6/comment/addaccess_token='+access_token+'&cnonce='+cnonce+'&phone='+phone+'&text='+text+'×tamp='+timestamp
return crypt(source)
def signature_v6_numcy_subscription_comment_renewal(access_token:str,cnonce:str,comment_id:int,timestamp:str):
source = 'POSTapi.numbuster.com/api/v6/numcy/subscription/comment/renewalaccess_token='+access_token+'&cnonce='+cnonce+'&comment_id='+str(comment_id)+'×tamp='+timestamp
return crypt(source)
def signature_v6_numcy_balance(access_token:str,cnonce:str,timestamp:str):
source = 'GETapi.numbuster.com/api/v6/numcy/balanceaccess_token='+access_token+'&cnonce='+cnonce+'×tamp='+timestamp
return crypt(source)
def signature_v6_notice_delete(access_token:str,cnonce:str,phone:str,timestamp:str):
source = 'POSTapi.numbuster.com/api/v6/notice/deleteaccess_token='+access_token+'&cnonce='+cnonce+'&phone='+phone+'×tamp='+timestamp
return crypt(source)
def signature_v6_comment_edit(access_token:str,cnonce:str,phone:str,text:str,timestamp:str):
source = 'POSTapi.numbuster.com/api/v6/comment/editaccess_token='+access_token+'&cnonce='+cnonce+'&phone='+phone+'&text='+text+'×tamp='+timestamp
return crypt(source)
def signature_v6_auth_get(cnonce:str,timestamp:str,lang='RU',platform='Android'):
source = 'GETapi.numbuster.com/api/v6/auth/getcnonce='+cnonce+'&lang='+lang+'&platform='+platform+'×tamp='+timestamp
return crypt(source)
def signature_v6_old_phone(phone:str,access_token:str,cnonce:str,timestamp:str,locale='RU'):
source = 'GETapi.numbuster.com/api/v6/old/phone/'+phone+'access_token='+access_token+'&cnonce='+cnonce+'&locale='+locale+'×tamp='+timestamp
return crypt(source)
def signature_v6_auth_agreement(cnonce:str,phone:str,timestamp:str):
source = 'POSTapi.numbuster.com/api/v6/auth/agreementcnonce='+cnonce+'&phone='+phone+'×tamp='+timestamp
return crypt(source)
def signature_v6_auth_facebook(cnonce:str,code:str,facebook_token:str,timestamp:str):
source = 'POSTapi.numbuster.com/api/v6/auth/facebookcnonce='+cnonce+'&code='+code+'&facebook_token='+facebook_token+'×tamp'+timestamp
return crypt(source)
def signature_v6_old_sms(phone:str,access_token:str,cnonce:str,timestamp:str,locale:'RU'):
source = 'GETapi.numbuster.com/api/v6/old/sms/'+phone+'access_token='+access_token+'&cnonce='+cnonce+'&locale='+locale+'×tamp='+timestamp
return crypt(source)
def signature_v6_dailyquest_calendar(access_token:str,cnonce:str,timestamp:str):
source = 'GETapi.numbuster.com/api/v6/dailyquest/calendaraccess_token='+access_token+'&cnonce='+cnonce+'×tamp='+timestamp
return crypt(source)
def signature_v6_old_search(phone:str,access_token:str,cnonce:str,timestamp:str,locale='RU'):
source = 'GETapi.numbuster.com/api/v6/old/search/'+phone+'access_token='+access_token+'&cnonce='+cnonce+'&locale='+locale+'×tamp='+timestamp
return crypt(source)
def signature_v6_auth_agreement_code(cnonce:str,code:str,timestamp:str):
source = 'POSTapi.numbuster.com/api/v6/auth/agreement_codecnonce='+cnonce+'&code='+code+'×tamp='+timestamp
return crypt(source)
def signature_v6_old_profiles_by_phone(phone:str,access_token:str,cnonce:str,timestamp:str,locale='RU'):
source = 'GETapi.numbuster.com/api/v6/old/profiles/by_phone/'+phone+'access_token='+access_token+'&cnonce='+cnonce+'&locale='+locale+'×tamp='+timestamp
return crypt(source)
def signature_v6_auth_check(cnonce:str,code:str,timestamp:str):
source = 'GETapi.numbuster.com/api/v6/auth/checkcnonce='+cnonce+'&code='+code+'×tamp='+timestamp
return crypt(source)
def signature_v6_notice_add(access_token:str,cnonce:str,phone:str,text:str,timestamp:str):
source = 'POSTapi.numbuster.com/api/v6/notice/addaccess_token='+access_token+'&cnonce='+cnonce+'&phone='+phone+'&text='+text+'×tamp='+timestamp
return crypt(source)
def signature_v6_notice_edit(access_token:str,cnonce:str,phone:str,text,timestamp:str):
source = 'POSTapi.numbuster.com/api/v6/notice/editaccess_token='+access_token+'&cnonce='+cnonce+'&phone='+phone+'&text='+text+'×tamp='+timestamp
return crypt(source)
def signature_v6_numcy_subscription_comment_cancel(access_token:str,cnonce:str,comment_id:int,timestamp:str):
source = 'POSTapi.numbuster.com/api/v6/numcy/subscription/comment/cancelaccess_token='+access_token+'&cnonce='+cnonce+'&comment_id='+str(comment_id)+'×tamp='+timestamp
return crypt(source)
def signature_v6_numcy_subscription_comment_settings(access_token:str,cnonce:str,timestamp:str):
source = 'GETapi.numbuster.com/api/v6/numcy/subscription/comment/settingsaccess_token='+access_token+'&cnonce='+cnonce+'×tamp='+timestamp
return crypt(source)
def signature_v6_auth_precheck(cnonce:str,code:str,phone:str,timestamp:str):
source = 'POSTapi.numbuster.com/api/v6/auth/precheckcnonce='+cnonce+'&code='+code+'&phone='+phone+'×tamp='+timestamp
return crypt(source)
def signature_v7_main_load(access_token,cnonce,timestamp):
source='GETapi.numbuster.com/api/v7/main/loadaccess_token='+access_token+'&cnonce='+cnonce+'×tamp='+timestamp
return crypt(source)
if __name__=='__main__':
print(signature_v6_auth_precheck('7BRIqhAJIIwiRWoY2OBILW2s8HT8emI','Cztm-XkwS-tk7l','79313336429','1580923704'))