From f0c7a6f55804b85c73bf33c401f83bc342c554f1 Mon Sep 17 00:00:00 2001 From: Nick Sweeting Date: Tue, 4 Jul 2017 04:09:00 -0500 Subject: [PATCH] fix archive url calculation for urls ending in slash --- archive.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/archive.py b/archive.py index 7038d772..da53aff1 100755 --- a/archive.py +++ b/archive.py @@ -338,11 +338,13 @@ def calculate_archive_url(link): return link['base_url'] else: # .html needs to be appended - url = split_url[0] if not split_url[0].endswith('/') else split_url[0][:-1] - without_scheme = url.split('://', 1)[-1] + without_scheme = split_url[0].split('://', 1)[-1] + if url.endswith('/'): + return '#'.join([without_scheme + 'index.html', *split_url[1:]]) return '#'.join([without_scheme + '.html', *split_url[1:]]) + def dump_index(links, service): """create index.html file for a given list of links and service"""