From f6b13327f0329b771709a0550895810b91f6cf39 Mon Sep 17 00:00:00 2001 From: Patrick Robertson Date: Thu, 13 Mar 2025 16:03:52 +0000 Subject: [PATCH] Tweaks and additional debug logging --- .../modules/generic_extractor/generic_extractor.py | 3 ++- src/auto_archiver/utils/webdriver.py | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/auto_archiver/modules/generic_extractor/generic_extractor.py b/src/auto_archiver/modules/generic_extractor/generic_extractor.py index 56164ff..a75e874 100644 --- a/src/auto_archiver/modules/generic_extractor/generic_extractor.py +++ b/src/auto_archiver/modules/generic_extractor/generic_extractor.py @@ -346,9 +346,10 @@ class GenericExtractor(Extractor): ydl_options.extend(('--cookies', auth['cookies_file'])) if self.ytdlp_args: + logger.debug("Adding additional ytdlp arguments: {self.ytdlp_args}") ydl_options += self.ytdlp_args.split(" ") - _, _, _, validated_options = yt_dlp.parse_options(ydl_options) + *_, validated_options = yt_dlp.parse_options(ydl_options) ydl = yt_dlp.YoutubeDL(validated_options) # allsubtitles and subtitleslangs not working as expected, so default lang is always "en" for info_extractor in self.suitable_extractors(url): diff --git a/src/auto_archiver/utils/webdriver.py b/src/auto_archiver/utils/webdriver.py index ccfead5..57f2cf1 100644 --- a/src/auto_archiver/utils/webdriver.py +++ b/src/auto_archiver/utils/webdriver.py @@ -48,7 +48,7 @@ class CookieSettingDriver(webdriver.Firefox): for name, value in cookie.split("="): self.driver.add_cookie({'name': name, 'value': value}) elif self.cookiejar: - domain = urlparse(url).netloc.lstrip("www.") + domain = urlparse(url).netloc regex = re.compile(f"(www)?\.?{domain}$") for cookie in self.cookiejar: if regex.match(cookie.domain):