mirror of
https://github.com/ArchiveBox/ArchiveBox.git
synced 2025-05-16 08:04:26 -04:00
add TODO to support archive.org-style urls
This commit is contained in:
parent
b56bfe57f1
commit
97b185987d
2 changed files with 8 additions and 1 deletions
|
@ -56,12 +56,18 @@ class SnapshotView(View):
|
|||
slug, archivefile = path.split('/', 1)[0], 'index.html'
|
||||
|
||||
# slug is a timestamp
|
||||
if slug.replace('.','').isdigit():
|
||||
if slug.replace('.', '').isdigit():
|
||||
|
||||
# missing trailing slash -> redirect to index
|
||||
if '/' not in path:
|
||||
return redirect(f'{path}/index.html')
|
||||
|
||||
# TODO: add support for archive.org-style URLs where timestamp may be a human-readable date
|
||||
# https://web.archivebox.io / web / 2022-01 / https://example.com
|
||||
# https://web.archivebox.io / web / 20220505103616 / https://example.com
|
||||
# https://web.archivebox.io / web / 2022-05-05__0:36:16 / https://example.com
|
||||
# use archivebox.util.parse_date (supports unix timestamps, iso date strings, and lots more etc.)
|
||||
|
||||
try:
|
||||
try:
|
||||
snapshot = Snapshot.objects.get(Q(timestamp=slug) | Q(id__startswith=slug))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue