Parse the http-equiv refresh parameter from the given response
(
response: TextResponse,
ignore_tags: Iterable[str] = ("script", "noscript"),
)
| 41 | |
| 42 | |
| 43 | def get_meta_refresh( |
| 44 | response: TextResponse, |
| 45 | ignore_tags: Iterable[str] = ("script", "noscript"), |
| 46 | ) -> tuple[None, None] | tuple[float, str]: |
| 47 | """Parse the http-equiv refresh parameter from the given response""" |
| 48 | if response not in _metaref_cache: |
| 49 | text = response.text[0:4096] |
| 50 | _metaref_cache[response] = html.get_meta_refresh( |
| 51 | text, get_base_url(response), response.encoding, ignore_tags=ignore_tags |
| 52 | ) |
| 53 | return _metaref_cache[response] |
| 54 | |
| 55 | |
| 56 | def response_status_message(status: bytes | float | str) -> str: |