From a07da68e4f9f85e2220a7021f88608d26b886a5f Mon Sep 17 00:00:00 2001 From: MMaker Date: Mon, 3 Mar 2025 12:46:25 -0500 Subject: [PATCH] Revert "Attempt to fix Twitter card display" This reverts commit 6e41e842fd0f1ebacf6001ef8125465708f080a2. --- app.py | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) diff --git a/app.py b/app.py index adb2273..80ce5e8 100644 --- a/app.py +++ b/app.py @@ -331,18 +331,10 @@ def proxy(video_id): cdn_video_url = get_cdn_url(video_id) og_tags = soup.find_all("meta", attrs={"property": True}) - og_title = None - og_description = None for tag in og_tags: # Remove attribute(s) added by niconico if 'data-server' in tag.attrs: del tag.attrs['data-server'] - # Set title - if tag.get("property") == "og:title": - og_title = tag["content"] - # Set description - if tag.get("property") == "og:description": - og_description = tag["content"] # Fix thumbnail if tag.get("property") == "og:image" and thumbnail_url: tag["content"] = thumbnail_url @@ -351,14 +343,8 @@ def proxy(video_id): tag["content"] = cdn_video_url og_tags_str = "\n".join(str(tag) for tag in og_tags if tag.get("property") not in ["og:site_name"]) - og_tags_str += f'\n' - og_tags_str += '\n' - og_tags_str += '\n' - og_tags_str += f'\n' - if og_title: - og_tags_str += f'\n' - if og_description: - og_tags_str += f'\n' + # og_tags_str += '\n' + # og_tags_str += '\n' # og_tags_str += '\n' # og_tags_str += f'\n' # if video_width: