Attempt to fix #107 (Cannot replicate locally)

This commit is contained in:
Dylan
2023-07-02 14:56:14 +01:00
parent 45f272f218
commit 8133482d49
3 changed files with 9 additions and 6 deletions

View File

@ -61,8 +61,11 @@ def oembedend():
@app.route('/<path:sub_path>') # Default endpoint used by everything
def twitfix(sub_path):
user_agent = request.headers.get('user-agent')
match = pathregex.search(sub_path)
if match is not None:
sub_path = match.group(0)
if request.url.endswith(".mp4") or request.url.endswith("%2Emp4"):
twitter_url = "https://twitter.com/" + sub_path