This should hopefully fix redirect issue (Url normalization was the cause)
This commit is contained in:
parent
3d8423db96
commit
c89c575e0d
@ -111,7 +111,11 @@ def twitfix(sub_path):
|
|||||||
if match.start() == 0:
|
if match.start() == 0:
|
||||||
twitter_url = "https://twitter.com/" + sub_path
|
twitter_url = "https://twitter.com/" + sub_path
|
||||||
else:
|
else:
|
||||||
twitter_url = "https://" + sub_path
|
# URL normalization messes up the URL, so we have to fix it
|
||||||
|
if sub_path.startswith("https:/"):
|
||||||
|
twitter_url = sub_path.replace("https:/", "https://", 1)
|
||||||
|
elif sub_path.startswith("http:/"):
|
||||||
|
twitter_url = sub_path.replace("http:/", "http://", 1)
|
||||||
|
|
||||||
if isValidUserAgent(user_agent):
|
if isValidUserAgent(user_agent):
|
||||||
res = embedCombined(twitter_url)
|
res = embedCombined(twitter_url)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user