def grep_core(media_file: str, add_prefix: bool, ffmpeg: FFmpeg, args, log: Log, TEMP: str) -> None:
    "\n    We're using the WEBVTT subtitle format. It's better than srt\n    because it doesn't emit line numbers and the time code is in\n    (hh:mm:ss.sss) instead of (dd:hh:mm:ss,sss)\n    "
    out_file = os.path.join(TEMP, 'media.vtt')
    ffmpeg.run(['-i', media_file, out_file])
    count = 0
    flags = 0
    if args.ignore_case:
        flags = re.IGNORECASE
    prefix = ''
    if add_prefix:
        prefix = '{}:'.format(os.path.splitext(os.path.basename(media_file))[0])
    if (args.max_count is None):
        args.max_count = float('inf')
    timecode = ''
    line_number = (- 1)
    with open(out_file, 'r') as file:
        while True:
            line = file.readline()
            line_number += 1
            if (line_number == 0):
                continue
            if ((not line) or (count >= args.max_count)):
                break
            if (line.strip() == ''):
                continue
            if re.match('\\d*:\\d\\d.\\d*\\s-->\\s\\d*:\\d\\d.\\d*', line):
                if args.time:
                    timecode = (line.split('-->')[0].strip() + ' ')
                else:
                    timecode = (line.strip() + '; ')
                continue
            line = cleanhtml(line)
            match = re.search(args.input[0], line, flags)
            line = line.strip()
            if match:
                count += 1
                if (not args.count):
                    if (args.timecode or args.time):
                        print(((prefix + timecode) + line))
                    else:
                        print((prefix + line))
    if args.count:
        print((prefix + str(count)))
We're using the WEBVTT subtitle format. It's better than srt
because it doesn't emit line numbers and the time code is in
(hh:mm:ss.sss) instead of (dd:hh:mm:ss,sss)
def grep_core(media_file: str, add_prefix: bool, ffmpeg: FFmpeg, args, log: Log, TEMP: str) -> None:
    "\n    We're using the WEBVTT subtitle format. It's better than srt\n    because it doesn't emit line numbers and the time code is in\n    (hh:mm:ss.sss) instead of (dd:hh:mm:ss,sss)\n    "
    out_file = os.path.join(TEMP, 'media.vtt')
    ffmpeg.run(['-i', media_file, out_file])
    count = 0
    flags = 0
    if args.ignore_case:
        flags = re.IGNORECASE
    prefix = 
    if add_prefix:
        prefix = '{}:'.format(os.path.splitext(os.path.basename(media_file))[0])
    if (args.max_count is None):
        args.max_count = float('inf')
    timecode = 
    line_number = (- 1)
    with open(out_file, 'r') as file:
        while True:
            line = file.readline()
            line_number += 1
            if (line_number == 0):
                continue
            if ((not line) or (count >= args.max_count)):
                break
            if (line.strip() == ):
                continue
            if re.match('\\d*:\\d\\d.\\d*\\s-->\\s\\d*:\\d\\d.\\d*', line):
                if args.time:
                    timecode = (line.split('-->')[0].strip() + ' ')
                else:
                    timecode = (line.strip() + '; ')
                continue
            line = cleanhtml(line)
            match = re.search(args.input[0], line, flags)
            line = line.strip()
            if match:
                count += 1
                if (not args.count):
                    if (args.timecode or args.time):
                        print(((prefix + timecode) + line))
                    else:
                        print((prefix + line))
    if args.count:
        print((prefix + str(count)))