From e03f40d72801b8954cd378aaf0e595ccb29f8091 Mon Sep 17 00:00:00 2001 From: Astounds Date: Fri, 27 Mar 2026 21:23:03 -0500 Subject: fix error handling, null URLs in templates, and Radio playlist support - Global error handler: friendly messages for 429, 502, 403, 400 instead of raw tracebacks. Filter FetchError from Flask logger. - Fix None URLs in templates: protect href/src in common_elements, playlist, watch, and comments templates against None values. - Radio playlists (RD...): redirect /playlist?list=RD... to /watch?v=...&list=RD... since YouTube only supports them in player. - Wrap player client fallbacks (ios, tv_embedded) in try/catch so a failed fallback doesn't crash the whole page. --- youtube/templates/comments.html | 4 ++-- youtube/templates/common_elements.html | 4 ++-- youtube/templates/playlist.html | 6 ++++++ youtube/templates/watch.html | 4 ++++ 4 files changed, 14 insertions(+), 4 deletions(-) (limited to 'youtube/templates') diff --git a/youtube/templates/comments.html b/youtube/templates/comments.html index 7bd75e5..4728a0a 100644 --- a/youtube/templates/comments.html +++ b/youtube/templates/comments.html @@ -3,13 +3,13 @@ {% macro render_comment(comment, include_avatar, timestamp_links=False) %}
- + {% if include_avatar %} {{ comment['author'] }} {% endif %}
- {{ comment['author'] }} + {{ comment['author'] }}
+
{% if lazy_load %}  @@ -35,7 +35,7 @@ {% endif %}
-

{{ info['title'] }}

+

{{ info['title'] }}

{% if include_author %} {% set author_description = info['author'] %} diff --git a/youtube/templates/playlist.html b/youtube/templates/playlist.html index 994523e..dc9c37a 100644 --- a/youtube/templates/playlist.html +++ b/youtube/templates/playlist.html @@ -10,11 +10,17 @@