Fixed issue where file extenions not found and auth timeout

This commit is contained in:
2025-10-24 13:43:03 +13:00
parent 7580dc3f94
commit 6d9a078656
12 changed files with 1272 additions and 15 deletions
@@ -24,8 +24,14 @@ from bdfr.site_downloaders.youtube import Youtube
class DownloadFactory:
@staticmethod
def pull_lever(url: str) -> type[BaseDownloader]:
import logging
logger = logging.getLogger(__name__)
sanitised_url = DownloadFactory.sanitise_url(url).lower()
logger.debug(f"Selecting downloader for URL: {url} (sanitized: {sanitised_url})")
if re.match(r"(i\.|m\.|o\.)?imgur", sanitised_url):
logger.debug("Using Imgur downloader")
return Imgur
elif re.match(r"(i\.|thumbs\d\.|v\d\.)?(redgifs|gifdeliverynetwork)", sanitised_url):
return Redgifs