[utils, etc] Kill child processes when yt-dl is killed

* derived from PR #26592, closes #26592

Authored by: Unrud
This commit is contained in:
pukkandan 2021-01-09 17:56:12 +05:30 committed by dirkf
commit 0700fde640
8 changed files with 42 additions and 21 deletions

View file

@ -13,8 +13,9 @@ from ..utils import (
encodeFilename,
PostProcessingError,
prepend_extension,
process_communicate_or_kill,
replace_extension,
shell_quote
shell_quote,
)
@ -109,7 +110,7 @@ class EmbedThumbnailPP(FFmpegPostProcessor):
self._downloader.to_screen('[debug] AtomicParsley command line: %s' % shell_quote(cmd))
p = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
stdout, stderr = p.communicate()
stdout, stderr = process_communicate_or_kill(p)
if p.returncode != 0:
msg = stderr.decode('utf-8', 'replace').strip()