diff --git a/twitfix.py b/twitfix.py index fcdc5c2..70ef6ee 100644 --- a/twitfix.py +++ b/twitfix.py @@ -76,6 +76,9 @@ def message(text): url = config['config']['url'] ) def generateActivityLink(tweetData,media=None,mediatype=None,embedIndex=-1): + global user_agent + if 'LegacyEmbed' in user_agent: # TODO: Clean up; This is a hacky fix to make the new activity embed not trigger + return None try: embedIndex = embedIndex+1 return f"{config['config']['url']}/users/{tweetData['user_screen_name']}/statuses/{str(embedIndex)}{tweetData['tweetID']}" @@ -300,6 +303,8 @@ def twitfix(sub_path): user_agent = "unknown" isApiRequest=request.url.startswith("https://api.vx") or request.url.startswith("http://api.vx") + if not isApiRequest and request.url.startswith("https://l.vx") and "Discord" in user_agent: + user_agent = user_agent.replace("Discord","LegacyEmbed") # TODO: Clean up; This is a hacky fix to make the new activity embed not trigger if sub_path in staticFiles: if 'path' not in staticFiles[sub_path] or staticFiles[sub_path]["path"] == None: staticFiles[sub_path]["path"] = sub_path