|
@@ -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 = [
|
|
|
|
|
- YOUTUBEDL_BINARY,
|
|
|
|
|
- *YOUTUBEDL_ARGS,
|
|
|
|
|
|
|
+ options = [
|
|
|
*([] 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'
|