Remove title and category from OG description

This commit is contained in:
MMaker 2025-03-03 13:14:12 -05:00
parent aa755dc186
commit 6a78b81084
Signed by: mmaker
GPG Key ID: CCE79B8FEDA40FB2

3
app.py
View File

@ -1,6 +1,7 @@
import os
import http.cookiejar
import json
import re
import requests
from bs4 import BeautifulSoup
from flask import Flask, Response, request, jsonify
@ -364,6 +365,8 @@ def proxy(video_id):
if og_title:
og_tags_str += f'\n<meta content="{og_title}" name="twitter:title"/>'
if og_description:
if og_title:
og_description = re.sub(rf"^{re.escape(og_title)}(\s+\[.*?\])?\s+", "", og_description)
og_tags_str += f'\n<meta content="{og_description}" name="twitter:description"/>'
# og_tags_str += '\n<meta content="video/mp4" property="twitter:player:stream:content_type"/>'
# og_tags_str += f'\n<meta content="{cdn_video_url}" property="twitter:player:stream"/>'