From f1f77c4d776117df31f1ca36ce9236d644646642 Mon Sep 17 00:00:00 2001 From: James Taylor Date: Wed, 27 May 2020 11:14:52 -0700 Subject: Fix error getting exit node ip if format urls are None --- youtube/yt_data_extract/watch_extraction.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'youtube/yt_data_extract/watch_extraction.py') diff --git a/youtube/yt_data_extract/watch_extraction.py b/youtube/yt_data_extract/watch_extraction.py index bcb414a..2aeda83 100644 --- a/youtube/yt_data_extract/watch_extraction.py +++ b/youtube/yt_data_extract/watch_extraction.py @@ -364,7 +364,7 @@ def _extract_formats(info, player_response): # get ip address if info['formats']: - query_string = info['formats'][0].get('url', '?').split('?')[1] + query_string = (info['formats'][0].get('url') or '?').split('?')[1] info['ip_address'] = deep_get( urllib.parse.parse_qs(query_string), 'ip', 0) else: -- cgit v1.2.3