1
0
mirror of https://github.com/yt-dlp/yt-dlp.git synced 2025-09-03 08:35:32 +00:00

Don't create console for subprocesses on Windows (#1261)

Closes #1251
This commit is contained in:
pukkandan
2021-10-20 21:49:40 +05:30
committed by GitHub
parent b4b855ebc7
commit d3c93ec2b7
10 changed files with 63 additions and 58 deletions

View File

@ -17,7 +17,7 @@ from ..utils import (
get_exe_version,
is_outdated_version,
std_headers,
process_communicate_or_kill,
Popen,
)
@ -223,11 +223,10 @@ class PhantomJSwrapper(object):
else:
self.extractor.to_screen('%s: %s' % (video_id, note2))
p = subprocess.Popen([
self.exe, '--ssl-protocol=any',
self._TMP_FILES['script'].name
], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
out, err = process_communicate_or_kill(p)
p = Popen(
[self.exe, '--ssl-protocol=any', self._TMP_FILES['script'].name],
stdout=subprocess.PIPE, stderr=subprocess.PIPE)
out, err = p.communicate_or_kill()
if p.returncode != 0:
raise ExtractorError(
'Executing JS failed\n:' + encodeArgument(err))