forked from MarseyWorld/MarseyWorld
master
parent
4056ce1e91
commit
619bdba5b2
|
@ -23,8 +23,7 @@ def normalize_urls_runtime(body, v):
|
|||
if v.reddit != 'old.reddit.com':
|
||||
body = reddit_to_vreddit_regex.sub(rf'\1https://{v.reddit}/\2/', body)
|
||||
if v.nitter:
|
||||
body = body.replace('https://twitter.com/', 'https://nitter.lacontrevoie.fr/')
|
||||
body = body.replace('https://nitter.lacontrevoie.fr/i/', 'https://twitter.com/i/')
|
||||
body = twitter_to_nitter_regex.sub(r'\1https://nitter.lacontrevoie.fr/', body)
|
||||
if v.imginn:
|
||||
body = body.replace('https://instagram.com/p/', 'https://imginn.com/p/')
|
||||
return body
|
||||
|
|
|
@ -101,6 +101,7 @@ greentext_regex = re.compile("(\n|^)>([^ >][^\n]*)", flags=re.A)
|
|||
ascii_only_regex = re.compile("[ -~]+", flags=re.A)
|
||||
|
||||
reddit_to_vreddit_regex = re.compile('(^|>|")https:\/\/old.reddit.com\/(r|u)\/', flags=re.A)
|
||||
twitter_to_nitter_regex = re.compile('(^|>|")https:\/\/twitter.com\/(?!i\/)', flags=re.A)
|
||||
reddit_domain_regex = re.compile("(^|\s|\()https?:\/\/(reddit\.com|(?:(?:[A-z]{2})(?:-[A-z]{2})" "?|beta|i|m|pay|ssl|www|new|alpha)\.reddit\.com|libredd\.it|teddit\.net)\/(r|u)\/", flags=re.A)
|
||||
|
||||
color_regex = re.compile("[a-f0-9]{6}", flags=re.A)
|
||||
|
|
Loading…
Reference in New Issue