aboutsummaryrefslogtreecommitdiffstats
path: root/youtube/watch.py
Commit message (Collapse)AuthorAgeFilesLines
* add preview thumbnailszrose5842022-01-091-0/+64
| | | | Signed-off-by: Jesús <heckyel@hyperbola.info>
* Disable dislikesJesús2021-12-261-1/+0
| | | | Ref: https://blog.youtube/news-and-events/update-to-youtube/
* Work around video throttling using android user-agentJames Taylor2021-10-181-34/+35
| | | | | | Temporary fix for #95 Signed-off-by: Jesús <heckyel@hyperbola.info>
* watch.py: Support /shorts urlsJames Taylor2021-09-061-0/+2
| | | | Signed-off-by: Jesús <heckyel@hyperbola.info>
* Redo av codec settings & selections to accomodate webmJames Taylor2021-09-061-57/+73
| | | | | | | | | | | | | | 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>
* Support more audio and video qualitiesJames Taylor2021-08-311-4/+49
| | | | | | | | | | | | | | | | | | | | | | | | | 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>
* Add setting to prefer uni or pair sources and fix selection b/w themJames Taylor2021-08-291-4/+13
| | | | | | | | | 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>
* watch: Fix using_pair_sources being a list due to short-circuitingJames Taylor2021-08-291-1/+1
| | | | | | | | 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>
* watch.html: Move loose inline javascript into watch.jsJesús2021-08-291-1/+4
| | | | | | | | 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>
* Integrate quality selection into PlyrJames Taylor2021-08-291-0/+2
| | | | Signed-off-by: Jesús <heckyel@hyperbola.info>
* Add video quality selectorJames Taylor2021-08-291-8/+31
| | | | Signed-off-by: Jesús <heckyel@hyperbola.info>
* Add support for more qualities, merging video+audio using MSEJames Taylor2021-08-291-24/+103
| | | | Signed-off-by: Jesús <heckyel@hyperbola.info>
* Revert "Add support for more qualities, merging video+audio using MSE"Jesús2021-08-291-103/+24
| | | | This reverts commit d56df02e7b1eba86baf511289208295b1f6c5a50.
* Add support for more qualities, merging video+audio using MSEJames Taylor2021-08-291-24/+103
| | | | Signed-off-by: Jesús <heckyel@hyperbola.info>
* watch: determine video source based on quality, not actual heightJames Taylor2021-08-041-1/+2
| | | | | | | | | | 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>
* pep 8Jesús2021-08-031-3/+1
|
* Remove static check resolution in TOR modeJesús2021-08-031-8/+3
|
* Fix max_resolution in TOR modeJesús2021-08-021-1/+1
| | | | some videos have 480p resolution, and if setting only 360p the player would have no video to play
* Revert "fix check max_resolution in TOR mode"Jesús2021-08-021-1/+1
| | | | This reverts commit cb9b6dadbd1c3e268e87cd8eac9097760b3526ab.
* fix check max_resolution in TOR modeJesús2021-08-021-1/+1
|
* New age restriction bypass method since get_video_info was disabledJames Taylor2021-07-281-24/+32
| | | | | | | From https://github.com/yt-dlp/yt-dlp/issues/574#issuecomment-887171136 Signed-off-by: Jesús <heckyel@hyperbola.info>
* Improved plyr configurationJesús2021-07-031-0/+2
|
* get_video_info: Specify language so error messages are in englishJames Taylor2021-07-011-0/+1
| | | | | | Otherwise error message language will be region of Tor exit node Signed-off-by: Jesús <heckyel@hyperbola.info>
* Workaround for age restriction bypassJames Taylor2021-06-231-2/+6
| | | | Signed-off-by: Jesús <heckyel@hyperbola.info>
* feat: add direct linkUmimaso2021-06-231-0/+1
| | | | Signed-off-by: Jesús <heckyel@hyperbola.info>
* Capitalize name appJesús2021-06-101-1/+1
|
* Fix 404 errors on scheduled live events and age-gate bypassJames Taylor2021-06-011-5/+22
| | | | | | | | | | 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>
* Fix vids added to playlist from watch page not having author urlJames Taylor2021-05-171-4/+5
| | | | Signed-off-by: Jesús <heckyel@hyperbola.info>
* Fix regression: playlists not showing up besides videosJames Taylor2021-03-151-1/+1
| | | | | | Forgot to change & to ? in previous commit changing to embed page Signed-off-by: Jesús <heckyel@hyperbola.info>
* Use mobile embed page to bypass captcha blockageJames Taylor2021-02-261-1/+1
| | | | | | | | The aggressive IP-blocking doesn't apply to embed pages Fixes #47 Signed-off-by: Jesús <heckyel@hyperbola.info>
* General theme: fix syntax W3C markup and add improve 'Published' dateJesús2020-12-301-0/+2
| | | | Signed-off-by: Jesús <heckyel@hyperbola.info>
* pep8Jesús2020-12-211-1/+1
|
* Include watch_headers in get_video_info so error lang is englishJames Taylor2020-12-211-1/+3
| | | | | | | | | | | 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>
* Fix exception when video comments disabled and blank comments infoJames Taylor2020-12-211-1/+1
| | | | | | | 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>
* Patch-import-migrate: Add embed page for embeds on the webJesús2020-12-191-7/+23
| | | | | | | Issue #36 From e51f0a78c778a2283887db7ffc22421a7c849296 Mon Sep 17 00:00:00 2001 From: James Taylor <user234683@users.noreply.github.com>
* pep8Jesús2020-12-151-15/+27
|
* Always extract from html watch page to get base.js urlJames Taylor2020-12-121-25/+6
| | | | | | 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.
* Retrieve base.js url from html watch page when it's missingJames Taylor2020-12-091-13/+25
| | | | Fixes failure mode 3 in #22
* watch: Fix exception in to_valid_filename when video title is NoneJames Taylor2020-10-281-1/+1
|
* Put vid title at end of download urls so downloads w/ that filenameJames Taylor2020-10-221-0/+11
|
* Redo fix for failure mode 1 in issue #22James Taylor2020-10-211-2/+2
| | | | | Previous fix didn't work. Should work now. The non-embedded player response can still be present but the urls will be missing.
* Merge branch 'master' into add_sponsorblockJames Taylor2020-10-211-4/+8
|\
| * Use get_video_info to get video urls if player response missingJames Taylor2020-10-191-4/+8
| | | | | | | | Fixes failure mode 1 in #22
* | proxy 'sponsor.ajay.app'zrose5842020-10-181-0/+4
|/
* add comments.jszrose5842020-10-071-2/+0
|
* Fix video height not scaling down when browser window is narrowJames Taylor2020-10-011-0/+1
| | | | | | 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.
* Use tor video routing instead of invidious for 403sJames Taylor2020-09-251-44/+8
| | | | | Using invidious isn't always successful, whereas Tor video routing appears to be near 100% successful.
* Specify video height in html so page doesn't shift down after loadJames Taylor2020-09-241-8/+9
| | | | | Use true video height extracted from youtube to handle videos shorter than their quality size. (e.g. widescreen videos)
* Add tor video routingJames Taylor2020-09-181-4/+10
| | | | | | | | | | 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
* Add setting to enable/disable video hotkeysJames Taylor2020-09-091-3/+1
|