A feature-rich command-line audio/video downloader
--load-info: Use the fileinput module
Jaime Marquínez Ferrándiz31bd39256b15
diff --git a/youtube_dl/YoutubeDL.py b/youtube_dl/YoutubeDL.pyindex d7c6db0ffc..15367c4e36 100755--- a/youtube_dl/YoutubeDL.py+++ b/youtube_dl/YoutubeDL.py@@ -4,8 +4,10 @@from __future__ import absolute_import, unicode_literalsimport collections+import contextlibimport datetimeimport errno+import fileinputimport ioimport itertoolsimport json@@ -1452,8 +1454,11 @@ class YoutubeDL(object):return self._download_retcodedef download_with_info_file(self, info_filename):- with io.open(info_filename, 'r', encoding='utf-8') as f:- info = json.load(f)+ with contextlib.closing(fileinput.FileInput(+ [info_filename], mode='r',+ openhook=fileinput.hook_encoded('utf-8'))) as f:+ # FileInput doesn't have a read method, we can't call json.load+ info = json.loads('\n'.join(f))try:self.process_ie_result(info, download=True)except DownloadError: