summary refs log tree commit diff
diff options
context:
space:
mode:
authorYen Chi Hsuan <yan12125@gmail.com>2017-06-15 13:04:36 +0800
committerYen Chi Hsuan <yan12125@gmail.com>2017-06-15 13:04:36 +0800
commit6a9cb29509a3b1fa2c1ffce82acb2fa7a2699c29 (patch)
tree30e202c4bd491cd08a3970ab0a79344d043bd2c0
parentca270371718fda18b3331dd645a200a365b096c9 (diff)
downloadyoutube-dl-6a9cb29509a3b1fa2c1ffce82acb2fa7a2699c29.tar.gz
youtube-dl-6a9cb29509a3b1fa2c1ffce82acb2fa7a2699c29.tar.xz
youtube-dl-6a9cb29509a3b1fa2c1ffce82acb2fa7a2699c29.zip
[extractor/common] Fix json dumping with --geo-bypass
The line "[debug] Using fake IP %s (%s) as X-Forwarded-For." was printed
to stdout even with -j/-J, which breaks the resultant JSON.
-rw-r--r--ChangeLog3
-rw-r--r--youtube_dl/extractor/common.py2
2 files changed, 4 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 9b45f08e3..5cd0b3393 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 version <unreleased>
 
+Core
+* [extractor/common] Fix json dumping with --geo-bypass
+
 Extractors
 * [bilibili] Fix extraction of videos with double quotes in titles (#13387)
 
diff --git a/youtube_dl/extractor/common.py b/youtube_dl/extractor/common.py
index 941385ae2..6e415ea41 100644
--- a/youtube_dl/extractor/common.py
+++ b/youtube_dl/extractor/common.py
@@ -420,7 +420,7 @@ class InfoExtractor(object):
             if country_code:
                 self._x_forwarded_for_ip = GeoUtils.random_ipv4(country_code)
                 if self._downloader.params.get('verbose', False):
-                    self._downloader.to_stdout(
+                    self._downloader.to_screen(
                         '[debug] Using fake IP %s (%s) as X-Forwarded-For.'
                         % (self._x_forwarded_for_ip, country_code.upper()))