]> asedeno.scripts.mit.edu Git - youtube-dl.git/blobdiff - youtube_dl/postprocessor/embedthumbnail.py
[utils, etc] Kill child processes when yt-dl is killed
[youtube-dl.git] / youtube_dl / postprocessor / embedthumbnail.py
index 3990908b69156c5a8c9cf79c7940b4e088eeeca3..5e7b6e2df85354c681a81341964f8b7c54eeb237 100644 (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()