[Request] linux_2rename.sh / win_click2rename.bat

Share your scripts or request scripts with specific features.
Forum rules
Please keep the forum clean - one topic per script. Questions not related to a specific script should be posted in Support forum.
NeoXiD
Posts: 5
Joined: 14 Nov 2014, 06:54
Location: Switzerland

[Request] linux_2rename.sh / win_click2rename.bat

Post by NeoXiD » 18 Nov 2014, 20:31

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

clintonhall
Posts: 449
Joined: 15 Dec 2012, 01:52
Location: Australia
Contact:

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

Post by clintonhall » 18 Nov 2014, 22:03

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.

NeoXiD
Posts: 5
Joined: 14 Nov 2014, 06:54
Location: Switzerland

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

Post by NeoXiD » 19 Nov 2014, 17:20

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.

clintonhall
Posts: 449
Joined: 15 Dec 2012, 01:52
Location: Australia
Contact:

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

Post by clintonhall » 19 Nov 2014, 20:00

I'll try and post a script here soon...

clintonhall
Posts: 449
Joined: 15 Dec 2012, 01:52
Location: Australia
Contact:

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

Post by clintonhall » 19 Nov 2014, 22:54

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...

hugbug
Developer & Admin
Posts: 7514
Joined: 09 Sep 2008, 11:58
Location: Germany

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

Post by hugbug » 20 Nov 2014, 13:31

Excellent stuff. Thank you Clinton. I guess it's worth an own topic?

clintonhall
Posts: 449
Joined: 15 Dec 2012, 01:52
Location: Australia
Contact:

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

Post by clintonhall » 20 Nov 2014, 20:19

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.

NeoXiD
Posts: 5
Joined: 14 Nov 2014, 06:54
Location: Switzerland

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

Post by NeoXiD » 21 Nov 2014, 20:16

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

clintonhall
Posts: 449
Joined: 15 Dec 2012, 01:52
Location: Australia
Contact:

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

Post by clintonhall » 21 Nov 2014, 20:57

Thanks for the feedback.

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

NeoXiD
Posts: 5
Joined: 14 Nov 2014, 06:54
Location: Switzerland

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

Post by NeoXiD » 21 Nov 2014, 21:25

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. :)

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests