diff --git a/src/kldscp/client.py b/src/kldscp/client.py index 3e4ad01..95fcd5a 100644 --- a/src/kldscp/client.py +++ b/src/kldscp/client.py @@ -4,6 +4,7 @@ import requests KLDSCP_SUPPORTED_ORIGINS = [ "amnezia.org", + "belsat.eu", "doxa.team", "holod.media", "memorialcenter.org", @@ -12,6 +13,9 @@ KLDSCP_SUPPORTED_ORIGINS = [ "semnasem.org", "theins.ru", "thenewtab.io", + "thenewtab.support", + "vot-tak.tv", + "vpnpay.io", "zaodno.org", ] diff --git a/src/snapshots/client.py b/src/snapshots/client.py index 5461cc2..3c1a337 100644 --- a/src/snapshots/client.py +++ b/src/snapshots/client.py @@ -64,16 +64,18 @@ def fetch_url(base: str, url: str) -> str | None: content_length = response.headers.get("Content-Length") if content_length is not None: try: - if int(content_length) > 500_000: + if int(content_length) > 2_500_000: return None except ValueError: pass # Invalid Content-Length format, proceed to stream content = b"" for chunk in response.iter_content(chunk_size=1024): content += chunk - if len(content) > 500_000: + if len(content) > 2_500_000: return None content_type = response.headers.get("Content-Type", "") + if content_type == "": + return None return encode_data_uri(content, content_type) except requests.exceptions.RequestException: return None diff --git a/src/snapshots/templates/article-template.html.j2 b/src/snapshots/templates/article-template.html.j2 index 191f6d5..cedd0eb 100644 --- a/src/snapshots/templates/article-template.html.j2 +++ b/src/snapshots/templates/article-template.html.j2 @@ -88,7 +88,7 @@
+ {{ gettext('This story is a copy of an article from {site_title}. It is delivered to you from a trusted archive to assure its availability over time.').format(site_url=site_url, site_title=site_title) | safe }}