mirror of
https://github.com/ArchiveBox/ArchiveBox.git
synced 2025-05-14 07:04:27 -04:00
fix permissions, output html, and timeouts
This commit is contained in:
parent
a9d6a95c73
commit
2d8364a7c7
2 changed files with 5 additions and 4 deletions
|
@ -160,6 +160,7 @@ def fetch_pdf(out_dir, link, overwrite=False):
|
|||
chrome_args = '--headless --disable-gpu --print-to-pdf'.split(' ')
|
||||
try:
|
||||
run([CHROME_BINARY, *chrome_args, link['url']], stdout=DEVNULL, stderr=DEVNULL, cwd=out_dir, timeout=20) # output.pdf
|
||||
run(['chmod', '755', 'output.pdf'], timeout=5)
|
||||
except Exception as e:
|
||||
print(' Exception: {} {}'.format(e.__class__.__name__, e))
|
||||
else:
|
||||
|
@ -172,6 +173,7 @@ def fetch_screenshot(out_dir, link, overwrite=False):
|
|||
chrome_args = '--headless --disable-gpu --screenshot'.split(' ')
|
||||
try:
|
||||
run([CHROME_BINARY, *chrome_args, '--window-size={}'.format(RESOLUTION), link['url']], stdout=DEVNULL, stderr=DEVNULL, cwd=out_dir, timeout=20) # sreenshot.png
|
||||
run(['chmod', '755', 'screenshot.png'], timeout=5)
|
||||
except Exception as e:
|
||||
print(' Exception: {} {}'.format(e.__class__.__name__, e))
|
||||
else:
|
||||
|
@ -384,7 +386,7 @@ def create_archive(export_file, service=None, resume=None):
|
|||
|
||||
dump_index(links, service)
|
||||
|
||||
run(['chmod', '-R', '755', service], timeout=10)
|
||||
run(['chmod', '-R', '755', service], timeout=30)
|
||||
|
||||
print('[*] [{}] Created archive index with {} links.'.format(datetime.now().strftime('%Y-%m-%d %H:%M:%S'), len(links)))
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue