Created
June 14, 2018 03:38
-
-
Save vesche/04b462bf3158e4ea8c9d8d078920547f to your computer and use it in GitHub Desktop.
library quality mass rename
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
""" | |
hacky mass rename with quality | |
let's hope this doesn't fuck up | |
""" | |
import os | |
for d in os.listdir('.'): | |
try: | |
files = os.listdir(d) | |
except NotADirectoryError: | |
continue | |
for f in files: | |
if '720' in f: q = '720' | |
if '1080' in f: q = '1080' | |
if '576' in f: q = '576' | |
if '480' in f: q = '480' | |
try: | |
q | |
except NameError: | |
continue | |
os.system( 'mv "{}" "{}"'.format(d, d+' [{}]'.format(q)) ) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment