diff options
author | Jesús <heckyel@hyperbola.info> | 2021-08-03 17:17:59 -0500 |
---|---|---|
committer | Jesús <heckyel@hyperbola.info> | 2021-08-03 17:17:59 -0500 |
commit | 7dd3c4304d2c89868bd10198777ca5c9ef44f78b (patch) | |
tree | 6c46ba410ec4e67d7ffc52b5de9dc649ddad0c33 /youtube/watch.py | |
parent | 382035d32f88749a87e25e1d94b4d7f2d4ef97f4 (diff) | |
download | yt-local-7dd3c4304d2c89868bd10198777ca5c9ef44f78b.tar.lz yt-local-7dd3c4304d2c89868bd10198777ca5c9ef44f78b.tar.xz yt-local-7dd3c4304d2c89868bd10198777ca5c9ef44f78b.zip |
Remove static check resolution in TOR mode
Diffstat (limited to 'youtube/watch.py')
-rw-r--r-- | youtube/watch.py | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/youtube/watch.py b/youtube/watch.py index eab56f7..f710134 100644 --- a/youtube/watch.py +++ b/youtube/watch.py @@ -24,12 +24,9 @@ except FileNotFoundError: decrypt_cache = {} -def get_video_sources(info, tor_bypass=False): +def get_video_sources(info): video_sources = [] - if (not settings.theater_mode) or (settings.route_tor == 2) or tor_bypass: - max_resolution = 480 - else: - max_resolution = settings.default_resolution + max_resolution = settings.default_resolution for fmt in info['formats']: if not all(fmt[attr] for attr in ('quality', 'width', 'ext', 'url')): continue @@ -315,7 +312,6 @@ def extract_info(video_id, use_invidious, playlist_id=None, index=None): # check for 403. Unnecessary for tor video routing b/c ip address is same info['invidious_used'] = False info['invidious_reload_button'] = False - info['tor_bypass_used'] = False if (settings.route_tor == 1 and info['formats'] and info['formats'][0]['url']): try: @@ -329,7 +325,6 @@ def extract_info(video_id, use_invidious, playlist_id=None, index=None): if response.status == 403: print('Access denied (403) for video urls.') print('Routing video through Tor') - info['tor_bypass_used'] = True for fmt in info['formats']: fmt['url'] += '&use_tor=1' elif 300 <= response.status < 400: @@ -483,7 +478,7 @@ def get_watch_page(video_id=None): 'codecs': codecs_string, }) - video_sources = get_video_sources(info, tor_bypass=info['tor_bypass_used']) + video_sources = get_video_sources(info) video_height = yt_data_extract.deep_get(video_sources, 0, 'height', default=360) video_width = yt_data_extract.deep_get(video_sources, 0, 'width', default=640) # 1 second per pixel, or the actual video width |