[YoutubeDL] Do not save/restore console title while simulate (closes #16103)
authorSergey M․ <dstftw@gmail.com>
Sun, 8 Apr 2018 18:03:55 +0000 (01:03 +0700)
committerSergey M․ <dstftw@gmail.com>
Sun, 8 Apr 2018 18:04:22 +0000 (01:04 +0700)
youtube_dl/YoutubeDL.py

index 523dd1f7daf80839839d7b8a014f86897640b425..fca4999eb5099c0b52c45141b63dd953b665a612 100755 (executable)
@@ -532,6 +532,8 @@ class YoutubeDL(object):
     def save_console_title(self):
         if not self.params.get('consoletitle', False):
             return
+        if self.params.get('simulate', False):
+            return
         if compat_os_name != 'nt' and 'TERM' in os.environ:
             # Save the title on stack
             self._write_string('\033[22;0t', self._screen_file)
@@ -539,6 +541,8 @@ class YoutubeDL(object):
     def restore_console_title(self):
         if not self.params.get('consoletitle', False):
             return
+        if self.params.get('simulate', False):
+            return
         if compat_os_name != 'nt' and 'TERM' in os.environ:
             # Restore the title from stack
             self._write_string('\033[23;0t', self._screen_file)