Commit Graph

36 Commits

Author SHA1 Message Date
e03f40d728 fix error handling, null URLs in templates, and Radio playlist support
All checks were successful
git-sync-with-mirror / git-sync (push) Successful in 13s
CI / test (push) Successful in 49s
- 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.
2026-03-27 21:23:03 -05:00
56ecd6cb1b fix: use YouTube-provided thumbnail URLs instead of hardcoded hq720.jpg
All checks were successful
git-sync-with-mirror / git-sync (push) Successful in 15s
CI / test (push) Successful in 58s
Videos without hq720.jpg thumbnails caused mass 404 errors.
Now preserves the actual thumbnail URL from YouTube's API response,
falls back to hqdefault.jpg only when no thumbnail is provided.
Also picks highest quality thumbnail from API (thumbnails[-1])
and adds progressive fallback for subscription/download functions.
2026-03-27 19:22:12 -05:00
6a68f06645 Release v0.4.0 - HD Thumbnails, YouTube 2024+ Support, and yt-dlp Integration
Some checks failed
CI / test (push) Failing after 1m19s
Major Features:
- HD video thumbnails (hq720.jpg) with automatic fallback to lower qualities
- HD channel avatars (240x240 instead of 88x88)
- YouTube 2024+ lockupViewModel support for channel playlists
- youtubei/v1/browse API integration for channel playlist tabs
- yt-dlp integration for multi-language audio and subtitles

Bug Fixes:
- Fixed undefined `abort` import in playlist.py
- Fixed undefined functions in proto.py (encode_varint, bytes_to_hex, succinct_encode)
- Fixed missing `traceback` import in proto_debug.py
- Fixed blurry playlist thumbnails using default.jpg instead of HD versions
- Fixed channel playlists page using deprecated pbj=1 format

Improvements:
- Automatic thumbnail fallback system (hq720 → sddefault → hqdefault → mqdefault → default)
- JavaScript thumbnail_fallback() handler for 404 errors
- Better thumbnail quality across all pages (watch, channel, playlist, subscriptions)
- Consistent HD avatar display for all channel items
- Settings system automatically adds new settings without breaking user config

