fix /r/place links
parent
9fea2f21da
commit
7a0d2c7936
|
@ -19,15 +19,18 @@ from files.helpers.sorting_and_time import *
|
|||
from .saves import CommentSaveRelationship
|
||||
|
||||
def normalize_urls_runtime(body, v):
|
||||
body = body.replace('https://old.reddit.com/r/place', 'https://new.reddit.com/r/place')
|
||||
|
||||
if not v: return body
|
||||
|
||||
if v.reddit != 'old.reddit.com':
|
||||
body = reddit_to_vreddit_regex.sub(rf'\1https://{v.reddit}/\2/', body)
|
||||
if v.nitter:
|
||||
body = twitter_to_nitter_regex.sub(r'\1https://nitter.lacontrevoie.fr/', body)
|
||||
if v.imginn:
|
||||
body = body.replace('https://instagram.com/', 'https://imginn.com/')
|
||||
|
||||
body = body.replace('https://old.reddit.com/r/place', 'https://new.reddit.com/r/place')
|
||||
|
||||
body = body.replace(f'https://{v.reddit}/r/place', 'https://new.reddit.com/r/place')
|
||||
|
||||
return body
|
||||
|
||||
|
|
Loading…
Reference in New Issue