diff options
-rwxr-xr-x | convert.py | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -78,14 +78,14 @@ for file in sorted(os.listdir(sourcedir)): ffmpeg_time = re.search('(Duration: [0-9][0-9]:[0-9][0-9]:[0-9][0-9].[0-9][0-9])', str(unknown_line), re.IGNORECASE) if ffmpeg_time: - total = str(ffmpeg_time[0]).split(' ')[1] + total = str(ffmpeg_time.group(0)).split(' ')[1] totalRange = time.strptime(total.split('.')[0],'%H:%M:%S') totalRangeS = datetime.timedelta(hours=totalRange.tm_hour,minutes=totalRange.tm_min,seconds=totalRange.tm_sec).total_seconds() ffmpeg_time = re.search('(time=[0-9][0-9]:[0-9][0-9]:[0-9][0-9].[0-9][0-9])', str(unknown_line), re.IGNORECASE) if ffmpeg_time: - timeRange = time.strptime(str(ffmpeg_time[0]).split('.')[0].split('=')[1],'%H:%M:%S') + timeRange = time.strptime(str(ffmpeg_time.group(0)).split('.')[0].split('=')[1],'%H:%M:%S') timeRangeS = datetime.timedelta(hours=timeRange.tm_hour,minutes=timeRange.tm_min,seconds=timeRange.tm_sec).total_seconds() print(str(round(100*timeRangeS/totalRangeS, 1))+"% / 100% "+str(exist), end='\r') |