Quick fix for small mistake

This commit is contained in:
Dylan 2023-07-02 16:16:19 +01:00
parent c89c575e0d
commit 14bc95ba54

View File

@ -112,9 +112,9 @@ def twitfix(sub_path):
twitter_url = "https://twitter.com/" + sub_path twitter_url = "https://twitter.com/" + sub_path
else: else:
# URL normalization messes up the URL, so we have to fix it # URL normalization messes up the URL, so we have to fix it
if sub_path.startswith("https:/"): if sub_path.startswith("https:/") and not sub_path.startswith("https://"):
twitter_url = sub_path.replace("https:/", "https://", 1) twitter_url = sub_path.replace("https:/", "https://", 1)
elif sub_path.startswith("http:/"): elif sub_path.startswith("http:/") and not sub_path.startswith("http://"):
twitter_url = sub_path.replace("http:/", "http://", 1) twitter_url = sub_path.replace("http:/", "http://", 1)
if isValidUserAgent(user_agent): if isValidUserAgent(user_agent):