get_valid_url

get_valid_url(env_var: str, default: str | list[str]) str | list[str][source]

Fetches one or more URLs from an environment variable. If a comma-delimited string is provided, it is split and each URL is validated. Falls back to the default if any URL is invalid or not set.

Parameters:
  • env_var -- The name of the environment variable.

  • default -- A single default URL or a list of default URLs.

Returns:

A valid URL string or a list of valid URL strings.