Page 1 of 2

[Request] linux_2rename.sh / win_click2rename.bat

Posted: 18 Nov 2014, 20:31
by NeoXiD
Hello

I'm struggling with NZBdrone as quite a lot german releases actually include obfuscated file names, which can be deobfuscated by running "win_click2rename.bat" or "linux_2rename.sh" scripts. That feature was actually included into clinton-hall's nzbToMedia, but I only want that one specific feature and not the whole script. Is there any easy way to do so?

https://github.com/clinton-hall/nzbToMe ... ca85e7fe8f

Regards
NeoXiD

Re: [Request] linux_2rename.sh / win_click2rename.bat

Posted: 18 Nov 2014, 22:03
by clintonhall
I could create this as a stand-alone script...

The main thing with this is that my script does not execute any .sh/.bat/.exe files (doing so would be dangerous).
Instead, my script looks for .sh/.bat/.exe and then tries to read them as text.... Only if it finds a valid rename command will it attempt to do the rename.

Re: [Request] linux_2rename.sh / win_click2rename.bat

Posted: 19 Nov 2014, 17:20
by NeoXiD
Well that is even better in my opinion, as these files always follow the same syntax and it would be a bit dangerous to just run ANY batch file with that name, could be easily misused. Could you give me any hints / help for converting a standalone script? The whole postprocessing thingy looks a bit complicated and I wasn't really able to get on track what I would have to do so that it will still work.

Re: [Request] linux_2rename.sh / win_click2rename.bat

Posted: 19 Nov 2014, 20:00
by clintonhall
I'll try and post a script here soon...

Re: [Request] linux_2rename.sh / win_click2rename.bat

Posted: 19 Nov 2014, 22:54
by clintonhall
ok.. I have moved a lot of my "other" scripts to a new repository
https://github.com/clinton-hall/GetScripts

there is a script there called SafeRename.py
Please try that...

Re: [Request] linux_2rename.sh / win_click2rename.bat

Posted: 20 Nov 2014, 13:31
by hugbug
Excellent stuff. Thank you Clinton. I guess it's worth an own topic?

Re: [Request] linux_2rename.sh / win_click2rename.bat

Posted: 20 Nov 2014, 20:19
by clintonhall
Yeah... Probably...
do you want me to start it?

also, the details you have showing the scripts included in nzbToMedia will need to be updated as ResetDateTimes and DeleteSamples have been removed from nightly build and will soon be removed from master.

Re: [Request] linux_2rename.sh / win_click2rename.bat

Posted: 21 Nov 2014, 20:16
by NeoXiD
Hello clintonhall

Thank you very much for making this a standalone script! It almost worked fine, I just had to do a slight adjusment. I have actually changed the regular expression to (?:mv|Move)\s+(\S+)\s+(\S+), as all of the rename scripts I had locally included additional spaces inbetween the command and the parameters. By requiring atleast one space inbetween them instead of just exactly one space, the script worked like a charm! :D

Regards
NeoXiD

Re: [Request] linux_2rename.sh / win_click2rename.bat

Posted: 21 Nov 2014, 20:57
by clintonhall
Thanks for the feedback.

Does this look right?
https://github.com/clinton-hall/GetScri ... f4b3edf5ec

Re: [Request] linux_2rename.sh / win_click2rename.bat

Posted: 21 Nov 2014, 21:25
by NeoXiD
Exactly! Thank you so much again, now NZBdrone finally works correctly. About 40% of my german releases included such an ugly rename script so I'm really glad that this issue got sorted out. :)