Watch page: add info box with allowed countries and tor exit node

Should help with debugging various content blocks
This commit is contained in:
James Taylor
2020-02-01 16:16:49 -08:00
parent 3f310bfc33
commit 9f090dbbf8
3 changed files with 41 additions and 0 deletions

View File

@@ -318,6 +318,14 @@ def _extract_formats(info, player_response):
info['formats'].append(fmt)
# get ip address
if info['formats']:
query_string = info['formats'][0].get('url', '?').split('?')[1]
info['ip_address'] = deep_get(
urllib.parse.parse_qs(query_string), 'ip', 0)
def _extract_playability_error(info, player_response, error_prefix=''):
if info['formats']:
info['playability_status'] = None