1
0
Fork 0
mirror of synced 2024-05-16 10:23:51 +12:00

fix permissions, output html, and timeouts

This commit is contained in:
Nick Sweeting 2017-06-15 18:49:16 -05:00
parent a9d6a95c73
commit 2d8364a7c7
2 changed files with 5 additions and 4 deletions

View file

@ -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)))

View file

@ -68,15 +68,14 @@
<img src="https://nicksweeting.com/images/archive.png" height="36px">
Archived Sites <img src="https://getpocket.com/favicon.ico" height="36px"> <br/>
<small>
Via: <a href="https://getpocket.com/export">getpocket.com/export</a> + <a href="https://github.com/pirate/bookmark-archiver">archive_pocket.py</a>
| <a href="https://getpocket.com/users/USERNAME/feed/all">RSS Feed</a>
Exported with: <a href="https://github.com/pirate/bookmark-archiver">Bookmark Archiver</a>
</small>
</h1>
</header>
<table style="width:100%;height: 90%; overflow-y: scroll;table-layout: fixed">
<thead>
<tr>
<th style="width: 120px;"><img src="https://getpocket.com/favicon.ico" height="12px"> Date Starred</th>
<th style="width: 120px;"><img src="https://getpocket.com/favicon.ico" height="12px"> Starred</th>
<th style="width: 45vw;">Saved Article</th>
<th style="width: 50px">Files</th>
<th style="width: 50px">PDF</th>