Add COOKIES_FILE support for singlefile extractor

This commit is contained in:
Naomi Phillips 2024-03-03 02:32:46 -05:00
parent f02b27920c
commit a729480b75
No known key found for this signature in database
GPG key ID: 85913DB4345B4BA7

View file

@ -19,6 +19,7 @@ from ..config import (
SINGLEFILE_VERSION,
SINGLEFILE_ARGS,
CHROME_BINARY,
COOKIES_FILE,
)
from ..logging_util import TimedProgress
@ -48,6 +49,7 @@ def save_singlefile(link: Link, out_dir: Optional[Path]=None, timeout: int=TIMEO
browser_args = '--browser-args={}'.format(json.dumps(browser_args[1:]))
options = [
*SINGLEFILE_ARGS,
*(["--browser-cookies-file={}".format(COOKIES_FILE)] if COOKIES_FILE else []),
'--browser-executable-path={}'.format(CHROME_BINARY),
browser_args,
]