diff --git a/files/classes/comment.py b/files/classes/comment.py index 96fe4b6e8..887023283 100644 --- a/files/classes/comment.py +++ b/files/classes/comment.py @@ -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