129 Commits

Author SHA1 Message Date
1fbc0cdd46
Fix preview_thumbnails
use 'deep_get' for storyboard
2022-05-30 22:45:08 +08:00
James Taylor
dcd4b0f0ae
Fix exception when _captions_base_url is not present
Signed-off-by: Jesús <heckyel@hyperbola.info>
2022-03-30 00:37:43 +08:00
zrose584
a5ef801c07
handle missing storyboard
Signed-off-by: Jesús <heckyel@hyperbola.info>
2022-01-17 09:01:09 -05:00
zrose584
63c92e0c4e
add preview thumbnails
Signed-off-by: Jesús <heckyel@hyperbola.info>
2022-01-09 16:39:50 -05:00
92067638b1
Disable dislikes
Ref: https://blog.youtube/news-and-events/update-to-youtube/
2021-12-26 13:29:55 -05:00
James Taylor
2e5a1133e3
Work around video throttling using android user-agent
Temporary fix for #95

Signed-off-by: Jesús <heckyel@hyperbola.info>
2021-10-18 18:56:53 -05:00
James Taylor
3066f9a37e
watch.py: Support /shorts urls
Signed-off-by: Jesús <heckyel@hyperbola.info>
2021-09-06 17:46:25 -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
ef867e3759
watch: Fix using_pair_sources being a list due to short-circuiting
In the case where pair_sources is empty due to a playability
error, using_pair_sources will be assigned to pair_sources
(empty list) because of short circuiting. Make it a bool

Signed-off-by: Jesús <heckyel@hyperbola.info>
2021-08-29 22:47:22 -05:00
309ff40943
watch.html: Move loose inline javascript into watch.js
The number of inline code blocks and the dependencies between them
became unmanageable.

From 9d96c07a3c2e68f1893634574c3be64e41a2c041 Mon Sep 17 00:00:00 2001
From: James Taylor <user234683@users.noreply.github.com>
2021-08-29 22:43:10 -05:00
James Taylor
9f44e0474b
Integrate quality selection into Plyr
Signed-off-by: Jesús <heckyel@hyperbola.info>
2021-08-29 21:47:14 -05:00
James Taylor
a7da23c6da
Add video quality selector
Signed-off-by: Jesús <heckyel@hyperbola.info>
2021-08-29 20:52:57 -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
e4af99fd17
Revert "Add support for more qualities, merging video+audio using MSE"
This reverts commit d56df02e7b1eba86baf511289208295b1f6c5a50.
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
James Taylor
7720f3bde5
watch: determine video source based on quality, not actual height
For some phone videos, the dimensions of the video might be
e.g. 360x640 instead of 640x360, which would be compared as
though it was "640p", and thus no source would be chosen
if default quality is 360p. Use the 'quality' entry which will
always be 360 for that quality.

Signed-off-by: Jesús <heckyel@hyperbola.info>
2021-08-04 13:31:16 -05:00
c62293c5cb
pep 8 2021-08-03 17:18:39 -05:00
7dd3c4304d
Remove static check resolution in TOR mode 2021-08-03 17:17:59 -05:00
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
e37c7eed58
Revert "fix check max_resolution in TOR mode"
This reverts commit cb9b6dadbd1c3e268e87cd8eac9097760b3526ab.
2021-08-02 18:35:20 -05:00
cb9b6dadbd
fix check max_resolution in TOR mode 2021-08-02 18:27:27 -05:00
James Taylor
f27105fa7f
New age restriction bypass method since get_video_info was disabled
From
https://github.com/yt-dlp/yt-dlp/issues/574#issuecomment-887171136

Signed-off-by: Jesús <heckyel@hyperbola.info>
2021-07-28 23:48:54 -05:00
de5510d3e3
Improved plyr configuration 2021-07-03 23:38:50 -05:00
James Taylor
20db70b9b9
get_video_info: Specify language so error messages are in english
Otherwise error message language will be region of Tor exit node

