Skip to main content

URLAnalyzer

A class that analyzes URLs to determine if they point to web pages or files.
Initialize the URLAnalyzer with a URL.
Parameters:

Class Attributes

FormatToMimeType



MimeTypeToFormat



format_type



mime_type



mime_types



Static Methods

get_supported_extensions

Return a list of supported file extensions.

get_supported_formats

Return a list of supported file formats.

get_supported_mime_types

Return a list of all supported MIME types.

Instance Methods

analyze

Analyze the URL to determine if it points to a web page or a file.
Parameters: Returns:

follow_redirects

Follow redirects for the URL without analyzing content types.
Returns:
Tuple[str, list[str]]: The final URL and the redirect chain
Returns:

get_redirect_info

Get information about redirects that occurred during the last request.
Returns:
dict: Information about redirects
Returns:

get_result

Get the last analysis result, or None if the URL hasn’t been analyzed yet.
Returns:
Optional[dict]: The analysis result or None
Returns: