(url: str)
| 316 | |
| 317 | |
| 318 | def strip_tracking(url: str) -> str: |
| 319 | try: |
| 320 | p = urllib.parse.urlsplit(url) |
| 321 | q = urllib.parse.parse_qsl(p.query, keep_blank_values=True) |
| 322 | q = [(k, v) for k, v in q if k.lower() not in TRACKING_PARAMS] |
| 323 | return urllib.parse.urlunsplit((p.scheme, p.netloc, p.path, urllib.parse.urlencode(q, doseq=True), p.fragment)) |
| 324 | except Exception: |
| 325 | return url |
| 326 | |
| 327 | |
| 328 | def is_blocked_url(url: str) -> bool: |
no outgoing calls
no test coverage detected