diff options
| author | Astounds <kirito@disroot.org> | 2026-03-27 21:23:03 -0500 |
|---|---|---|
| committer | Astounds <kirito@disroot.org> | 2026-03-27 21:23:03 -0500 |
| commit | e03f40d72801b8954cd378aaf0e595ccb29f8091 (patch) | |
| tree | 7ada367f2b275d53b80503630f121a4d0464f9bd /youtube/templates/common_elements.html | |
| parent | 22c72aa842efa6d1dca3bb95eeb47122537ce12a (diff) | |
| download | yt-local-e03f40d72801b8954cd378aaf0e595ccb29f8091.tar.lz yt-local-e03f40d72801b8954cd378aaf0e595ccb29f8091.tar.xz yt-local-e03f40d72801b8954cd378aaf0e595ccb29f8091.zip | |
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.
Diffstat (limited to 'youtube/templates/common_elements.html')
| -rw-r--r-- | youtube/templates/common_elements.html | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/youtube/templates/common_elements.html b/youtube/templates/common_elements.html index bd43761..5b72063 100644 --- a/youtube/templates/common_elements.html +++ b/youtube/templates/common_elements.html @@ -20,7 +20,7 @@ {{ info['error'] }} {% else %} <div class="item-video {{ info['type'] + '-item' }}"> - <a class="thumbnail-box" href="{{ info['url'] }}" title="{{ info['title'] }}"> + <a class="thumbnail-box" href="{{ info['url'] or '#' }}" title="{{ info['title'] }}"> <div class="thumbnail {% if info['type'] == 'channel' %} channel {% endif %}"> {% if lazy_load %} <img class="thumbnail-img lazy" alt=" " data-src="{{ info['thumbnail'] }}" onerror="thumbnail_fallback(this)"> @@ -35,7 +35,7 @@ {% endif %} </div> </a> - <h4 class="title"><a href="{{ info['url'] }}" title="{{ info['title'] }}">{{ info['title'] }}</a></h4> + <h4 class="title"><a href="{{ info['url'] or '#' }}" title="{{ info['title'] }}">{{ info['title'] }}</a></h4> {% if include_author %} {% set author_description = info['author'] %} |
