2
0
Эх сурвалжийг харах

feat: Use CURL_ARGS in favicon extractor

Cristian 5 жил өмнө
parent
commit
563d0f94ec

+ 0 - 1
archivebox/config/__init__.py

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

+ 1 - 0
archivebox/extractors/archive_org.py

@@ -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']),

+ 2 - 3
archivebox/extractors/favicon.py

@@ -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']),

+ 1 - 0
archivebox/extractors/headers.py

@@ -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']),