aboutsummaryrefslogtreecommitdiffstats
path: root/youtube_dlc/postprocessor
diff options
context:
space:
mode:
Diffstat (limited to 'youtube_dlc/postprocessor')
-rw-r--r--youtube_dlc/postprocessor/embedthumbnail.py5
-rw-r--r--youtube_dlc/postprocessor/ffmpeg.py5
2 files changed, 6 insertions, 4 deletions
diff --git a/youtube_dlc/postprocessor/embedthumbnail.py b/youtube_dlc/postprocessor/embedthumbnail.py
index aaf58e0a0..3055a8c28 100644
--- a/youtube_dlc/postprocessor/embedthumbnail.py
+++ b/youtube_dlc/postprocessor/embedthumbnail.py
@@ -14,7 +14,8 @@ from ..utils import (
PostProcessingError,
prepend_extension,
replace_extension,
- shell_quote
+ shell_quote,
+ process_communicate_or_kill,
)
@@ -128,7 +129,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()
diff --git a/youtube_dlc/postprocessor/ffmpeg.py b/youtube_dlc/postprocessor/ffmpeg.py
index 2141d6311..c6ba1e221 100644
--- a/youtube_dlc/postprocessor/ffmpeg.py
+++ b/youtube_dlc/postprocessor/ffmpeg.py
@@ -21,6 +21,7 @@ from ..utils import (
dfxp2srt,
ISO639Utils,
replace_extension,
+ process_communicate_or_kill,
)
@@ -182,7 +183,7 @@ class FFmpegPostProcessor(PostProcessor):
handle = subprocess.Popen(
cmd, stderr=subprocess.PIPE,
stdout=subprocess.PIPE, stdin=subprocess.PIPE)
- stdout_data, stderr_data = handle.communicate()
+ stdout_data, stderr_data = process_communicate_or_kill(handle)
expected_ret = 0 if self.probe_available else 1
if handle.wait() != expected_ret:
return None
@@ -230,7 +231,7 @@ class FFmpegPostProcessor(PostProcessor):
if self._downloader.params.get('verbose', False):
self._downloader.to_screen('[debug] ffmpeg command line: %s' % shell_quote(cmd))
p = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE, stdin=subprocess.PIPE)
- stdout, stderr = p.communicate()
+ stdout, stderr = process_communicate_or_kill(p)
if p.returncode != 0:
stderr = stderr.decode('utf-8', 'replace')
msg = stderr.strip().split('\n')[-1]