60 Commits

Author SHA1 Message Date
6039589f24
Update android params
Discovered by LuanRT - https://github.com/LuanRT/YouTube.js/pull/624
2024-04-06 22:04:14 +08:00
70cb453280
Set 'ios' client to bypass
absidue notes that blockage of the android client is collateral
damage due to YouTube's war with ReVanced. Switching to iOS should
keep us out of the line of fire for now:
https://github.com/yt-dlp/yt-dlp/issues/9554#issuecomment-2026828421
2024-03-31 04:43:11 +08:00
8775e131af
Temporal fix: all requests with ANDROID client get redirected to aQvGIIdgFDM video, hence the different "content not available"
Set YTMUSIC_ANDROID client instead, but it's just the matter of time before youtube updates that one too :(
2024-03-31 01:48:43 +08:00
80b7f3cd00
Update user-agents and update android client parameters to fix blockage 2024-03-30 10:10:35 +08:00
b91d53dc6f
Use response.headers instead of response.getheaders()
response.getheaders() will be deprecated by urllib3.
2024-03-11 09:47:35 +08:00
f010452abf
Update android client version to fix 400 Bad Request 2024-03-10 02:02:42 +08:00
5f3b90ad45
Fix channel about tab 2024-01-22 06:29:42 +08:00
Jesus E
cd7624f2cb
Set hqdefault thumnail images 2023-06-18 19:45:34 -04:00
James Taylor
4768835766
Fix failing exit node retry test
The urllib3 retries.history wasn't working anyways

Signed-off-by: Jesús <heckyel@hyperbola.info>
2022-02-16 11:46:15 -05:00
James Taylor
3f4db4199c
Fix error during exit blockage detection when Set-Cookie missing
Signed-off-by: Jesús <heckyel@hyperbola.info>
2022-02-15 21:32:00 -05:00
James Taylor
5260716d14
Fix MaxRetryErrors due to Tor exit node blockage
Sometimes YouTube redirects to a google.com/sorry page, seemingly
setting up redirect loops. Other times the url redirects
to itself.

Signed-off-by: Jesús <heckyel@hyperbola.info>
2022-02-15 21:30:47 -05:00
James Taylor
6c6c469fbd
Prefix youtube URLs in video descriptions and channel about page
Closes #75

Signed-off-by: Jesús <heckyel@hyperbola.info>
2021-08-09 12:27:49 -05:00
James Taylor
3dee7ea0d1
Switch to new comments api now that old one is being disabled
watch_comment api periodically gives the error "Top level
comments mweb servlet is turned down."

The continuation items for the new api are in a different
arrangement in the json, so changes were necessary to the
extract_items function.

Signed-off-by: Jesús <heckyel@hyperbola.info>
2021-08-09 12:10:42 -05:00
f5f9b1c181
Cleaner channel-checking console error messages when Tor is closed
by James Taylor <user234683@users.noreply.github.com>
2021-07-28 23:45:19 -05:00
James Taylor
d0e3adab01
Restart tor connection pool when the tor port setting is changed
Otherwise the old port continued to be used until the program
was restarted.

Signed-off-by: Jesús <heckyel@hyperbola.info>
2021-07-28 23:18:22 -05:00
James Taylor
aadc20fa19
Friendlier error message when Tor is closed or network is down
Signed-off-by: Jesús <heckyel@hyperbola.info>
2021-07-04 13:20:48 -05:00
7fd2c3474f
Capitalize name app 2021-06-10 16:41:45 -05:00
James Taylor
53b274e35f
Save uploader id in local playlists
Signed-off-by: Jesús <heckyel@hyperbola.info>
2021-05-06 14:31:19 -05:00
James Taylor
c45f60d3f5
util.py: Encode data using utf-8, not ascii
Signed-off-by: Jesús <heckyel@hyperbola.info>
2021-03-03 10:36:32 -05:00
James Taylor
60a6ddc5ef
util.py: Fix data not being passed in requests
Signed-off-by: Jesús <heckyel@hyperbola.info>
2021-03-03 10:34:54 -05:00
James Taylor
d604a007a9
Debugging response saving: save page even if it's an HTTP error
This will help debug new types of exit node blockage or other
errors.

Signed-off-by: Jesús <heckyel@hyperbola.info>
2021-02-26 11:48:38 -05:00
James Taylor
4a8ba594d1
TorMgr: Change new identity cooldown to 7 seconds instead of 6
Because sometimes a new identity was not being respected

