kopia lustrzana https://github.com/bellingcat/auto-archiver
fix the UTF-8 issue for cyrilic
rodzic
398f296789
commit
576f1a8f68
|
@ -48,7 +48,7 @@ class Archiver(ABC):
|
|||
return self.get_key(urlparse(url).path.replace("/", "_") + ".html")
|
||||
|
||||
def generate_media_page_html(self, url, urls_info: dict, object, thumbnail=None):
|
||||
page = f'''<html><head><title>{url}</title></head>
|
||||
page = f'''<html><head><title>{url}</title><meta charset="UTF-8"></head>
|
||||
<body>
|
||||
<h2>Archived media from {self.name}</h2>
|
||||
<h3><a href="{url}">{url}</a></h3><ul>'''
|
||||
|
@ -101,6 +101,7 @@ class Archiver(ABC):
|
|||
uploaded_media.append({'cdn_url': cdn_url, 'key': key, 'hash': hash})
|
||||
|
||||
return self.generate_media_page_html(url, uploaded_media, object, thumbnail=thumbnail)
|
||||
|
||||
def get_key(self, filename):
|
||||
"""
|
||||
returns a key in the format "[archiverName]_[filename]" includes extension
|
||||
|
@ -178,7 +179,7 @@ class Archiver(ABC):
|
|||
|
||||
key_thumb = cdn_urls[int(len(cdn_urls) * 0.1)]
|
||||
|
||||
index_page = f'''<html><head><title>{filename}</title></head>
|
||||
index_page = f'''<html><head><title>{filename}</title><meta charset="UTF-8"></head>
|
||||
<body>'''
|
||||
|
||||
for t in cdn_urls:
|
||||
|
|
Ładowanie…
Reference in New Issue