diff --git a/app.py b/app.py
index 80ce5e8..adb2273 100644
--- a/app.py
+++ b/app.py
@@ -331,10 +331,18 @@ 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
@@ -343,8 +351,14 @@ 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 += '\n'
- # og_tags_str += '\n'
+ 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 += f'\n'
# if video_width: