Commit Graph

53 Commits

Author SHA1 Message Date
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
b91d53dc6f Use response.headers instead of response.getheaders()
response.getheaders() will be deprecated by urllib3.
2024-03-11 09:47:35 +08:00
Jesus E
ba3714c860 server.py: route any subdomain of googleusercontent.com &
ggpht.com

Avatars no longer loaded after YouTube changed the subdomain.

Fixes #163
2023-05-28 21:12:13 -04:00
James Taylor
263469cd30 Filter out noisy video routing requests in console
Signed-off-by: Jesús <heckyel@hyperbola.info>
2022-03-30 00:45:45 +08:00
James Taylor
c9a75042d2 Add support for more qualities, merging video+audio using MSE
Signed-off-by: Jesús <heckyel@hyperbola.info>
2021-08-29 18:48:56 -05:00
Jesús
e4af99fd17 Revert "Add support for more qualities, merging video+audio using MSE"
This reverts commit d56df02e7b.
2021-08-29 18:48:01 -05:00
James Taylor
d56df02e7b Add support for more qualities, merging video+audio using MSE
Signed-off-by: Jesús <heckyel@hyperbola.info>
2021-08-29 18:44:26 -05:00
Jesús
7fd2c3474f Capitalize name app 2021-06-10 16:41:45 -05:00
James Taylor
585d724564 Add hidden setting to allow foreign post requests
See #55

Signed-off-by: Jesús <heckyel@hyperbola.info>
2021-03-15 22:25:08 -05:00
Jesús
48e7cdd9a4 Improve regex to pep8 2020-12-31 12:59:20 -05:00
Jesús
574cb2dae8 Fix env["PATH_INFO"] for UWSGI, prevents bad url formatting
e.g:
ValueError: Invalid or unsupported url: https:/www.youtube.com/watch
2020-12-19 22:24:32 -05:00
Jesús
1de9ae4245 Patch-import-migrate: Add embed page for embeds on the web
Issue #36

From e51f0a78c778a2283887db7ffc22421a7c849296 Mon Sep 17 00:00:00 2001
From: James Taylor <user234683@users.noreply.github.com>
2020-12-19 22:13:37 -05:00
James Taylor
afb2aca460 video routing: Range request missing content when connection closed
googlevideo sometimes doesn't send all video content and closes
the connection. Retry with a range request for the bytes needed
a maximum of three times.

Fixes first type of #40

Signed-off-by: Jesús <heckyel@hyperbola.info>
2020-12-19 10:49:08 -05:00
Jesús
f4b36a220d pep8 2020-12-15 21:14:27 -05:00
Jesús
cf8e8ea5b1 Improve message Starting httpserver 2020-12-15 20:59:34 -05:00
James Taylor
5f4884dce8 Put vid title at end of download urls so downloads w/ that filename 2020-10-22 14:30:33 -07:00
James Taylor
d3230e8daf Remove commenting system. Because:
- Actually using it will result in comments being shadowbanned,
  even those posted from Youtube's interfacs, because your account
  gets downranked since no analytics are present so it looks like a
  bot posting the comment.
- It's been broken for awhile
2020-10-21 19:58:31 -07:00
zrose584
a8916b9308 proxy 'sponsor.ajay.app' 2020-10-18 18:48:52 +02:00
James Taylor
aa199cdf57 Use tor video routing instead of invidious for 403s
Using invidious isn't always successful, whereas Tor video routing
appears to be near 100% successful.
2020-09-25 13:47:13 -07:00
James Taylor
e829cc0e89 server.py: support alternative server software
Add if __name__ == '__main__' check and add the name
"application" pointing to the callable.
Fixes #19
2020-09-24 12:10:11 -07:00
James Taylor
5f5034e826 Increase max redirects for video routing 2020-09-22 20:59:20 -07:00
user938120
3ffe5d0120 Add setting for tor_port 2020-09-19 12:23:30 +00:00
James Taylor
e9989af03a Add tor video routing
Includes non-tor video routing by default, so no more chances
of the browser leaking headers or user agent to googlevideo
Adjust settings upgrade system to facilitate change to route_tor
setting.
Add some more space on settings page for dropdown settings so does
not overflow due to options with long names.
Closes #7
2020-09-18 14:40:21 -07:00
James Taylor
3a8f18a1fd Merge branch 'master' of https://github.com/user234683/youtube-local 2020-09-05 23:49:28 -07:00
James Taylor
06974ef41b Don't log noisy caption requests to console 2020-09-05 23:44:01 -07:00
Jelle Licht
c084caf492 server.py: Add python3 shebang 2020-09-05 20:41:16 +02:00
James Taylor
3a07a87c88 Don't log noisy thumbnail and avatar requests in the console 2020-08-12 14:37:32 -07:00
James Taylor
dd5c9a5d41 Fix parameters being ignored in youtu.be links
The parameters weren't passed to the underlying function
2020-04-05 17:26:48 -07:00
James Taylor
fa112592fa Correct malformed query strings: change ? to & so flask
parses it correctly.

Otherwise, parameters starting with ? will be included in the video
id, which messes up the comments since the extraneous data is
passed into the the ctoken.
2020-03-08 13:40:32 -07:00
James Taylor
6a55771630 Redirect localhost:8080 to homepage 2019-09-07 21:40:38 -07:00
James Taylor
163814d35c Convert subscriptions page to flask framework 2019-08-10 00:09:03 -07:00
James Taylor
8eff0bb9e2 Delete obsolete files 2019-07-21 21:59:52 -07:00
James Taylor
fc295ac93d Convert comment posting system to flask framework 2019-07-21 21:48:54 -07:00
James Taylor
8cad77ad0d Convert comments to flask framework 2019-07-19 22:27:10 -07:00
James Taylor
6261add37d Convert local_playlist to flask framework 2019-07-06 23:08:04 -07:00
James Taylor
64434b02ca Convert channel page to flask framework 2019-07-06 19:11:15 -07:00
James Taylor
d105d4520f Convert playlist page to flask framework 2019-07-04 18:08:14 -07:00
James Taylor
1156b09987 Refactor search page 2019-06-21 21:41:41 -07:00
James Taylor
2db58930a6 Convert watch page to flask framework 2019-06-16 16:16:03 -07:00
James Taylor
1e1f55c9e5 Use persistent connections 2019-02-25 20:47:49 -08:00
James Taylor
b669050bed server.py: remove obsolete code 2019-02-02 18:34:39 -08:00
James Taylor
6a23df8c90 Don't use tor when logging in 2018-12-26 17:24:53 -08:00
James Taylor
dca25bd4cc Properly handle terminated channel on channel's playlist and about page 2018-12-21 01:59:33 -08:00
James Taylor
e499ff6185 When url fetch fails with http error, report it instead of just 500 2018-12-21 01:28:28 -08:00
James Taylor
a8d74ba082 Correctly handle case where channel doesn't exist 2018-12-20 01:11:50 -08:00
James Taylor
717bf21093 Can now store settings&data in ~/.youtube-local, keeping program files separate 2018-11-10 00:27:43 -08:00
James Taylor
62769d94c5 relay headers when proxying site so caching happens 2018-07-24 04:08:34 -07:00
James Taylor
12382d5205 move settings to file, fix error if no banned_addresses.txt 2018-07-13 15:51:04 -07:00
James Taylor
2b308ec9f0 remove hardcoded path 2018-07-10 21:48:10 -07:00