mirror of
https://github.com/ArchiveBox/ArchiveBox
synced 2024-11-25 21:50:21 +00:00
fix archive url calculation for urls ending in slash
This commit is contained in:
parent
747676dddd
commit
f0c7a6f558
1 changed files with 4 additions and 2 deletions
|
@ -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"""
|
||||
|
||||
|
|
Loading…
Reference in a new issue