From 256ed01025536f27bea263e61ff7c8240d8e9fc5 Mon Sep 17 00:00:00 2001 From: pukkandan Date: Sat, 23 Jan 2021 17:17:47 +0530 Subject: [PATCH] [sponskrub] Print "unrecognized args" message correctly --- youtube_dlc/postprocessor/sponskrub.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/youtube_dlc/postprocessor/sponskrub.py b/youtube_dlc/postprocessor/sponskrub.py index c8c83d0a9..4e9bec257 100644 --- a/youtube_dlc/postprocessor/sponskrub.py +++ b/youtube_dlc/postprocessor/sponskrub.py @@ -84,6 +84,7 @@ class SponSkrubPP(PostProcessor): else: msg = stderr.decode('utf-8', 'replace').strip() or stdout.decode('utf-8', 'replace').strip() self.write_debug(msg, prefix=False) - msg = msg.split('\n')[-1] + line = 0 if msg[:12].lower() == 'unrecognised' else -1 + msg = msg.split('\n')[line] raise PostProcessingError(msg if msg else 'sponskrub failed with error code %s' % p.returncode) return [], information