瀏覽代碼

[YoutubeDL] Do not save/restore console title while simulate (closes #16103)

Sergey M․ 7 年之前
父節點
當前提交
94c3442e6a
共有 1 個文件被更改,包括 4 次插入0 次删除
  1. 4 0
      youtube_dl/YoutubeDL.py

+ 4 - 0
youtube_dl/YoutubeDL.py

@@ -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)