Browse Source

search for node dependencies in output dir first

Nick Sweeting 5 năm trước cách đây
mục cha
commit
7144e0bdce

+ 1 - 1
archivebox/config/__init__.py

@@ -780,7 +780,7 @@ globals().update(CONFIG)
 os.environ["TZ"] = 'UTC'
 
 # add ./node_modules/.bin to $PATH so we can use node scripts in extractors
-NODE_BIN_PATH = str((Path(CONFIG["OUTPUT_DIR"]) / 'node_modules' / '.bin').resolve())
+NODE_BIN_PATH = str((Path(CONFIG["OUTPUT_DIR"]).absolute() / 'node_modules' / '.bin'))
 sys.path.append(NODE_BIN_PATH)
 
 

+ 2 - 2
archivebox/extractors/readability.py

@@ -17,7 +17,7 @@ from ..util import (
 from ..config import (
     TIMEOUT,
     SAVE_READABILITY,
-    READABILITY_BINARY,
+    DEPENDENCIES,
     READABILITY_VERSION,
 )
 from ..logging_util import TimedProgress
@@ -73,7 +73,7 @@ def save_readability(link: Link, out_dir: Optional[str]=None, timeout: int=TIMEO
         temp_doc.close()
 
         cmd = [
-            READABILITY_BINARY,
+            DEPENDENCIES['READABILITY_BINARY']['path'],
             temp_doc.name
         ]
 

+ 2 - 2
archivebox/extractors/singlefile.py

@@ -15,7 +15,7 @@ from ..util import (
 from ..config import (
     TIMEOUT,
     SAVE_SINGLEFILE,
-    SINGLEFILE_BINARY,
+    DEPENDENCIES,
     SINGLEFILE_VERSION,
     CHROME_BINARY,
 )
@@ -43,7 +43,7 @@ def save_singlefile(link: Link, out_dir: Optional[str]=None, timeout: int=TIMEOU
 
     # SingleFile CLI Docs: https://github.com/gildas-lormeau/SingleFile/tree/master/cli
     cmd = [
-        SINGLEFILE_BINARY,
+        DEPENDENCIES['SINGLEFILE_BINARY']['path'],
         '--browser-executable-path={}'.format(CHROME_BINARY),
         '--browser-args="{}"'.format(json.dumps(browser_args[1:])),
         link.url,