diff options
author | pukkandan <pukkandan.ytdlp@gmail.com> | 2021-10-20 21:49:40 +0530 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-10-20 21:49:40 +0530 |
commit | d3c93ec2b7f5bcb872b0afb169efaa2f1abdf6e2 (patch) | |
tree | 47b35a228e28d3b562c6b43707c3fb967178083a /yt_dlp/YoutubeDL.py | |
parent | b4b855ebc7fac536a85f087f6921df69dec4e470 (diff) | |
download | hypervideo-pre-d3c93ec2b7f5bcb872b0afb169efaa2f1abdf6e2.tar.lz hypervideo-pre-d3c93ec2b7f5bcb872b0afb169efaa2f1abdf6e2.tar.xz hypervideo-pre-d3c93ec2b7f5bcb872b0afb169efaa2f1abdf6e2.zip |
Don't create console for subprocesses on Windows (#1261)
Closes #1251
Diffstat (limited to 'yt_dlp/YoutubeDL.py')
-rw-r--r-- | yt_dlp/YoutubeDL.py | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/yt_dlp/YoutubeDL.py b/yt_dlp/YoutubeDL.py index 5d8e0bded..79f0b274d 100644 --- a/yt_dlp/YoutubeDL.py +++ b/yt_dlp/YoutubeDL.py @@ -87,10 +87,10 @@ from .utils import ( parse_filesize, PerRequestProxyHandler, platform_name, + Popen, PostProcessingError, preferredencoding, prepend_extension, - process_communicate_or_kill, register_socks_protocols, RejectedVideoReached, render_table, @@ -578,12 +578,9 @@ class YoutubeDL(object): stdout=slave, stderr=self._err_file) try: - self._output_process = subprocess.Popen( - ['bidiv'] + width_args, **sp_kwargs - ) + self._output_process = Popen(['bidiv'] + width_args, **sp_kwargs) except OSError: - self._output_process = subprocess.Popen( - ['fribidi', '-c', 'UTF-8'] + width_args, **sp_kwargs) + self._output_process = Popen(['fribidi', '-c', 'UTF-8'] + width_args, **sp_kwargs) self._output_channel = os.fdopen(master, 'rb') except OSError as ose: if ose.errno == errno.ENOENT: @@ -3280,11 +3277,11 @@ class YoutubeDL(object): if self.params.get('compat_opts'): write_debug('Compatibility options: %s\n' % ', '.join(self.params.get('compat_opts'))) try: - sp = subprocess.Popen( + sp = Popen( ['git', 'rev-parse', '--short', 'HEAD'], stdout=subprocess.PIPE, stderr=subprocess.PIPE, cwd=os.path.dirname(os.path.abspath(__file__))) - out, err = process_communicate_or_kill(sp) + out, err = sp.communicate_or_kill() out = out.decode().strip() if re.match('[0-9a-f]+', out): write_debug('Git HEAD: %s\n' % out) |