[--load-info] Always read file as UTF-8
authorPhilipp Hagemeister <phihag@phihag.de>
Mon, 9 Dec 2013 03:59:50 +0000 (04:59 +0100)
committerPhilipp Hagemeister <phihag@phihag.de>
Mon, 9 Dec 2013 03:59:51 +0000 (04:59 +0100)
This allows editing the file (and not escaping non-ASCII characters) and reloading it in.

youtube_dl/YoutubeDL.py

index 79d5c7e5eb76087c77dbe523450c0da653868ea8..6538fc06cc75678de557a955935ec5c40fcc00c3 100644 (file)
@@ -883,8 +883,7 @@ class YoutubeDL(object):
         return self._download_retcode
 
     def download_with_info_file(self, info_filename):
-        with open(info_filename, 'r') as f:
-            # TODO: Check for errors
+        with io.open(info_filename, 'r', encoding='utf-8') as f:
             info = json.load(f)
         try:
             self.process_ie_result(info, download=True)