changeset 28:30e203432cd7

Add rename.py
author Paper <mrpapersonic@gmail.com>
date Sat, 29 May 2021 10:38:10 -0400
parents 0f81a012ead6
children 41bf22504479
files README.md rename.py
diffstat 2 files changed, 21 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/README.md	Sat May 15 01:14:13 2021 -0400
+++ b/README.md	Sat May 29 10:38:10 2021 -0400
@@ -18,14 +18,18 @@
 ### peardeck.cpp / peardeck.py
 a bad peardeck sentence generator, will only accept inputs from 5-6 characters. i made a python version of this that i like much more than the c++ version
 
+### pixivimageposter.py
+posts images downloaded with pixivutil2 and interprets the id and image number from the filename
+
 ### python3path.bat
 a batch script to put python3 in the path. made this cause my friend didn't know how paths worked
 
-### pixivimageposter.py
-posts images downloaded with pixivutil2 and interprets the id and image number from the filename
+### rename.py
+originally created for lucky star, this gets a ton of episode names (or whatever) from a list and renames files accordingly<br>
+made this mainly cause i'm lazy and don't want to do manual renaming
 
 ### tenormoment.bat
 another batch script that was made primarily to spam the ytpmv tag on tenor. it makes gifs of every 5 seconds of a given video file.<br>~~it is extremely unorganized, i might remake it later and remove the debug option that stands no purpose~~ done
 
 ### win95kg.cpp
-iirc the oem key only works some of the time, i don't even remember why i made it. it also has shitty function names that i might clean up in the future
+a windows 95 keygen. iirc the oem key only works some of the time, i don't even remember why i made it. it also has shitty function names that i might clean up in the future
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/rename.py	Sat May 29 10:38:10 2021 -0400
@@ -0,0 +1,14 @@
+import os
+
+titles = open('list.txt', 'r')
+titlelist = titles.readlines()
+titles.close()
+
+count = 1
+for line in titlelist:
+    line = line.rstrip("\n")
+    if int(count) <= 9:
+        os.rename(f'Lucky☆Star - 0{count}.mkv', f'Lucky☆Star - 0{count} [{line}].mkv')
+    else:
+        os.rename(f'Lucky☆Star - {count}.mkv', f'Lucky☆Star - {count} [{line}].mkv')
+    count += 1