[SOLVED] Deobfuscate.py fails with Found multiple larger files, aborting when using +UNPACK and rars are over 40 MB

Come up with a useful post-processing script? Share it here!
Post Reply
augur
Newbie
Newbie
Posts: 17
Joined: September 11th, 2011, 4:54 pm

[SOLVED] Deobfuscate.py fails with Found multiple larger files, aborting when using +UNPACK and rars are over 40 MB

Post by augur »

Error:
If you have Processing set to +UNPACK and your rars are over 40MB the script deobfuscate.py doesn't rename the extracted file to the job-name because it detects the rars as additional 'large files' and aborts with error text
Found multiple larger files, aborting
No par2 files or large files found
Solution is to duplicate Deobfuscate.py and give it another name (e.g. DeobExclRars.py or Deobfuscate100MB.py), place it in a new script folder out of the install directory (remembering to change the config to point to new script folder) then modify the script in one of two ways.

Fix 1:
Change
EXCLUDED_FILE_EXTS = ('.vob', '.bin')
add the file extension rar
EXCLUDED_FILE_EXTS = ('.vob', '.bin', '.rar')
Limitation is it wont work for old style r00, r02, etc names.

OR

Fix 2:
Change
MIN_FILE_SIZE = 40*1024*1024
to a larger value e.g. 100MB
MIN_FILE_SIZE = 100*1024*1024
Limitation is it won't work for rar files above 100MB.

FEEDBACK
Of the two Fix 1 is the more appropriate remedy as you don't see many old style rar names any more.
I don't use +Delete as I prefer to hold onto the rar files for a little bit until I've checked the extracted files.


Background info
As someone who just updated to version 2.3.9 from a much earlier version because I was finally fed up manually figuring out which was the par2 file from all the random names and other obfuscation and because it's now running as a service on a server I figured I should belatedly start utilising +UNPACK and figure out how to automatically rename the extracted file to the original name.


Problem resolving thought processes waffle.
Attempt 1 Deobfuscate.py
Script Message
'"python"' is not recognized as an internal or external command, operable program or batch file.
Apparently I need to install python 2.7.16 ::) - DONE

Attempt 2 Deobfuscate.py
Script Message
No par2 files or large files found
Looks like deobfuscate.py doesn't do that :( - Time to try Sorting

Attempt 3 Sorting %dn.%ext
Why are all the files in the root? - search forum - oh it should be %dn/%dn.%ext
Why are all the rar files in the folder renamed to %dn.%ext followed by .1 .2 .3 etc?
Search forum again, apparently that's how sorting works, it's either all files or none. There's no way to separate rars from mkv for renaming. - Time for another look at deobfuscate.py

Full error message from deobfuscate.py
Found multiple larger files, aborting.
No par2 files or large files found
Remote into server and copy deobfuscate.py to local machine and open in text editor.
Search for "No par2 files or large files found"
Figure out that phrase is just the final else statement for something went wrong
Search for "Found multiple larger files, aborting."
Ah now we're getting somewhere, that error message is because there is more than one file (I like comments in code) and it doesn't know which one to rename, and it's handily listed them for me... why is a rar file being listed?

Oh look, there's a line above that has the following in it.
if file_size > MIN_FILE_SIZE
Lets find where the variable MIN_FILE_SIZE is defined
MIN_FILE_SIZE = 40*1024*1024
That's 40MB, so anything over that is inspected. How big are my rars? 75MB! that'll be the problem then.

Now I just need to modify the code so the limit is above 75MB, lets make it 100MB just for a bit of room.
MIN_FILE_SIZE = 100*1024*1024
then install it in the scripts folder.

Reads notes section.
NOTES:
4) If you want to modify this script, make sure to copy it out
of this directory, or it will be overwritten when SABnzbd is updated.
And I'd better rename it to deobfuscate100MB.py and create a new script folder elsewhere to prevent it being overwritten.

Reads other variable
EXCLUDED_FILE_EXTS = ('.vob', '.bin')
Why aren't rar files included in this excluded file extension list?
EXCLUDED_FILE_EXTS = ('.vob', '.bin', '.rar')
This should work for all new version *.rar but not old style .r00
I think this is the better solution so change to this 'fix'.
;D

Reads notes section a bit more
3) If there are multiple larger (>40MB) files, then the script will not
rename anything, since it could be a multi-pack.
:'(
Always read any Notes first.
User avatar
safihre
Administrator
Administrator
Posts: 5510
Joined: April 30th, 2015, 7:35 am
Contact:

Re: [SOLVED] Deobfuscate.py fails with Found multiple larger files, aborting when using +UNPACK and rars are over 40 MB

Post by safihre »

Glad you figured it out and got it working for you :)

Could also try the Config > Sorting options to rename the final files using the "Filename as Jobname" preset.
If you like our support, check our special newsserver deal or donate at: https://sabnzbd.org/donate
augur
Newbie
Newbie
Posts: 17
Joined: September 11th, 2011, 4:54 pm

Re: [SOLVED] Deobfuscate.py fails with Found multiple larger files, aborting when using +UNPACK and rars are over 40 MB

Post by augur »

safihre wrote: October 29th, 2019, 3:31 pm Could also try the Config > Sorting options to rename the final files using the "Filename as Jobname" preset.
I tried that but I'm using +UNPACK at the moment and Sorting renames all the rars too, creating a bit of a mess. if I was using +DELETE (when I'm braver maybe) it would work.
Post Reply