diff --git a/app/main.py b/app/main.py index 8c01d6d..2361d6a 100644 --- a/app/main.py +++ b/app/main.py @@ -34,7 +34,6 @@ app.add_middleware(AuthMiddleware) settings = get_settings() mimetypes.add_type("image/webp", ".webp") app.mount("/media", StaticFiles(directory=settings.media_path, check_dir=False), name="media") -app.mount("/videos", StaticFiles(directory=settings.videos_path, check_dir=False), name="videos") app.mount("/posts-static", StaticFiles(directory=settings.posts_path, check_dir=False), name="posts-static") admin_dist = Path("/app/admin_dist") diff --git a/app/rss.py b/app/rss.py index 81abc2a..0ec219a 100644 --- a/app/rss.py +++ b/app/rss.py @@ -1,8 +1,7 @@ from datetime import datetime, timezone from html import escape, unescape -from pathlib import Path import re -from urllib.parse import quote, urlencode +from urllib.parse import urlencode from sqlalchemy import select from sqlalchemy.orm import Session @@ -48,22 +47,21 @@ def vk_video_embed_url(source_url: str) -> str | None: return f"https://vkvideo.ru/video_ext.php?{urlencode(params)}" -def video_embed_html(article: Article, rss_safe: bool = False, video_url: str | None = None) -> str: +def video_embed_html(article: Article, rss_safe: bool = False) -> str: if not article.video or not article.video.source_url: return "" embed_url = vk_video_embed_url(article.video.source_url) if rss_safe: - if video_url: - video = ( - f'" + iframe = "" + if embed_url: + iframe = ( + f'
' ) - else: - video = "" return f"""