[extractor/common] Fix json dumping with --geo-bypass
authorYen Chi Hsuan <yan12125@gmail.com>
Thu, 15 Jun 2017 05:04:36 +0000 (13:04 +0800)
committerYen Chi Hsuan <yan12125@gmail.com>
Thu, 15 Jun 2017 05:04:36 +0000 (13:04 +0800)
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.

ChangeLog
youtube_dl/extractor/common.py

index 9b45f08e30b013d32a63e26c8cc922ef95dbcaff..5cd0b3393c34d8b2be677d31ba1834b8e8a87582 100644 (file)
--- 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)
 
index 941385ae2eb3bd844989d19efb86f233c50d45c8..6e415ea41c35e773650d41b274c3a33c6b589b78 100644 (file)
@@ -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()))