diff --git a/app.py b/app.py
index 94e3045..6be13c0 100644
--- a/app.py
+++ b/app.py
@@ -205,6 +205,9 @@ def get_data(video_id, real_url):
def get_oembed_url(params):
"""Get the oEmbed (/owoembed) URL based on the given params (server response)"""
+ if not params:
+ return None
+
author_id = params.get('owner', {}).get('id')
author_name = params.get('owner', {}).get('nickname')
video_id = params.get('video', {}).get('id')
@@ -272,6 +275,8 @@ def proxy(video_id):
og_video_width = None
og_video_height = None
for tag in og_tags:
+ if 'data-server' in tag.attrs:
+ del tag.attrs['data-server']
# Fix thumbnail
if tag.get("property") == "og:image" and thumbnail_url:
tag["content"] = thumbnail_url
@@ -287,6 +292,7 @@ def proxy(video_id):
og_tags_str = "\n".join(str(tag) for tag in og_tags)
og_tags_str += '\n'
og_tags_str += '\n'
+ og_tags_str += '\n'
og_tags_str += f'\n'
if og_video_width:
og_tags_str += f'\n'