0
0
Fork 0
mirror of https://github.com/yt-dlp/yt-dlp.git synced 2024-11-15 01:15:06 +00:00

[sponskrub] Print "unrecognized args" message correctly

This commit is contained in:
pukkandan 2021-01-23 17:17:47 +05:30
parent eab9b2bcaf
commit 256ed01025

View file

@ -84,6 +84,7 @@ def run(self, information):
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