diff --git a/app.py b/app.py index 8e64f97..a41cd68 100644 --- a/app.py +++ b/app.py @@ -368,12 +368,12 @@ def proxy(video_id): og_tags_str += f'\n<link rel="alternate" href="{get_oembed_url(params)}" type="application/json+oembed" title="{video_id}"/>' # Discord seems to ignore video URLs when Twitter meta tags are present, - # so in addition to including these when the User Agent is a Twitter bot, + # so in addition to including these when the User Agent is a Twitterbot, # we also include them when the video is too long to download in order to remove the play button. if 'twitterbot' in request_user_agent or not download_allowed: if 'twitterbot' in request_user_agent: logger.info(f"{video_id}: Twitterbot detected - adding Twitter tags") - if not download_allowed: + elif not download_allowed: logger.info(f"{video_id}: Video too long to download - will not show play button") og_tags_str += f'\n<meta content="{thumbnail_url}" property="twitter:image"/>' og_tags_str += '\n<meta content="summary_large_image" property="twitter:card"/>'