aboutsummaryrefslogtreecommitdiffstats
path: root/youtube/watch.py
diff options
context:
space:
mode:
authorJames Taylor <user234683@users.noreply.github.com>2020-02-01 16:16:49 -0800
committerJames Taylor <user234683@users.noreply.github.com>2020-02-01 16:16:49 -0800
commit9f090dbbf82a212b5e4b82f99ec48ec15c0946b0 (patch)
tree75d46cd26efc0697ff81bc2b5a937d803fc8b5c8 /youtube/watch.py
parent3f310bfc3308be5cede232339a724abe413d4d96 (diff)
downloadyt-local-9f090dbbf82a212b5e4b82f99ec48ec15c0946b0.tar.lz
yt-local-9f090dbbf82a212b5e4b82f99ec48ec15c0946b0.tar.xz
yt-local-9f090dbbf82a212b5e4b82f99ec48ec15c0946b0.zip
Watch page: add info box with allowed countries and tor exit node
Should help with debugging various content blocks
Diffstat (limited to 'youtube/watch.py')
-rw-r--r--youtube/watch.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/youtube/watch.py b/youtube/watch.py
index ceca4cd..f9e6b7c 100644
--- a/youtube/watch.py
+++ b/youtube/watch.py
@@ -235,12 +235,14 @@ def extract_info(video_id):
info['playability_error'] = decryption_error
# check for 403
+ info['invidious_used'] = False
if settings.route_tor and info['formats'] and info['formats'][0]['url']:
response = util.head(info['formats'][0]['url'],
report_text='Checked for URL access')
if response.status == 403:
print(('Access denied (403) for video urls.'
' Retrieving urls from Invidious...'))
+ info['invidious_used'] = True
try:
video_info = util.fetch_url(
'https://invidio.us/api/v1/videos/'
@@ -418,6 +420,10 @@ def get_watch_page(video_id=None):
limited_state = info['limited_state'],
age_restricted = info['age_restricted'],
playability_error = info['playability_error'],
+
+ allowed_countries = info['allowed_countries'],
+ ip_address = info['ip_address'] if settings.route_tor else None,
+ invidious_used = info['invidious_used'],
)