From 0c5c97a1f8426f4e82bf4d7383e1e19801edaaba Mon Sep 17 00:00:00 2001 From: Aevann Date: Mon, 23 Jan 2023 08:28:54 +0200 Subject: [PATCH] only allow imginn replacement for posts, since other types of content arent supported by it --- files/classes/comment.py | 2 +- files/helpers/actions.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/files/classes/comment.py b/files/classes/comment.py index a8d668e21..d061abc58 100644 --- a/files/classes/comment.py +++ b/files/classes/comment.py @@ -25,7 +25,7 @@ def normalize_urls_runtime(body, v): body = body.replace('https://twitter.com/', 'https://nitter.lacontrevoie.fr/') body = body.replace('https://nitter.lacontrevoie.fr/i/', 'https://twitter.com/i/') if v.imginn: - body = body.replace('https://instagram.com/', 'https://imginn.com/') + body = body.replace('https://instagram.com/p/', 'https://imginn.com/p/') return body class Comment(Base): diff --git a/files/helpers/actions.py b/files/helpers/actions.py index 7e26139e6..e2f982c84 100644 --- a/files/helpers/actions.py +++ b/files/helpers/actions.py @@ -40,7 +40,7 @@ def archive_url(url): url = url.replace('https://twitter.com/', 'https://nitter.lacontrevoie.fr/') gevent.spawn(_archiveorg, url) if url.startswith('https://instagram.com/'): - url = url.replace('https://instagram.com/', 'https://imginn.com/') + url = url.replace('https://instagram.com/p/', 'https://imginn.com/p/') gevent.spawn(_archiveorg, url) def execute_snappy(post:Submission, v:User):