MCPcopy
hub / github.com/knownsec/pocsuite3 / token_is_available

Method token_is_available

pocsuite3/modules/quake/__init__.py:26–40  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

24 self.check_token()
25
26 def token_is_available(self):
27 if self.token:
28 try:
29 self.headers['X-QuakeToken'] = self.token
30 resp = requests.get(
31 'https://quake.360.cn/api/v3/user/info', headers=self.headers)
32
33 if 'month_remaining_credit' not in resp.text:
34 logger.info(resp.text)
35
36 if resp and resp.status_code == 200 and resp.json()['code'] == 0:
37 return True
38 except Exception as ex:
39 logger.error(str(ex))
40 return False
41
42 def check_token(self):
43 if self.token_is_available():

Callers 1

check_tokenMethod · 0.95

Calls 1

errorMethod · 0.80

Tested by

no test coverage detected