Signed-off-by: Jesús <heckyel@hyperbola.info>
2021-07-01 21:07:53 -05:00
James Taylor
0df406697f
Workaround for age restriction bypass
Signed-off-by: Jesús <heckyel@hyperbola.info>
2021-06-23 14:45:52 -05:00
Umimaso
5b4c99c702
feat: add direct link
Signed-off-by: Jesús <heckyel@hyperbola.info>
2021-06-23 12:42:17 -05:00
7fd2c3474f
Capitalize name app 2021-06-10 16:41:45 -05:00
James Taylor
9077596979
Fix 404 errors on scheduled live events and age-gate bypass
get_video_info now returns 404 error. Adding html5=1 fixes it
(for now). See
https://github.com/ytdl-org/youtube-dl/issues/29086#issuecomment-844892791

Also handles 404 error if it arises so it will be non-fatal

Signed-off-by: Jesús <heckyel@hyperbola.info>
2021-06-01 11:55:05 -05:00
James Taylor
b01a16d45b
Fix vids added to playlist from watch page not having author url
Signed-off-by: Jesús <heckyel@hyperbola.info>
2021-05-17 22:07:10 -05:00
James Taylor
4013b81cb6
Fix regression: playlists not showing up besides videos
Forgot to change & to ? in previous commit changing to embed page

Signed-off-by: Jesús <heckyel@hyperbola.info>
2021-03-15 22:05:17 -05:00
James Taylor
07f14343c4
Use mobile embed page to bypass captcha blockage
The aggressive IP-blocking doesn't apply to embed pages

Fixes #47

Signed-off-by: Jesús <heckyel@hyperbola.info>
2021-02-26 11:40:38 -05:00
1f4d7cc958
General theme: fix syntax W3C markup and add improve 'Published' date
Signed-off-by: Jesús <heckyel@hyperbola.info>
2020-12-30 16:52:26 -05:00
58c0ffc38d
pep8 2020-12-21 21:46:39 -05:00
James Taylor
6f4963cbfb
Include watch_headers in get_video_info so error lang is english
e.g. if the error in get_video_info is "Video unavailable" must
include the Accept-Language header (which we have in watch_headers)
in order to get an English error message. Otherwise we get the
language of the Tor exit node region

Example: https://youtu.be/aaaaaaaaaaa

Signed-off-by: Jesús <heckyel@hyperbola.info>
2020-12-21 21:28:43 -05:00
James Taylor
e41180058f
Fix exception when video comments disabled and blank comments info
e.g. happens on vid where comments are disabled if comments
disabled in settings since the comments info object is just {}

Signed-off-by: Jesús <heckyel@hyperbola.info>
2020-12-21 21:16:28 -05:00
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
f4b36a220d
pep8 2020-12-15 21:14:27 -05:00
James Taylor
9d0be82e74 Always extract from html watch page to get base.js url
Youtube removed the url from the pbj responses. They are now
only in the html page. Replaces previous fix for the missing
base.js issue.
2020-12-12 23:11:54 -08:00
James Taylor
6443cedf62 Retrieve base.js url from html watch page when it's missing
Fixes failure mode 3 in #22
2020-12-09 17:08:12 -08:00
James Taylor
b91edee61c watch: Fix exception in to_valid_filename when video title is None 2020-10-28 18:37:40 -07: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
f8b6db1480 Redo fix for failure mode 1 in issue #22
Previous fix didn't work. Should work now. The non-embedded player
response can still be present but the urls will be missing.
2020-10-21 22:42:07 -07:00
James Taylor
aa52c7a42e
Merge branch 'master' into add_sponsorblock 2020-10-21 18:53:12 -07:00
James Taylor
c9d0f685a4 Use get_video_info to get video urls if player response missing
Fixes failure mode 1 in #22
2020-10-19 13:53:57 -07:00
zrose584
a8916b9308 proxy 'sponsor.ajay.app' 2020-10-18 18:48:52 +02:00
zrose584
debc11931f add comments.js 2020-10-07 20:32:57 +02:00
James Taylor
9123d9a6cf Fix video height not scaling down when browser window is narrow
This solution still makes sure the video doesn't jump in height
when it loads, and makes it so the video scales down properly in
aspect ratio as the browser window is made narrower.
2020-10-01 13:38:57 -07: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