# get timestamps from Vegas EDL files
# used in my unfinished compilation
import sys
import os
import re

parsedfl = []

def main(argv):
    with open(argv[1]) as fl:
        next(fl)
        i = 0
        for line in fl.readlines():
            # I LOVE REGEX!!!
            match = re.search("\d+; \d+; (\d+\.\d+); \d+\.\d+; \d+\.\d+; .+?; .+?; \d+; .+?; .+?; .+?; \"(.+?)\";", line)
            if match:
                parsedfl.append(match.group(1, 2))
            i += 1
    for i in parsedfl:
        print("%d:%02d: %s" % (round(float(i[0]) / 1000) / 60, round(float(i[0]) / 1000) % 60, os.path.basename(i[1])))

if __name__ == "__main__":
    main(sys.argv)
