aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJames Taylor <user234683@users.noreply.github.com>2020-05-27 11:14:52 -0700
committerJames Taylor <user234683@users.noreply.github.com>2020-05-27 11:14:52 -0700
commitf1f77c4d776117df31f1ca36ce9236d644646642 (patch)
treed09a17e0360cf9575741422d95fc3fa4e362e312
parentd5e661dfd3736d844a35d28f0309f991f4175c07 (diff)
downloadyt-local-f1f77c4d776117df31f1ca36ce9236d644646642.tar.lz
yt-local-f1f77c4d776117df31f1ca36ce9236d644646642.tar.xz
yt-local-f1f77c4d776117df31f1ca36ce9236d644646642.zip
Fix error getting exit node ip if format urls are None
-rw-r--r--youtube/yt_data_extract/watch_extraction.py2
1 files changed, 1 insertions, 1 deletions
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: