forked from rDrama/rDrama
fix /r/place links
parent
9fea2f21da
commit
7a0d2c7936
|
@ -19,7 +19,10 @@ from files.helpers.sorting_and_time import *
|
||||||
from .saves import CommentSaveRelationship
|
from .saves import CommentSaveRelationship
|
||||||
|
|
||||||
def normalize_urls_runtime(body, v):
|
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 not v: return body
|
||||||
|
|
||||||
if v.reddit != 'old.reddit.com':
|
if v.reddit != 'old.reddit.com':
|
||||||
body = reddit_to_vreddit_regex.sub(rf'\1https://{v.reddit}/\2/', body)
|
body = reddit_to_vreddit_regex.sub(rf'\1https://{v.reddit}/\2/', body)
|
||||||
if v.nitter:
|
if v.nitter:
|
||||||
|
@ -27,7 +30,7 @@ def normalize_urls_runtime(body, v):
|
||||||
if v.imginn:
|
if v.imginn:
|
||||||
body = body.replace('https://instagram.com/', 'https://imginn.com/')
|
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
|
return body
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue