df
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user