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

Method _google_maps_get_public

IntelOSINT.py:11127–11153  ·  view source on GitHub ↗
(self, url, headers)

Source from the content-addressed store, hash-verified

11125 value /= 1024
11126
11127 def _google_maps_get_public(self, url, headers):
11128 try:
11129 r = session.get(url, headers=headers, timeout=12, allow_redirects=True)
11130 if "consent.google.com" not in str(getattr(r, "url", "")):
11131 return r
11132 soup = BeautifulSoup(r.text or "", "html.parser")
11133 selected_form = None
11134 selected_data = None
11135 for form in soup.find_all("form"):
11136 action = str(form.get("action") or "")
11137 if "/save" not in action:
11138 continue
11139 data = {i.get("name"): i.get("value", "") for i in form.find_all("input") if i.get("name")}
11140 if data.get("set_eom") == "true":
11141 selected_form = form
11142 selected_data = data
11143 break
11144 if selected_form is None:
11145 selected_form = form
11146 selected_data = data
11147 if selected_form is not None and selected_data is not None:
11148 action = str(selected_form.get("action") or "https://consent.google.com/save")
11149 session.post(action, headers=headers, data=selected_data, timeout=12, allow_redirects=True)
11150 r = session.get(url, headers=headers, timeout=12, allow_redirects=True)
11151 return r
11152 except Exception:
11153 return None
11154
11155 def _normalize_google_image_url(self, url, size="w800-h600-k-no"):
11156 try:

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected