Commit Graph

66 Commits

Author SHA1 Message Date
fa7273b328 fix: race condition in os.makedirs causing worker crashes
All checks were successful
git-sync-with-mirror / git-sync (push) Successful in 13s
CI / test (push) Successful in 47s
Replace check-then-create pattern with exist_ok=True to prevent
FileExistsError when multiple workers initialize simultaneously.

Affects:
- subscriptions.py: open_database()
- watch.py: save_decrypt_cache()
- local_playlist.py: add_to_playlist()
- util.py: fetch_url(), get_visitor_data()
- settings.py: initialization

Fixes Gunicorn worker startup failures in multi-worker deployments.
2026-03-28 16:06:47 -05:00
22c72aa842 remove yt-dlp, fix captions PO Token issue, fix 429 retry logic
All checks were successful
git-sync-with-mirror / git-sync (push) Successful in 13s
CI / test (push) Successful in 52s
- Remove yt-dlp entirely (modules, routes, settings, dependency)
  Was blocking page loads by running synchronously in gevent
- Fix captions: use Android client caption URLs (no PO Token needed)
  instead of web timedtext URLs that YouTube now blocks
- Fix 429 retry: fail immediately without Tor (same IP = pointless retry)
  Was causing ~27s delays with exponential backoff
- Accept ytdlp_enabled as legacy setting to avoid warning on startup
2026-03-27 20:47:44 -05:00
84e1acaab8 yt-dlp 2026-03-22 14:17:23 -05:00
639aadd2c1 Remove gather_googlevideo_domains setting
This was an old experiment to collect googlevideo domains to see
if there was a pattern that could correlate to IP address to
look for workarounds for 403 errors

Can bug out if enabled and if failed to get any vidoe urls,
so remove since it is obsolete and some people are enabling it

See #218
2025-02-28 10:58:29 +08:00
b215e2a3b2 Add setting to autoplay videos 2024-01-22 06:38:52 +08:00
6ae20bb1f5 Add option to always use integrated sources
Make the prefer_integrated_sources setting an int with 0,1,2
instead of a bool, where 2 makes it always use integrated sources
unless none are available.
2024-01-22 06:33:34 +08:00
ca4a735692 Add settings for filtering out shorts in subscriptions and channels 2024-01-22 05:55:59 +08:00
Jesús
c524eb16e5 Disable download by RIAA issues
Ref: https://torrentfreak.com/riaa-thwarts-youts-attempt-to-declare-youtube-ripping-legal-221002/
Archive: https://archive.ph/OZQbN
2022-10-05 10:14:06 +08:00
Jesús
f3d3c4c0a4 Disable 'Prefer integrated sources' for default 2021-12-26 12:44:46 -05:00
Jesús
5006149b59 change by default format, priority FLOSS formats 2021-12-26 12:42:43 -05:00
Jesús
ecb8d406f8 change tor port and app port 2021-09-14 13:07:04 -05:00
Jesús
82e82b1cb7 change path config 2021-09-14 12:51:05 -05:00
James Taylor
9c7e93ecf8 Redo av codec settings & selections to accomodate webm
Allows for ranked preferences for h264, av1, and vp9 codecs in
settings, along with equal preferences which are tiebroken using
smaller file size.

For each quality, gives av-merge a list of video sources
and audio sources sorted based on preference & file size. It
will pick the first one that the browser supports.

Closes #84

Signed-off-by: Jesús <heckyel@hyperbola.info>
2021-09-06 16:18:11 -05:00
James Taylor
7c79f530a5 Support more audio and video qualities
Adds support for AV1-encoded videos, which includes any videos
above 1080p. These weren't getting included because they did
not have a quality entry in the format table at the top of
watch_extraction.py. So get the quality from the quality
labels of the format if it's not there.

Because YouTube often includes BOTH AV1 and H.264 (AVC) for each
quality, after these are included, there will be way too many
quality options and the code needs to choose which one to use.
The choice is somewhat hard: AV1 is encoded in fewer bytes than
H.264 and is patent-free, however, it has less hardware support,
so might be more difficult to play. For instance, on my system,
AV1 does not work on 1080p, but H.264 does. Adds a setting about
which to prefer, set to H.264 as the default.

Also adds support for the lower quality mp4 audio quality, which
now gets used at 144p to save network bandwidth. For similar
reasons, this was not getting included because it did not
have an audio_bitrate entry in the table. Prefer bitrate
instead for the quality.

Signed-off-by: Jesús <heckyel@hyperbola.info>
2021-08-31 16:40:19 -05:00
James Taylor
2ae81f2a78 Add setting to prefer uni or pair sources and fix selection b/w them
pair_quality != uni_quality was the wrong condition to check,
since there are cases where the target_resolution is 360, and
there are no pair sources at 360, but there are some at other
resolutions, which would falsely select the pair sources.

Signed-off-by: Jesús <heckyel@hyperbola.info>
2021-08-29 23:17:32 -05: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
06315e3e02 [opensearch]: improve 2021-08-14 18:36:17 -05:00
Jesús
382035d32f Fix max_resolution in TOR mode
some videos have 480p resolution, and if setting only 360p the player would have no video to play
2021-08-02 18:46:50 -05:00
James Taylor
5df5e99213 Call setting hooks after change, rather than before
More convenient for functions that already read the current value
from settings.[...]. See next commit

Signed-off-by: Jesús <heckyel@hyperbola.info>
2021-07-28 23:14:10 -05:00
Jesús
fc8a23099d Fix shared.css file style missing 2021-06-14 18:39:03 -05:00
Jesús
31901905e3 Fix name app 2021-06-10 16:48:22 -05:00
Jesús
7fd2c3474f Capitalize name app 2021-06-10 16:41:45 -05:00
Jesús
1b860c6917 Not force plyr as player 2021-05-24 21:17:59 -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
dd5876e0c6 fix missing whitespace 2021-01-31 20:13:46 -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
Jesús
f4b36a220d pep8 2020-12-15 21:14:27 -05:00
James Taylor
3a081a9c46 Automatically change tor circuit once if ip is blocked
Use stem library to send a new identity signal via the tor
control port.

See #20
2020-10-25 11:15:59 -07:00
James Taylor
c09fe63d9b Adjust labels for some recently added settings 2020-10-22 15:03:26 -07:00
James Taylor
9f1b69d22f Organize settings into categories 2020-10-22 15:00:06 -07:00
James Taylor
aa52c7a42e Merge branch 'master' into add_sponsorblock 2020-10-21 18:53:12 -07:00
zrose584
a27b575380 remove trailing whitespaces 2020-10-21 10:35:01 +02:00
James Taylor
125ddaa8da Add setting to change font. Change default to arial
Closes #33
2020-10-20 15:38:00 -07:00
James Taylor
ef711dad05 settings.py: fix img_prefix not updated when setting changes
caused old prefix to still be used after changing setting

see #31
2020-10-19 13:26:57 -07:00
zrose584
f7f2b9fa06 add sponsorblock.js 2020-10-17 19:51:41 +02:00
James Taylor
fd253d9e07 Merge branch 'master' into optional_proxy_images 2020-10-12 09:37:13 -07:00
zrose584
debc11931f add comments.js 2020-10-07 20:32:57 +02:00
zrose584
f8d9be2d5a settings.py: add 'proxy_images' 2020-10-07 19:28:52 +02: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
e2e1e4cdec settings.py: make names less confusing and remove dead code
Try to make the names more consistent and more descriptive.
Remove unused functions to reduce confusing clutter
Change locals() to globals(). Overwriting locals is invalid, just
works because it was at top level.
2020-09-14 08:20:15 -07:00
James Taylor
c2ca47c5d3 Add setting to enable/disable video hotkeys 2020-09-09 18:53:11 -07:00
Jelle Licht
799177d651 settings.py: Support newer `ast.Constant' for settings.txt file.
In python 3.8, specific constant AST types are removed in favor of
ast.Constant. This change should work for both cases. See
https://bugs.python.org/issue32892 for the given rationale.
2020-09-05 20:41:21 +02:00
James Taylor
408a9c79ae Correctly start and stop subscriptions autochecker when it is
disabled/enabled in settings.
2020-03-08 21:01:15 -07:00
James Taylor
6f28d959f0 Fix FileNotFound error when trying to download search plugin when the working directory is not the directory of the program 2020-02-06 22:17:58 -08:00
James Taylor
ac32b24b2a Merge subscriptions into master 2019-09-06 15:45:01 -07:00
James Taylor
ed066e7414 Adapt theme and layout settings to settings page system 2019-09-06 14:53:06 -07:00
James Taylor
36380b0328 Settings: Fix circular dependency for settings_page 2019-09-06 14:31:47 -07:00