This commit is contained in:
2026-02-07 14:58:13 -08:00
parent c8230cbb42
commit 60c2cc062c
9 changed files with 69 additions and 78 deletions

View File

@@ -309,15 +309,10 @@ def get_provider_credentials(config: Dict[str, Any], provider: str) -> Optional[
def resolve_cookies_path(
config: Dict[str, Any], script_dir: Optional[Path] = None
) -> Optional[Path]:
# Support both legacy top-level `cookies=...` and the modular conf style:
# Only support modular config style:
# [tool=ytdlp]
# cookies="C:\\path\\cookies.txt"
values: list[Any] = []
try:
values.append(config.get("cookies"))
except Exception as exc:
logger.debug("resolve_cookies_path: failed to read top-level cookies: %s", exc, exc_info=True)
try:
tool = config.get("tool")
if isinstance(tool, dict):
@@ -328,14 +323,6 @@ def resolve_cookies_path(
except Exception as exc:
logger.debug("resolve_cookies_path: failed to read tool.ytdlp cookies: %s", exc, exc_info=True)
try:
ytdlp_block = config.get("ytdlp")
if isinstance(ytdlp_block, dict):
values.append(ytdlp_block.get("cookies"))
values.append(ytdlp_block.get("cookiefile"))
except Exception as exc:
logger.debug("resolve_cookies_path: failed to read ytdlp cookies block: %s", exc, exc_info=True)
base_dir = script_dir or SCRIPT_DIR
for value in values:
if not value: