Closed w00druff closed 9 years ago
ok... give this ago...
I don't know what will happen if they change the naming convention from what you have described...
Thanks, but it doesnt work :( p = Popen(cmd2, stdout=devnull, stderr=devnull) cmd2 is not defined, i have tried it with cmd instead. Then it tells me that he is extracting the "a_Linux_2rename.sh" file but nothing happens.
hmmm.. try this last one..
Thanks, extracting works now, but then i get this.
[INFO] Extraction was successfull
Traceback (most recent call last):
File "/home/sabnzbd/.sabnzbd/scripts/SafeRename.py", line 147, in
ok... sorry for that. I reset the cmd before trying ti build the new file name. This last one should get closer...
No problem, thank you ! I think we get a bit closer to the goal :) Now i get "extraction successfull" but no renamings done.
Just to check, this is the content of the extracted "What.sh" file:
mkdir Testdir mv 05.02.2015.1 Test1/test.nfo mv 05.02.2015.2 Test1/testmovie.mkv mv 05.02.2015.3 Test1/Subs mv Test1/Subs/05.02.2015.4 Test1/Subs/test.sub mv Test1/Subs/05.02.2015.5 Test1/Subs/test.idx
ok... can you test this?
Same result, extraction successfull but nothing further ... It is slowly getting me uncomfortable because of your time :( What about just running that What.sh file if there just mv/move/mkdir commands in within THIS dir ?
ok, can you try again. This won't work yet, but it should add new logging that will help show where this goes wrong.
I'm expecting it is looking for the wrong file, but I can't see why right now.
and don't be uncomfortable about this... This is my project and I only spend what time I can...
[INFO] Extracting file /media/ed602aaf-dacf-4178-bca6-d6652f1d95d6/DATA/_DOWNLOAD/532ff4ee_0f5c1c3c_9b29df68_bf88dcd-u4e/532ff4ee_0f5c1c3c_9b29df68_bf88dcd/a_Linux_2rename.sh with command unrar x -p2540117263 What.rar [INFO] Extraction was successfull [INFO] Checking for file /media/ed602aaf-dacf-4178-bca6-d6652f1d95d6/DATA/_DOWNLOAD/532ff4ee_0f5c1c3c_9b29df68_bf88dcd-u4e/532ff4ee_0f5c1c3c_9b29df68_bf88dcd/What.sh [INFO] Reading lines from /media/ed602aaf-dacf-4178-bca6-d6652f1d95d6/DATA/_DOWNLOAD/532ff4ee_0f5c1c3c_9b29df68_bf88dcd-u4e/532ff4ee_0f5c1c3c_9b29df68_bf88dcd/What.sh
sorry for the delay here... but this project does come second to life :) I recon I found the issue. This should hopefully make this work, but in any case I have increased the logging (for now) to try and see where it falls over if it doesn't work.
I can check in ~2hours, thanks mate :)
Ill post log after parsing and i can see the problem. In our What.sh file is a mkdir command ... he wants to make the dir DIRXXXXXXX. So renaming doesnt work because of the missing dir i think ?
[INFO] Renaming file /media/ed602aaf-dacf-4178-bca6-d6652f1d95d6/DATA/_DOWNLOAD/532ff4ee_0f5c1c3c_9b29df68_bf88dcd-u4e/532ff4ee_0f5c1c3c_9b29df68_bf88dcd/05.02.2015.1 to /media/ed602aaf-dacf-4178-bca6-d6652f1d95d6/DATA/_DOWNLOAD/532ff4ee_0f5c1c3c_9b29df68_bf88dcd-u4e/532ff4ee_0f5c1c3c_9b29df68_bf88dcd/DIRXXXXXXX/xxxxxxx.nfo [ERROR] Unable to rename file due to: [Errno 2] No such file or directory
ok... added the mkdir command... can't believe I missed that!
Okay mkdir worked and nearly all files got renamed :)
Here the What.sh file with notes what worked:
mkdir Test CHECK ! mv 05.02.2015.1 Test/test.nfo CHECK ! mv 05.02.2015.2 Test/Test.mkv CHECK ! mv 05.02.2015.3"SPACESPACE"Test/Subs NOPE ! mv Test/Subs/05.02.2015.4"SPACESPACE"Test/Subs/Test.sub NOPE ! mv Test/Subs/05.02.2015.5"SPACESPACE"Test/Subs/Test.idx NOPE !
Maybe because there are two spaces in the other mv commands ? EDIT Github ignores the two spaces, i "highlighted" them.
the problem was it only renamed files, not directories... this should work now
sorry for the lengthy process here...
Okay i can try in few hours, thanks ! You do not have to apologize, I appreciate your time !!!
Okay mate, works very good, thanks a lot ! Last question, is it possible for you to chmod 775 all files and dirs after successfull rename ? And maybe also a cleanup of all .sh, .rar, .zip, .bat files ? :)
Finally added...
Some boards are packing the rename.sh file now- within a password protected rar archive named What.rar
There is a „a_Linux_2rename.sh“ file in main dir now containing this: unrar x -p73522169 What.rar ./What.sh
Now that What.sh file is our rename script containing our known move commands.