diff options
author | pukkandan <pukkandan@gmail.com> | 2021-01-09 17:56:12 +0530 |
---|---|---|
committer | dirkf <fieldhouse@gmx.net> | 2022-06-10 19:57:46 +0100 |
commit | 0700fde6403aa9eec1ff02bff7323696a205900c (patch) | |
tree | f1ed405d2af1934a06ff2091420172a0cc98f23a /youtube_dl/extractor | |
parent | 811c480f7b6c25ca510a033e6365d00174135392 (diff) | |
download | youtube-dl-0700fde6403aa9eec1ff02bff7323696a205900c.tar.xz |
[utils, etc] Kill child processes when yt-dl is killed
* derived from PR #26592, closes #26592
Authored by: Unrud
Diffstat (limited to 'youtube_dl/extractor')
-rw-r--r-- | youtube_dl/extractor/openload.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/youtube_dl/extractor/openload.py b/youtube_dl/extractor/openload.py index 0c20d0177..b05d60435 100644 --- a/youtube_dl/extractor/openload.py +++ b/youtube_dl/extractor/openload.py @@ -16,6 +16,7 @@ from ..utils import ( ExtractorError, get_exe_version, is_outdated_version, + process_communicate_or_kill, std_headers, ) @@ -226,7 +227,7 @@ class PhantomJSwrapper(object): self.exe, '--ssl-protocol=any', self._TMP_FILES['script'].name ], stdout=subprocess.PIPE, stderr=subprocess.PIPE) - out, err = p.communicate() + out, err = process_communicate_or_kill(p) if p.returncode != 0: raise ExtractorError( 'Executing JS failed\n:' + encodeArgument(err)) |