Mercurial > codedump
comparison gettimefromedls.py @ 113:a972dc788da0
Create gettimefromedls.py
committer: GitHub <noreply@github.com>
author | Paper <37962225+mrpapersonic@users.noreply.github.com> |
---|---|
date | Sat, 21 Jan 2023 13:34:04 -0500 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
112:5a70e243557a | 113:a972dc788da0 |
---|---|
1 # get timestamps from Vegas EDL files | |
2 # used in my unfinished compilation | |
3 import sys | |
4 import os | |
5 import re | |
6 | |
7 parsedfl = [] | |
8 | |
9 def main(argv): | |
10 with open(argv[1]) as fl: | |
11 next(fl) | |
12 i = 0 | |
13 for line in fl.readlines(): | |
14 # I LOVE REGEX!!! | |
15 match = re.search("\d+; \d+; (\d+\.\d+); \d+\.\d+; \d+\.\d+; .+?; .+?; \d+; .+?; .+?; .+?; \"(.+?)\";", line) | |
16 if match: | |
17 parsedfl.append(match.group(1, 2)) | |
18 i += 1 | |
19 for i in parsedfl: | |
20 print("%d:%02d: %s" % (round(float(i[0]) / 1000) / 60, round(float(i[0]) / 1000) % 60, os.path.basename(i[1]))) | |
21 | |
22 if __name__ == "__main__": | |
23 main(sys.argv) |