MCPcopy Create free account
hub / github.com/CScorza/IntelOSINT / _wmn_perform_request

Method _wmn_perform_request

IntelOSINT.py:18263–18285  ·  view source on GitHub ↗
(self, site, account)

Source from the content-addressed store, hash-verified

18261 return ""
18262
18263 def _wmn_perform_request(self, site, account):
18264 acc = self._wmn_prepare_account(site, account)
18265 if not acc:
18266 return None
18267 check_url = site["uri_check"].replace("{account}", acc)
18268 headers = {
18269 "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:128.0) Gecko/20100101 Firefox/128.0",
18270 "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8",
18271 "Accept-Language": "en-US,en;q=0.5",
18272 }
18273 if site.get("headers"):
18274 headers.update(site["headers"])
18275 try:
18276 if site.get("post_body"):
18277 body = site["post_body"].replace("{account}", acc)
18278 ct = (headers.get("Content-Type") or headers.get("content-type") or "").lower()
18279 if "application/json" in ct:
18280 body_obj = json.loads(body)
18281 return requests.post(check_url, json=body_obj, headers=headers, timeout=8, allow_redirects=True)
18282 return requests.post(check_url, data=body, headers=headers, timeout=8, allow_redirects=True)
18283 return requests.get(check_url, headers=headers, timeout=8, allow_redirects=True)
18284 except Exception:
18285 return None
18286
18287 def _wmn_match_result(self, resp, site):
18288 if not resp:

Callers 1

workerMethod · 0.95

Calls 1

_wmn_prepare_accountMethod · 0.95

Tested by

no test coverage detected