Bläddra i källkod

[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.
Yen Chi Hsuan 8 år sedan
förälder
incheckning
6a9cb29509
2 ändrade filer med 4 tillägg och 1 borttagningar
  1. 3 0
      ChangeLog
  2. 1 1
      youtube_dl/extractor/common.py

+ 3 - 0
ChangeLog

@@ -1,5 +1,8 @@
 version <unreleased>
 version <unreleased>
 
 
+Core
+* [extractor/common] Fix json dumping with --geo-bypass
+
 Extractors
 Extractors
 * [bilibili] Fix extraction of videos with double quotes in titles (#13387)
 * [bilibili] Fix extraction of videos with double quotes in titles (#13387)
 
 

+ 1 - 1
youtube_dl/extractor/common.py

@@ -420,7 +420,7 @@ class InfoExtractor(object):
             if country_code:
             if country_code:
                 self._x_forwarded_for_ip = GeoUtils.random_ipv4(country_code)
                 self._x_forwarded_for_ip = GeoUtils.random_ipv4(country_code)
                 if self._downloader.params.get('verbose', False):
                 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.'
                         '[debug] Using fake IP %s (%s) as X-Forwarded-For.'
                         % (self._x_forwarded_for_ip, country_code.upper()))
                         % (self._x_forwarded_for_ip, country_code.upper()))