Signed-off-by: Jesús <heckyel@hyperbola.info>
2021-02-13 17:36:52 -05:00
James Taylor
52ca49628f
fetch_url: 429: get new identity regardless of page content
New 429 captcha page doesn't have IP. This new page appears to
match the 429 code plus the json of {"redirect": ...} which would
be occasionally received when the pbj json endpoint was used in
the past.

Closes #22

Signed-off-by: Jesús <heckyel@hyperbola.info>
2021-01-13 18:07:00 -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
056c3be3f2
strip_non_ascii in comments-author-name 2020-12-30 00:04:41 -05:00
James Taylor
701786a9cc
util: Remove obsolete parse_info_prepare_for_html function
Info parsing is handled by yt_data_extract, and html
post-processing is done with util.prefix_urls and
util.add_extra_html_info

Signed-off-by: Jesús <heckyel@hyperbola.info>
2020-12-28 11:48:20 -05:00
James Taylor
e1fe6b1d8e
Remove obsolete uppercase_escape function
This function was only necessary with the old ajax format, which
was removed in 4d7bba92eb62518e2273d030235214f4a7605444

Signed-off-by: Jesús <heckyel@hyperbola.info>
2020-12-28 11:43:57 -05:00
James Taylor
b567a34ecd
TorManager: Add delay before subsequent new identity retries
The request can be retried immediately after the first
new identity, but if we do more new identities, we have to wait
for at least 6 seconds before doing the request, otherwise
it won't be done on a new ip based on my experiments.

Potential issue: If after getting third new identity, request
takes > 12 seconds (since timeout is 15) and returns 429, then the
Tor Manager will let it do a 4th try instead of giving up (meaning
request is taking forever from user's perspective).
Should be a very rare occurence however.

Signed-off-by: Jesús <heckyel@hyperbola.info>
2020-12-25 22:56:19 -05:00
James Taylor
b11120d000
Exit node retrying: Retry 3 times. Also add tests for it.
Closes #20

Signed-off-by: Jesús <heckyel@hyperbola.info>
2020-12-21 18:23:09 -05:00
James Taylor
6b6a6653a0
Fix youtube mixes
They cannot be viewed on their own, so change url in items to
go to the video+playlist instead

Signed-off-by: Jesús <heckyel@hyperbola.info>
2020-12-18 23:39:25 -05:00
b9a3082e7c
pep8 2020-12-15 21:52:04 -05:00
James Taylor
ac54362f08 fetch_url: Use time.monotonic for comptability w/ tor_mgr
Buggy exit node retry behavior due to fetch_url still using
time.time() instead of the time.monotonic() used by new_identity
2020-11-29 13:44:03 -08:00
user234684
770b77ea51
use Tor to resolve domain names 2020-11-12 18:55:43 +00:00
James Taylor
8abfe150f0 new_identity: authenticate with blank password
See https://github.com/user234683/youtube-local/issues/20#issuecomment-716198162
2020-10-25 13:12:49 -07: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
bcaec7b7d3 fetch_url: move content decoding to before 429 check
Content should be decoded before we try reading page to check for
429. Lucky that it worked at all before.
2020-10-25 10:54:15 -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
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
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
bd255a9ab0 Don't use brotli if import fails 2020-08-11 21:57:40 -07:00
James Taylor
56e7751da7 Fix failure to parse comments when there's one from deleted channel
Specifically, fix failures when any of the fields from the parsed
comment are None, such as author, author_url, etc.
(failure due to string concatenation when building urls).
2020-03-08 16:17:04 -07:00
James Taylor
0989d55db1 Ensure urllib3 and python version not leaked during video file check
This is likely not a big deal since it is already assumed that video file server logs are not plugged into
Google's tracking infrastructure, but it doesn't hurt to give less info.
2020-02-18 22:17:50 -08:00
James Taylor
f253247949 Fix MaxRetryError when checking for video URL access
The default urllib3 max redirect amount was set to 3. Change it to 10 and
do not fail if there is a problem with checking for URL access. Just print
the error to the console and proceed.

Also add an unrelated remark about the bcptr=9999999999 parameter in watch.py
2020-02-18 11:47:23 -08:00
James Taylor
7c2736aa26 Check for 403 errors and fallback on Invidious
403 errors on the video urls happen typically when a video has copyrighted content or was livestreamed originally. They appear to not happen (or at least happen less frequently) if the Tor exit node used ipv6, however.
2020-02-01 15:09:37 -08: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
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