only allow imginn replacement for posts, since other types of content arent supported by it

pull/92/head
Aevann 2023-01-23 08:28:54 +02:00
parent 90752abd2c
commit 0c5c97a1f8
2 changed files with 2 additions and 2 deletions

View File

@ -25,7 +25,7 @@ def normalize_urls_runtime(body, v):
body = body.replace('https://twitter.com/', 'https://nitter.lacontrevoie.fr/') body = body.replace('https://twitter.com/', 'https://nitter.lacontrevoie.fr/')
body = body.replace('https://nitter.lacontrevoie.fr/i/', 'https://twitter.com/i/') body = body.replace('https://nitter.lacontrevoie.fr/i/', 'https://twitter.com/i/')
if v.imginn: 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 return body
class Comment(Base): class Comment(Base):

View File

@ -40,7 +40,7 @@ def archive_url(url):
url = url.replace('https://twitter.com/', 'https://nitter.lacontrevoie.fr/') url = url.replace('https://twitter.com/', 'https://nitter.lacontrevoie.fr/')
gevent.spawn(_archiveorg, url) gevent.spawn(_archiveorg, url)
if url.startswith('https://instagram.com/'): 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) gevent.spawn(_archiveorg, url)
def execute_snappy(post:Submission, v:User): def execute_snappy(post:Submission, v:User):