r/programmingrequests • u/kzzyn • Feb 24 '21
Solved✔️ [REQUEST] Rename subtitle files (Python)
I was looking for a way to rename multiple subtitle files to match the names of each episode of a TV show.
I found something, but nothing that suits me.
Then I found this:
https://github.com/Eshaan7/RenameThemSubs
There is a python script and exe for windows.
This does exactly what I need. After executing, it asks for a path and then for subtitle file extension.
I dont have any programming skills, so I would like someone to make changes to it.
I want to:
-
remove the three choices. I need it to work only in current directory (as in choice 3).
2)
I need it to rename only .srt files - remove the input and always add ".srt" extension.
3)
remove the need to press Q to quit.
and no pop-up windows
I need an exe file to run in Windows. Then I could drag it to the Total Commander toolbar to make it a "button".
Total Commander then tells it the current (working) directory from the active panel.
This way I just put subtitles to a folder and rename them with one click
Will someone take a look at it, please.
View all comments
Show parent comment
1
u/RyanHx Apr 04 '21
You could try using PyInstaller directly instead of through auto-py-to-exe (it's just a wrapper for PyInstaller). Install PyInstaller via
pip install pyinstaller, then open a cmd console and run:pyinstaller -F --distpath "C:\path\to\output\folder" "C:\path\to\python\script\main.py", including the quotes.I'm not sure if auto-py-to-exe would update PyInstaller to the latest version, so it's worth a shot doing it manually like this.
I know it's a bit of pain going through this stuff for now, but I figured if you later want to change it again it'll mean you'll be able to compile it all yourself.