1
0
mirror of https://github.com/pirate/ArchiveBox.git synced 2025-08-29 17:19:53 +02:00

feat: Use CURL_ARGS in favicon extractor

This commit is contained in:
Cristian
2020-10-15 08:49:54 -05:00
committed by Cristian Vargas
parent 2e1cdca789
commit 563d0f94ec
4 changed files with 4 additions and 4 deletions

View File

@@ -133,7 +133,6 @@ CONFIG_DEFAULTS: Dict[str, ConfigDefaultDict] = {
]},
'CURL_ARGS': {'type': list, 'default': ['--silent',
'--location',
'--head',
'--compressed'
]}
},

View File

@@ -47,6 +47,7 @@ def save_archive_dot_org(link: Link, out_dir: Optional[Path]=None, timeout: int=
cmd = [
CURL_BINARY,
*CURL_ARGS,
'--head',
'--max-time', str(timeout),
*(['--user-agent', '{}'.format(CURL_USER_AGENT)] if CURL_USER_AGENT else []),
*([] if CHECK_SSL_VALIDITY else ['--insecure']),

View File

@@ -11,6 +11,7 @@ from ..config import (
TIMEOUT,
SAVE_FAVICON,
CURL_BINARY,
CURL_ARGS,
CURL_VERSION,
CHECK_SSL_VALIDITY,
CURL_USER_AGENT,
@@ -34,10 +35,8 @@ def save_favicon(link: Link, out_dir: Optional[Path]=None, timeout: int=TIMEOUT)
output: ArchiveOutput = 'favicon.ico'
cmd = [
CURL_BINARY,
'--silent',
*CURL_ARGS,
'--max-time', str(timeout),
'--location',
'--compressed',
'--output', str(output),
*(['--user-agent', '{}'.format(CURL_USER_AGENT)] if CURL_USER_AGENT else []),
*([] if CHECK_SSL_VALIDITY else ['--insecure']),

View File

@@ -43,6 +43,7 @@ def save_headers(link: Link, out_dir: Optional[str]=None, timeout: int=TIMEOUT)
cmd = [
CURL_BINARY,
*CURL_ARGS,
'--head',
'--max-time', str(timeout),
*(['--user-agent', '{}'.format(CURL_USER_AGENT)] if CURL_USER_AGENT else []),
*([] if CHECK_SSL_VALIDITY else ['--insecure']),