From a0f315be51ef121618e73d5b450c8616c0d11d21 Mon Sep 17 00:00:00 2001 From: Astounds Date: Mon, 20 Apr 2026 01:22:55 -0400 Subject: feature/hls: Add HLS playback support, and refactors documentation for better usability and maintainability. (#1) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Overview This PR introduces HLS playback support, improves the player experience, and refactors documentation for better usability and maintainability. ## Key Features ### HLS Playback Support - Add HLS integration via new JavaScript assets: - `hls.min.js` - `plyr.hls.start.js` - `watch.hls.js` - Separate DASH and HLS logic: - `plyr-start.js` → `plyr.dash.start.js` - `watch.js` → `watch.dash.js` - Update templates (`embed.html`, `watch.html`) for conditional player loading ### Native Storyboard Preview - Add `native_player_storyboard` setting in `settings.py` - Implement hover thumbnail preview for native player modes - Add `storyboard-preview.js` ### UI and Player Adjustments - Update templates and styles (`custom_plyr.css`) - Modify backend modules to support new player modes: - `watch.py`, `channel.py`, `util.py`, and related components ### Internationalization - Update translation files: - `messages.po` - `messages.pot` ### Testing and CI - Add and update tests: - `test_shorts.py` - `test_util.py` - Minor CI and release script improvements ## Documentation ### OpenRC Service Guide Rewrite - Restructure `docs/basic-script-openrc/README.md` into: - Prerequisites - Installation - Service Management - Verification - Troubleshooting - Add admonition blocks: - `[!NOTE]`, `[!TIP]`, `[!IMPORTANT]`, `[!WARNING]`, `[!CAUTION]` - Fix log inspection command: ```bash doas tail -f /var/log/ytlocal.log ```` * Add path placeholders and clarify permission requirements * Remove legacy and duplicate content Reviewed-on: https://git.fridu.us/heckyel/yt-local/pulls/1 Co-authored-by: Astounds Co-committed-by: Astounds --- youtube/templates/watch.html | 165 ++++++++++++++++++++++++++++++------------- 1 file changed, 114 insertions(+), 51 deletions(-) (limited to 'youtube/templates/watch.html') diff --git a/youtube/templates/watch.html b/youtube/templates/watch.html index d62884f..079a01c 100644 --- a/youtube/templates/watch.html +++ b/youtube/templates/watch.html @@ -9,7 +9,7 @@ - + {% endif %} {% endblock style %} @@ -23,22 +23,9 @@ {% endif %} - {% elif (uni_sources.__len__() == 0 or live) and hls_formats.__len__() != 0 %} -
- Copy a url into your video player: -
    - {% for fmt in hls_formats %} -
  1. {{ fmt['video_quality'] }}:
  2. - {% endfor %} -
-
{% else %}
+ {% if hls_unavailable and not uni_sources %} +
+ Error: HLS streams unavailable. Video may not play without JavaScript fallback. +
+ {% endif %}
{% endif %} @@ -76,41 +74,68 @@
+ {% if settings.use_video_player < 2 %} + + + {% else %} + + {% endif %} {% if settings.use_video_player != 2 %} - + {% for track in audio_tracks %} + {% endfor %} - + {% endif %} {% endif %}
- Direct Link + {{ _('Direct Link') }} {% if settings.use_video_download != 0 %}
- Download - + {{ _('Download') }} +
+ + + + + + + + + + + + + {% for format in download_formats %} + + + + + + + + + {% endfor %} + {% for download in other_downloads %} + + + + + + + {% endfor %} + +
{{ _('Ext') }}{{ _('Video') }}{{ _('Audio') }}{{ _('Size') }}{{ _('Codecs') }}{{ _('Link') }}
{{ format['ext'] }}{{ format['video_quality'] }}{{ format['audio_quality'] }}{{ format['file_size'] }}{{ format['codecs'] }}{{ _('Download') }}
{{ download['ext'] }}{{ download['label'] }}{{ download.get('codecs', 'N/A') }}{{ _('Download') }}
+
{% else %} @@ -142,7 +167,7 @@ {% endif %}
- More info + {{ _('More info') }}

Tor exit node: {{ ip_address }}

{% if invidious_used %} @@ -166,7 +191,7 @@

{{ playlist['title'] }}

{% elif settings.related_videos_mode != 0 %} - + {% endif %} {% if subtitle_sources %} @@ -215,7 +240,7 @@ {% if settings.related_videos_mode != 0 %}