diff --git a/cut_review.py b/cut_review.py index eb78216..26db466 100644 --- a/cut_review.py +++ b/cut_review.py @@ -20,6 +20,7 @@ race_runs contains time for each racer import datetime import logging import os +import re import subprocess from getpass import getpass @@ -135,7 +136,7 @@ def main(match_id, race_number, if proc.wait() != 0: raise Exception("ffmpeg exited {}\n{}".format(proc.wait(), err)) lines = [ - line for line in err.strip().split('\n') + line for line in re.split('[\r\n]', err.strip()) if line.startswith('[blackdetect @ ') ] if len(lines) == 1: diff --git a/restreamer/restreamer/review.py b/restreamer/restreamer/review.py index 79ccc7e..a34a3c7 100644 --- a/restreamer/restreamer/review.py +++ b/restreamer/restreamer/review.py @@ -2,6 +2,7 @@ import datetime import logging import os +import re import subprocess from hashlib import sha256 from urlparse import urlparse @@ -155,7 +156,7 @@ def review( if proc.wait() != 0: raise Exception("ffmpeg exited {}\n{}".format(proc.wait(), err)) lines = [ - line for line in err.strip().split('\n') + line for line in re.split('[\r\n]', err.strip()) if line.startswith('[blackdetect @ ') ] if len(lines) == 1: