changes before turning into a flake
This commit is contained in:
12
non-nix/deprecated-rewrite/kemono.py
Normal file
12
non-nix/deprecated-rewrite/kemono.py
Normal file
@@ -0,0 +1,12 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
from pathlib import Path
|
||||
import re
|
||||
|
||||
path = Path('/home/jawz/Downloads/Jubilations/485935')
|
||||
pattern = re.compile(r" (\(\d{1,2}\)(?=\.\w))")
|
||||
for picture in path.iterdir():
|
||||
if re.search(pattern, picture.name):
|
||||
newname = (re.sub(pattern, "", picture.name))
|
||||
if not (path / newname).exists():
|
||||
(path / picture.name).rename(path / newname)
|
||||
Reference in New Issue
Block a user