Compare commits

..

5 commits

Author SHA1 Message Date
9a80555a13 chore(deps): lock file maintenance
Some checks are pending
renovate/stability-days Updates have not met minimum release age requirement
2026-06-20 17:52:26 +00:00
irl
71b478a2e2 feat(kldscp): additional supported domains 2026-06-18 16:05:20 +01:00
irl
fc8183d464 fix(snapshots): do not escape anchor tag in banner text 2026-06-18 09:50:41 +01:00
irl
f5b6843968 fix(snapshots): ignore images with no content-type from server 2026-06-18 09:44:46 +01:00
irl
b4df8218ff feat(snapshots): increase max image size to 2.5M 2026-06-18 09:44:46 +01:00
3 changed files with 9 additions and 3 deletions

View file

@ -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",
]

View file

@ -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

View file

@ -88,7 +88,7 @@
</div>
</summary>
<div class="snap-trust-header__content">
{{ gettext('This story is a copy of an article from <a href="{site_url}" class="snap-trust-header__sitelink">{site_title}</a>. It is delivered to you from a trusted archive to assure its availability over time.').format(site_url=site_url, site_title=site_title) }} <p>
{{ gettext('This story is a copy of an article from <a href="{site_url}" class="snap-trust-header__sitelink">{site_title}</a>. 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 }} <p>
<a href="{{ article_url }}" class="snap-footer-link">
{{ gettext("View the article source") }}
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">