feature/hls: Add HLS playback support, and refactors documentation for better usability and maintainability. #1

Merged
heckyel merged 15 commits from feature/hls into master 2026-04-20 01:22:56 -04:00

15 Commits

Author SHA1 Message Date
caa37e55fa refactor: improve download dropdown UX and styling
All checks were successful
CI / test (pull_request) Successful in 46s
CI / test (push) Successful in 1m35s
- Use lightweight fade‑in hover
2026-04-20 04:30:35 -05:00
7a3c92820c refactor: convert download dropdown to valid W3C table
All checks were successful
CI / test (push) Successful in 46s
CI / test (pull_request) Successful in 45s
- Replace ul/li structure with semantic table (thead/tbody)
- Add 6 columns: Ext, Video, Audio, Size, Codecs, Link
- Show "N/A" for missing codec data
- Add 0.5rem spacing between dropdown and description
2026-04-20 04:13:56 -05:00
13bdab41db chore(release): update to v0.5.0
All checks were successful
CI / test (push) Successful in 47s
CI / test (pull_request) Successful in 47s
Bump version in `version.py` to v0.5.0
2026-04-20 03:26:55 -05:00
bd008ebf91 docs: improve service guide and clarity
All checks were successful
CI / test (push) Successful in 1m35s
CI / test (pull_request) Successful in 1m41s
Restructure README, add admonitions, fix log command,
and refine script comments and safety notes.
2026-04-20 02:56:21 -05:00
3fe256ce29 feat: add native player storyboard preview option
All checks were successful
CI / test (push) Successful in 45s
- Introduced `native_player_storyboard` setting with default disabled.
- Updated templates to conditionally load the storyboard preview script only for native players.
- Added descriptive comments for the new setting and template blocks.
2026-04-20 02:43:41 -05:00
b320127f16 docs: update README.md
All checks were successful
CI / test (push) Successful in 1m1s
2026-04-20 00:42:37 -05:00
d6190a2d0b security: harden code against command injection and path traversal
Core changes:

* enforce HTTPS URLs and remove shell usage in generate_release.py
* replace os.system calls with subprocess across the codebase
* validate external inputs (playlist names, video IDs)

Improvements and fixes:

* settings.py: fix typo (node.lineno → line_number); use isinstance() over type()
* youtube/get_app_version: improve git detection using subprocess.DEVNULL
* youtube/util.py: add cleanup helpers; use shutil.which for binary resolution

YouTube modules:

* watch.py: detect and flag HLS streams; remove unused audio_track_sources
* comments.py: return early when comments are disabled; add error handling
* local_playlist.py: validate playlist names to prevent path traversal
* subscriptions.py: replace asserts with proper error handling; validate video IDs

Cleanup:

* remove unused imports across modules (playlist, search, channel)
* reorganize package imports in youtube/**init**.py
* simplify test imports and fix cleanup_func in tests

Tests:

* tests/test_shorts.py: simplify imports
* tests/test_util.py: fix cleanup_func definition
2026-04-20 00:39:35 -05:00
155bd4df49 fix(settings): add AST compatibility for Python 3.12+
All checks were successful
CI / test (push) Successful in 1m5s
- Use `ast.Constant` as primary node for Python 3.8+
- Maintain backward compatibility with `ast.Num`, `ast.Str`, and `ast.NameConstant`
- Prevent crashes on Python 3.12 where legacy nodes were removed
- Add safe handling via `try/except AttributeError`
2026-04-19 22:41:48 -05:00
5577e9e1f2 feat(channels): fix pagination for "Sorted by newest - no shorts"
Some checks failed
CI / test (push) Has been cancelled
Replace UU-uploads playlist workaround (proto field 104) with direct
requests to the channel Videos tab API (tab="videos"), aligning with
Invidious content-type handling. This restores proper continuation
tokens and stable pagination (~30 videos per page).

Update display logic:
- Show channel total upload count as an upper-bound while continuation
  tokens exist.
- On final page, display exact fetched video count.
- Ensure page number never falls below current page (fix page reset to "1").

Maintain separate handling:
- Shorts and streams tabs continue using tab-specific continuation tokens.

Add test:
- TestChannelCtokenV5::test_include_shorts_false_adds_filter

Fixes issue where channels with many Shorts (e.g., Celine Dept) showed
only a few videos and broken pagination under "no shorts" sorting.
2026-04-19 22:34:14 -05:00
3795d9e4ff fix(playlists): make playlist parsing robust against filename and formatting issues
All checks were successful
CI / test (push) Successful in 53s
- Use glob lookup to find playlist files even with trailing spaces in filenames
- Sanitize lines (strip whitespace) before JSON parsing to ignore trailing spaces/empty lines
- Handle JSONDecodeError gracefully to prevent 500 errors from corrupt entries
- Return empty list on FileNotFoundError in read_playlist instead of crashing
- Extract _find_playlist_path and _parse_playlist_lines helpers for reuse
2026-04-05 18:47:21 -05:00
3cf221a1ed minor fix 2026-04-05 18:32:29 -05:00
13a0e6ceed fix(hls): improve audio track selection and auto-detect "Original"
- Auto-select "Original" audio track by default in both native and Plyr HLS players
- Fix native HLS audio selector to use numeric indices instead of string matching
- Robustly detect "original" track by checking both `name` and `lang` attributes
- Fix audio track change handler to correctly switch between available tracks
2026-04-05 18:31:35 -05:00
e8e2aa93d6 fix(channel): fix shorts/streams pagination using continuation tokens
- Add continuation_token_cache to store ctokens between page requests
- Use cached ctoken for page 2+ instead of generating fresh tokens
- Switch shorts/streams to Next/Previous buttons (no page numbers)
- Show "N+ videos" indicator when more pages are available
- Fix UnboundLocalError when page_call was undefined for shorts/streams

The issue was that YouTube's InnerTube API requires continuation tokens
for pagination on shorts/streams tabs, but the code was generating a new
ctoken each time, always returning the same 30 videos.
2026-04-05 18:19:05 -05:00
8403e30b3a Many fixes to i18n 2026-04-05 17:43:01 -05:00
f0649be5de Add HLS support to multi-audio 2026-04-05 14:56:51 -05:00