mirror of
https://github.com/ArchiveBox/ArchiveBox.git
synced 2025-05-13 06:34:25 -04:00
Add YOUTUBEDL_EXTRA_ARGS
This commit is contained in:
parent
4e69d2c9e1
commit
ab8f395e0a
3 changed files with 11 additions and 4 deletions
|
@ -176,6 +176,7 @@ CONFIG_SCHEMA: Dict[str, ConfigDefaultDict] = {
|
||||||
'--add-metadata',
|
'--add-metadata',
|
||||||
'--format=(bv*+ba/b)[filesize<={}][filesize_approx<=?{}]/(bv*+ba/b)'.format(c['MEDIA_MAX_SIZE'], c['MEDIA_MAX_SIZE']),
|
'--format=(bv*+ba/b)[filesize<={}][filesize_approx<=?{}]/(bv*+ba/b)'.format(c['MEDIA_MAX_SIZE'], c['MEDIA_MAX_SIZE']),
|
||||||
]},
|
]},
|
||||||
|
'YOUTUBEDL_EXTRA_ARGS': {'type': list, 'default': None},
|
||||||
|
|
||||||
|
|
||||||
'WGET_ARGS': {'type': list, 'default': ['--no-verbose',
|
'WGET_ARGS': {'type': list, 'default': ['--no-verbose',
|
||||||
|
|
|
@ -8,11 +8,13 @@ from ..system import run, chmod_file
|
||||||
from ..util import (
|
from ..util import (
|
||||||
enforce_types,
|
enforce_types,
|
||||||
is_static_file,
|
is_static_file,
|
||||||
|
dedupe,
|
||||||
)
|
)
|
||||||
from ..config import (
|
from ..config import (
|
||||||
MEDIA_TIMEOUT,
|
MEDIA_TIMEOUT,
|
||||||
SAVE_MEDIA,
|
SAVE_MEDIA,
|
||||||
YOUTUBEDL_ARGS,
|
YOUTUBEDL_ARGS,
|
||||||
|
YOUTUBEDL_EXTRA_ARGS,
|
||||||
YOUTUBEDL_BINARY,
|
YOUTUBEDL_BINARY,
|
||||||
YOUTUBEDL_VERSION,
|
YOUTUBEDL_VERSION,
|
||||||
CHECK_SSL_VALIDITY
|
CHECK_SSL_VALIDITY
|
||||||
|
@ -39,11 +41,15 @@ def save_media(link: Link, out_dir: Optional[Path]=None, timeout: int=MEDIA_TIME
|
||||||
output: ArchiveOutput = 'media'
|
output: ArchiveOutput = 'media'
|
||||||
output_path = out_dir / output
|
output_path = out_dir / output
|
||||||
output_path.mkdir(exist_ok=True)
|
output_path.mkdir(exist_ok=True)
|
||||||
cmd = [
|
options = [
|
||||||
YOUTUBEDL_BINARY,
|
|
||||||
*YOUTUBEDL_ARGS,
|
|
||||||
*([] if CHECK_SSL_VALIDITY else ['--no-check-certificate']),
|
*([] if CHECK_SSL_VALIDITY else ['--no-check-certificate']),
|
||||||
# TODO: add --cookies-from-browser={CHROME_USER_DATA_DIR}
|
# TODO: add --cookies-from-browser={CHROME_USER_DATA_DIR}
|
||||||
|
*YOUTUBEDL_EXTRA_ARGS,
|
||||||
|
*YOUTUBEDL_ARGS,
|
||||||
|
]
|
||||||
|
cmd = [
|
||||||
|
YOUTUBEDL_BINARY,
|
||||||
|
*dedupe(*options),
|
||||||
link.url,
|
link.url,
|
||||||
]
|
]
|
||||||
status = 'succeeded'
|
status = 'succeeded'
|
||||||
|
|
|
@ -69,7 +69,7 @@ def save_wget(link: Link, out_dir: Optional[Path]=None, timeout: int=TIMEOUT) ->
|
||||||
*([] if SAVE_WARC else ['--timestamping']),
|
*([] if SAVE_WARC else ['--timestamping']),
|
||||||
*([] if CHECK_SSL_VALIDITY else ['--no-check-certificate', '--no-hsts']),
|
*([] if CHECK_SSL_VALIDITY else ['--no-check-certificate', '--no-hsts']),
|
||||||
# '--server-response', # print headers for better error parsing
|
# '--server-response', # print headers for better error parsing
|
||||||
*WGET_EXTRA_ARGS,
|
*WGET_EXTRA_ARGS,
|
||||||
*WGET_ARGS,
|
*WGET_ARGS,
|
||||||
]
|
]
|
||||||
cmd = [
|
cmd = [
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue