diff --git a/spotdl/download/downloader.py b/spotdl/download/downloader.py index 57d816a51..c18d3c174 100644 --- a/spotdl/download/downloader.py +++ b/spotdl/download/downloader.py @@ -216,7 +216,7 @@ def __init__( proxy = self.settings["proxy"] proxies = None if proxy: - if not re.match(pattern=r"(http|https)://\d{1,5}", string=proxy): + if not re.match(pattern=r"^(http|https):\/\/(?:(\w+)(?::(\w+))?@)?((?:\d{1,3})(?:\.\d{1,3}){3})(?::(\d{1,5}))?$", string=proxy): raise DownloaderError(f"Invalid proxy server: {proxy}") proxies = {"http": proxy, "https": proxy} logger.info("Setting proxy server: %s", proxy)