Files Modified:
- youtube/watch.py - HD thumbnails for related videos and playlist items
- youtube/channel.py - HD thumbnails for channel playlists, youtubei API integration
- youtube/playlist.py - HD thumbnails, fixed abort import
- youtube/util.py - HD thumbnail URLs, avatar HD upgrade, prefix_url improvements
- youtube/comments.py - HD video thumbnail
- youtube/subscriptions.py - HD thumbnails, fixed abort import
- youtube/yt_data_extract/common.py - lockupViewModel support, extract_lockup_view_model_info()
- youtube/yt_data_extract/everything_else.py - HD playlist thumbnails
- youtube/proto.py - Fixed undefined function references
- youtube/proto_debug.py - Added traceback import
- youtube/static/js/common.js - thumbnail_fallback() handler
- youtube/templates/*.html - Added onerror handlers for thumbnail fallback
- youtube/version.py - Bump to v0.4.0

Technical Details:
- All thumbnail URLs now use hq720.jpg (1280x720) when available
- Fallback handled client-side via JavaScript onerror handler
- Server-side avatar upgrade via regex in util.prefix_url()
- lockupViewModel parser extracts contentType, metadata, and first_video_id
- Channel playlist tabs now use youtubei/v1/browse instead of deprecated pbj=1
- Settings version system ensures backward compatibility
2026-03-22 20:50:03 -05:00
630e0137e0 Increase playlist count to 1000 by default if cannot get video count
This way, buttons will still appear even if there is a failure
to read playlist metadata

Fixes #220# Please enter the commit message for your changes. Lines starting
2025-02-28 10:51:51 +08:00
2140f48919 Subscriptions: Use playlist method to get channel videos
Use the UU (user uploads) playlist since it includes streams
2024-01-22 05:52:44 +08:00
b45e3476c8 channels: Use the UU playlist to get videos by default
This will be much less likely to break moving forward since
YouTube rarely changes the playlist api

Videos page now includes shorts and streams in the video lsit

Also include an option to filter out shorts on the videos page
2024-01-22 05:39:11 +08:00
d591956baa ylist: show 100 videos per page instead of 20
Also add an option to the internal playlist ctoken function
for filtering out shorts, to be used in future anti-shorts features
2024-01-22 05:21:12 +08:00
Jesus E
cd7624f2cb Set hqdefault thumnail images 2023-06-18 19:45:34 -04:00
James Taylor
e1fe6b1d8e Remove obsolete uppercase_escape function
This function was only necessary with the old ajax format, which
was removed in 4d7bba92eb

Signed-off-by: Jesús <heckyel@hyperbola.info>
2020-12-28 11:43:57 -05:00
Jesús
b9a3082e7c pep8 2020-12-15 21:52:04 -05:00
James Taylor
fd253d9e07 Merge branch 'master' into optional_proxy_images 2020-10-12 09:37:13 -07:00
James Taylor
e182cf8283 playlist: Fix add-to-local-playlist form missing 2020-10-09 21:11:27 -07:00
zrose584
4f46e14ad0 fix style 2020-10-09 18:25:17 +02:00
zrose584
f8d9be2d5a settings.py: add 'proxy_images' 2020-10-07 19:28:52 +02:00
James Taylor
5554d5afff Add playlist sidebar for videos in playlist, including autoplay 2020-04-04 22:52:09 -07:00
James Taylor
f787e4e202 Give a proper error message for 429 errors
These occur when too many requests are coming from a Tor exit node.
Before, there would be an error page with an exception instructing users to report the issue.
But this is an expected and persistent issue.
2020-01-31 20:06:15 -08:00
James Taylor
d1d908d5b1 Extraction: Move html post processing stuff from yt_data_extract to util 2019-12-19 19:48:53 -08:00
James Taylor
f6bf5213a5 Extraction: rename multi_get functions to more descriptive names 2019-12-18 19:43:55 -08:00
James Taylor
98777ee825 Extraction: Rewrite item_extraction for better error handling and readability, rename extracted names for more consistency 2019-12-18 19:39:16 -08:00
James Taylor
dc6c370152 Extraction: refactor response extraction to work with both mobile & desktop respones, also improve errors 2019-09-19 11:06:34 -07:00
James Taylor
89e5761f8d Extraction: Move playlist extraction to yt_data_extract 2019-09-08 18:42:08 -07:00
James Taylor
1ce500b8a2 Regression: Fix error when playlist has no description 2019-08-15 16:30:05 -07:00
James Taylor
e00c3cf99f Remove ad-hoc response saving from code, create a debug setting for fetch_url 2019-07-23 23:57:45 -07:00
James Taylor
d105d4520f Convert playlist page to flask framework 2019-07-04 18:08:14 -07:00
James Taylor
b32330be4f refactor common.py into 3 files 2019-02-21 21:32:31 -08:00
James Taylor
a61ba6b8f4 playlist: fix error when there's no description 2019-02-16 15:21:39 -08:00
James Taylor
4d7bba92eb Use pbj format for playlist requests, ajax deprecated 2019-02-07 20:58:17 -08:00
James Taylor
36e0409db4 Add newline to end of files 2019-01-06 18:20:29 -08:00
James Taylor
bb2d40ac83 rename env['fields'] to env['parameters'] and rename fields to parameters in general 2019-01-06 01:33:52 -08:00
James Taylor
a57fc77426 WSGI for simple non-path GET pages 2019-01-05 00:20:39 -08:00
James Taylor
dd800485f0 add latency/readtime reporting for more things, round the numbers by reasonable amount 2018-10-01 18:01:05 -07:00
James Taylor
26620cbac8 front-end support for adding to playlists 2018-07-08 16:22:23 -07:00
James Taylor
25f3e2791c remove obsolete playlist code 2018-07-05 02:39:01 -07:00
James Taylor
dcdf02737a fix error when getting no content in channel response 2018-07-03 18:06:53 -07:00
James Taylor
79937c1c82 fix line endings 2018-07-02 17:45:25 -07:00
James Taylor
98157bf1bf initial commit 2018-06-30 23:34:46 -07:00