Beispiel #1
0
 def v6_auth_check(self, code: str):
     timestamp = signatures.get_timestamp()
     cnonce = signatures.get_cnonce()
     signature = signatures.signature_v6_auth_check(cnonce, code, timestamp)
     url = self.api_url + f'v6/auth/check?code={code}&timestamp={timestamp}&signature={signature}&cnonce={cnonce}'
     data = requests.get(url, headers=self.headers)
     return data.json()
Beispiel #2
0
 def v6_numcy_subscription_comment_renewal(self, comment_id: int):
     timestamp = signatures.get_timestamp()
     cnonce = signatures.get_cnonce()
     signature = signatures.signature_v6_numcy_subscription_comment_renewal(
         self.access_token, cnonce, comment_id, timestamp)
     url = self.api_url + f'v6/numcy/subscription/comment/renewal?comment_id={comment_id}&timestamp={timestamp}&signature={signature}&cnonce={cnonce}&access_token={self.access_token}'
     data = requests.post(url, headers=self.headers)
     return data.json()
Beispiel #3
0
 def v6_old_sms(self, phone, locale='ru'):
     timestamp = signatures.get_timestamp()
     cnonce = signatures.get_cnonce()
     signature = signatures.signature_v6_old_sms(phone, self.access_token,
                                                 cnonce, timestamp, locale)
     url = self.api_url + f'v6/old/sms/{phone}?access_token={self.access_token}&locale={locale}&timestamp={timestamp}&signature={signature}&cnonce={cnonce}'
     data = requests.get(url, headers=self.headers)
     return data.json()
Beispiel #4
0
 def v6_notice_delete(self, phone):
     timestamp = signatures.get_timestamp()
     cnonce = signatures.get_cnonce()
     signature = signatures.signature_v6_notice_delete(
         self.access_token, cnonce, phone, timestamp)
     url = self.api_url + f'v6/notice/delete?phone={phone}&timestamp={timestamp}&signature={signature}&cnonce={cnonce}&access_token={self.access_token}'
     data = requests.post(url, headers=self.headers)
     return data.json()
Beispiel #5
0
 def v6_comment_list(self, phone: str, offset: int, limit: int):
     timestamp = signatures.get_timestamp()
     cnonce = signatures.get_cnonce()
     signature = signatures.signature_v6_comment_list(
         self.access_token, cnonce, limit, offset, phone, timestamp)
     url = self.api_url + f'v6/comment/list?phone={phone}&offset={offset}&limit={limit}&timestamp={timestamp}&signature={signature}&cnonce={cnonce}&access_token={self.access_token}'
     data = requests.get(url, headers=self.headers)
     return data.json()
Beispiel #6
0
 def v6_dailyquest_calendar(self):
     timestamp = signatures.get_timestamp()
     cnonce = signatures.get_cnonce()
     signature = signatures.signature_v6_dailyquest_calendar(
         self.access_token, cnonce, timestamp)
     url = self.api_url + f'v6/dailyquest/calendar?timestamp={timestamp}&signature={signature}&cnonce={cnonce}&access_token={self.access_token}'
     data = requests.get(url, headers=self.headers)
     return data.json()
Beispiel #7
0
 def v6_numcy_subcription_comment_settings(self):
     timestamp = signatures.get_timestamp()
     cnonce = signatures.get_cnonce()
     signature = signatures.signature_v6_numcy_subscription_comment_settings(
         self.access_token, cnonce, timestamp)
     url = self.api_url + f'v6/numcy/subscription/comment/settings?timestamp={timestamp}&signature={signature}&cnonce={cnonce}&access_token={self.access_token}'
     data = requests.get(url, headers=self.headers)
     return data.json()
Beispiel #8
0
 def v6_numcy_balance(self):
     timestamp = signatures.get_timestamp()
     cnonce = signatures.get_cnonce()
     signature = signatures.signature_v6_numcy_balance(
         self.access_token, cnonce, timestamp)
     url = self.api_url + f'v6/numcy/balance?timestamp={timestamp}&signature={signature}&cnonce={cnonce}&access_token={self.access_token}'
     data = requests.get(url, headers=self.headers)
     return data.json()
Beispiel #9
0
 def v6_auth_facebook(self, facebook_token, code):
     timestamp = signatures.get_timestamp()
     cnonce = signatures.get_cnonce()
     signature = signatures.signature_v6_auth_facebook(
         cnonce, code, facebook_token, timestamp)
     url = self.api_url + f'v6/auth/facebook?facebook_token={facebook_token}&code={code}&timestamp={timestamp}&signature={signature}&cnonce={cnonce}'
     data = requests.post(url, headers=self.headers)
     return data.json()
Beispiel #10
0
 def v7_main_load(self):
     timestamp = signatures.get_timestamp()
     cnonce = signatures.get_cnonce()
     signature = signatures.signature_v7_main_load(self.access_token,
                                                   cnonce, timestamp)
     url = self.api_url + f'v7/main/load?access_token={self.access_token}&cnonce={cnonce}&timestamp={timestamp}&signature={signature}'
     data = requests.get(url, headers=self.headers)
     return data.json()
Beispiel #11
0
 def v6_auth_get(self, platform='Android', lang='ru'):
     #Allows to get misterious code
     timestamp = signatures.get_timestamp()
     cnonce = signatures.get_cnonce()
     signature = signatures.signature_v6_auth_get(cnonce, timestamp, lang,
                                                  platform)
     url = self.api_url + f'v6/auth/get?platform={platform}&lang={lang}&timestamp={timestamp}&signature={signature}&cnonce={cnonce}'
     data = requests.get(url, headers=self.headers)
     return data.json()
Beispiel #12
0
 def v6_notice_edit(self, phone: str, text: str):
     text_u = signatures.to_url(text)
     timestamp = signatures.get_timestamp()
     cnonce = signatures.get_cnonce()
     signature = signatures.signature_v6_notice_edit(
         self.access_token, cnonce, phone, text_u, timestamp)
     url = self.api_url + f'v6/notice/edit?phone={phone}&text={text}&timestamp={timestamp}&signature={signature}&cnonce={cnonce}&access_token={self.access_token}'
     data = requests.post(url, headers=self.headers)
     return data.json()
Beispiel #13
0
 def v6_auth_precheck(self, code: str, phone: str):
     headers = self.headers.copy()
     headers['Content-Type'] = 'application/x-www-form-urlencoded'
     timestamp = signatures.get_timestamp()
     cnonce = signatures.get_cnonce()
     signature = signatures.signature_v6_auth_precheck(
         cnonce, code, phone, timestamp)
     url = self.api_url + f'v6/auth/precheck?timestamp={timestamp}&signature={signature}&cnonce={cnonce}'
     data = requests.post(url,
                          headers=headers,
                          data=bytes(f'code={code}&phone={phone}', 'utf-8'))
     return data.json()
Beispiel #14
0
 def v6_auth_agreement_code(self, code: str):
     #code from v6/auth/get
     headers = self.headers.copy()
     headers['Content-Type'] = 'application/x-www-form-urlencoded'
     timestamp = signatures.get_timestamp()
     cnonce = signatures.get_cnonce()
     signature = signatures.signature_v6_auth_agreement_code(
         cnonce, code, timestamp)
     url = self.api_url + f'v6/auth/agreement_code?&timestamp={timestamp}&signature={signature}&cnonce={cnonce}'
     data = requests.post(url,
                          headers=headers,
                          data=bytes(f'code={code}', 'utf-8'))
     return data.json()