This commit is contained in:
Andreas Balogh
2023-04-10 21:13:53 +02:00
parent 219469925d
commit 0e4999b6f3
4 changed files with 108 additions and 10 deletions

View File

@@ -1,4 +1,4 @@
#!python3
#!python
# set mtime for handbrake mp4 files from filename
@@ -8,8 +8,6 @@
from pathlib import Path
import datetime as dt
import piexif
from collections import defaultdict
import re
import os
@@ -23,10 +21,10 @@ def rename(old, new):
else:
print(f"skipped {old.name}, {new.name}, already exists")
src = Path(r'D:\Videos')
# src = Path(r'D:\Videos')
for raw in src.glob("*.m4v"):
mo = re.match("(?P<author>[^-]*)-(?P<dt>\S*)-(?P<model>[^-]*)(-\S+)?.m4v", raw.name)
for raw in src.glob("*.mp4"):
mo = re.match("(?P<author>[^-]*)-(?P<dt>\S*)-(?P<model>[^-]*)(-\S+)?.mp4", raw.name)
if mo is None:
print(f"skipped {raw.name}, no match")
continue