浏览代码

dont fetch titles when FETCH_TITLE=False

Nick Sweeting 6 年之前
父节点
当前提交
34cfde0c4e
共有 1 个文件被更改,包括 4 次插入0 次删除
  1. 4 0
      archivebox/util.py

+ 4 - 0
archivebox/util.py

@@ -30,6 +30,7 @@ from config import (
     FETCH_SCREENSHOT,
     FETCH_SCREENSHOT,
     FETCH_DOM,
     FETCH_DOM,
     FETCH_FAVICON,
     FETCH_FAVICON,
+    FETCH_TITLE,
     FETCH_MEDIA,
     FETCH_MEDIA,
     SUBMIT_ARCHIVE_DOT_ORG,
     SUBMIT_ARCHIVE_DOT_ORG,
 )
 )
@@ -237,6 +238,9 @@ def download_url(url):
 
 
 def fetch_page_title(url, timeout=10, progress=SHOW_PROGRESS):
 def fetch_page_title(url, timeout=10, progress=SHOW_PROGRESS):
     """Attempt to guess a page's title by downloading the html"""
     """Attempt to guess a page's title by downloading the html"""
+    if not FETCH_TITLE:
+        return None
+
     try:
     try:
         if progress:
         if progress:
             sys.stdout.write('.')
             sys.stdout.write('.')