Unrar .rar files in .rar archives

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.
JonM
Posts: 5
Joined: 25 Apr 2018, 09:46

Re: Unrar .rar files in .rar archives

Post by JonM » 26 Apr 2019, 17:51

no worries my dude....

If you're using categories you'll need to set the script in the categories settings too, could be worth a check?

As a side note, I've actually disabled this script now. I found that the number of downloads that failed because of nested .rar files without the script was actually much lower than the number of good downloads that this script caused to fail.

I'm planning on having a fiddle around with the script at some point and doing some testing to see if I can get it improved but for now I've got it switched off. Might get a chance this weekend actually. Not sure what's happened to the original author, seems to have not been here a while and I don't fully understand everything that's going on.

I'm really hoping that this will eventually make it into the nzbget native features as it's not exactly an uncommon occurrence to have the nested packages.

Anyone heard anything?

Cheers,
Jon
Attachments
ExtendedUnrar.py
(6.9 KiB) Downloaded 911 times

ahughes03
Posts: 3
Joined: 26 Apr 2019, 17:11

Re: Unrar .rar files in .rar archives

Post by ahughes03 » 26 Apr 2019, 18:08

UPDATE: I think Jon's the man! His script worked (for me) in a FreeNAS Jail environment without issues. I've tested across downloads that needed nested unpacking and downloads that don't, and his script seems to work fine for me.

To be transparent:

NZBGet: Version 20.0_1 (FreeBSD - pkg install version)
FreeNAS Jail: 11.2-RELEASE
FreeNAS: FreeNAS-11.2-RELEASE-U1 (slow to update, given the track-record)

Thanks Jon!

I was able to get the modified script working, and tested it against a file that needed the nested rar's unpacked (worked sucessfully) and also against a file that wouldn't have needed the script (no nested rars)- in this case, the script exited gracefully and my file manager was able to process the file afterwards.

What kind of errors were you seeing- as in, how was the script causing the good downloads to fail? I'll have to watch my files closely to see if this also happens to me.

Bun
Posts: 1
Joined: 28 Apr 2019, 05:32

Re: Unrar .rar files in .rar archives

Post by Bun » 28 Apr 2019, 05:49

Seems a lot of people are running into nested rar files lately... :)

I too found the old version of this script about a week ago and spent some time fixing it up based on issues others on this thread have found and fixed. I've also cleaned it up a fair bit and removed a bunch of the older nzbget script-isms. Also removed some totally unnecessary bits (eg. _brokenlog.txt check, etc etc.) I run nzbget on a Linux box so I also made sure the script could handle case-sensitive filenames like .rar and .RAR.

I've been running it for about a week now and haven't had any issues. No guarantees of course! :D I don't use Windows so I have no idea if it works there or not. If you've used the original version of this script, please pay attention to the new default for the "RarExtensions" setting -- best to use the default.

Maybe this inspires somebody else to improve it even further. Hope it helps somebody out...

Edit... I might add that if you want to change the unrar options, you'll have to dig into the code still. I use the options "unrar e -idp -ai -o-" with unrar 5.71.
Attachments
ExtendedUnrar.py
(5.99 KiB) Downloaded 1254 times

manifest3r
Posts: 1
Joined: 28 Apr 2019, 06:39

Re: Unrar .rar files in .rar archives

Post by manifest3r » 28 Apr 2019, 06:42

Bun wrote:
28 Apr 2019, 05:49
Seems a lot of people are running into nested rar files lately... :)

I too found the old version of this script about a week ago and spent some time fixing it up based on issues others on this thread have found and fixed. I've also cleaned it up a fair bit and removed a bunch of the older nzbget script-isms. Also removed some totally unnecessary bits (eg. _brokenlog.txt check, etc etc.) I run nzbget on a Linux box so I also made sure the script could handle case-sensitive filenames like .rar and .RAR.

I've been running it for about a week now and haven't had any issues. No guarantees of course! :D I don't use Windows so I have no idea if it works there or not. If you've used the original version of this script, please pay attention to the new default for the "RarExtensions" setting -- best to use the default.

Maybe this inspires somebody else to improve it even further. Hope it helps somebody out...

Edit... I might add that if you want to change the unrar options, you'll have to dig into the code still. I use the options "unrar e -idp -ai -o-" with unrar 5.71.
Bro...I was just in the middle of trying to implement the script and not even 10 minutes after you posted I see your post! If that's not good timing I don't know what is. Thanks! It's working great :)

Krocko
Posts: 4
Joined: 21 Nov 2019, 08:28

Re: Unrar .rar files in .rar archives

Post by Krocko » 21 Nov 2019, 08:31

Ich bekomme immer folgende Fehler:

Code: Select all

INFO Thu Nov 21 2019 09:24:50 Post-process-script ExtendedUnrar.py for xxxxx skipped
ERROR Thu Nov 21 2019 09:24:50 ExtendedUnrar: Extract failed, Returncode 255
INFO Thu Nov 21 2019 09:24:50 ExtendedUnrar: Program aborted
INFO Thu Nov 21 2019 09:24:50 ExtendedUnrar: UNRAR 5.70 freeware Copyright (c) 1993-2019 Alexander Roshal
INFO Thu Nov 21 2019 09:24:50 ExtendedUnrar: Extracting xxxxxx.rar
DETAIL Thu Nov 21 2019 09:24:50 ExtendedUnrar: Searching for rar/RAR files
DETAIL Thu Nov 21 2019 09:24:50 ExtendedUnrar: Sleeping 0 seconds to give NZBGet time to finish UnpackCleanupDisk action
INFO Thu Nov 21 2019 09:24:50 ExtendedUnrar: Script successfully started - python sys.version_info(major=2, minor=7, micro=12, releaselevel='final', serial=0)
INFO Thu Nov 21 2019 09:24:50 Executing post-process-script ExtendedUnrar.py for xxxxxx

iaTa
Posts: 5
Joined: 09 Mar 2019, 18:21

Re: Unrar .rar files in .rar archives

Post by iaTa » 14 Dec 2019, 16:40

Bun wrote:
28 Apr 2019, 05:49
Seems a lot of people are running into nested rar files lately... :)

I too found the old version of this script about a week ago and spent some time fixing it up based on issues others on this thread have found and fixed. I've also cleaned it up a fair bit and removed a bunch of the older nzbget script-isms. Also removed some totally unnecessary bits (eg. _brokenlog.txt check, etc etc.) I run nzbget on a Linux box so I also made sure the script could handle case-sensitive filenames like .rar and .RAR.

I've been running it for about a week now and haven't had any issues. No guarantees of course! :D I don't use Windows so I have no idea if it works there or not. If you've used the original version of this script, please pay attention to the new default for the "RarExtensions" setting -- best to use the default.

Maybe this inspires somebody else to improve it even further. Hope it helps somebody out...

Edit... I might add that if you want to change the unrar options, you'll have to dig into the code still. I use the options "unrar e -idp -ai -o-" with unrar 5.71.
This script worked perfectly for me on Windows running the latest NZBGet (21.1-testing-r2311), thank you!

I did have to add quotation marks around the UnrarPath script configuration setting: "${AppDir}\unrar.exe"

I also had to use Python 2 rather than 3.

owine
Posts: 6
Joined: 05 Jan 2020, 00:02

Re: Unrar .rar files in .rar archives

Post by owine » 05 Jan 2020, 00:07

This is a great script. I hope it can be updated for Python 3. I am receiving the following errors now.

Code: Select all

Sat Jan 04 2020 17:30:03	INFO	Executing post-process-script ExtendedUnrar.py for zzzzzzzzzzz
Sat Jan 04 2020 17:30:03	INFO	ExtendedUnrar: Traceback (most recent call last):
Sat Jan 04 2020 17:30:03	INFO	ExtendedUnrar:   File "/scripts/nzbget/ExtendedUnrar.py", line 79, in <module>
Sat Jan 04 2020 17:30:03	INFO	ExtendedUnrar:     print('[INFO] Script successfully started - python %s' % sys.version_info)
Sat Jan 04 2020 17:30:03	INFO	ExtendedUnrar: TypeError: not all arguments converted during string formatting
Sat Jan 04 2020 17:30:03	ERROR	Post-process-script ExtendedUnrar.py for zzzzzzzzzzz failed (terminated with unknown status)

JonM
Posts: 5
Joined: 25 Apr 2018, 09:46

Re: Unrar .rar files in .rar archives

Post by JonM » 05 Jan 2020, 09:58

I had this issue...

Remove " - python %s' % sys.version_info" from line 79 and you should be fine.

Cheers,
Jon

bluecat
Posts: 2
Joined: 05 Jan 2022, 14:35

Re: Unrar .rar files in .rar archives

Post by bluecat » 05 Jan 2022, 14:40

I tried the script from Bun, but it don't work for me. I'm using Ubuntu. I've installed it and selected it on the settings menu. I just get this message which does not really help:

Code: Select all

Post-process-script ExtendedUnrar.py for Moviename-Release failed (terminated with unknown status)
Any idea what I can do? Or does someone have another script that is working?

Thanks!

gsatvgrp001
Posts: 1
Joined: 22 Sep 2021, 18:40

Re: Unrar .rar files in .rar archives

Post by gsatvgrp001 » 24 Feb 2022, 16:54

bluecat wrote:
05 Jan 2022, 14:40
I tried the script from Bun, but it don't work for me. I'm using Ubuntu. I've installed it and selected it on the settings menu. I just get this message which does not really help:

Code: Select all

Post-process-script ExtendedUnrar.py for Moviename-Release failed (terminated with unknown status)
Any idea what I can do? Or does someone have another script that is working?

Thanks!
It took me a little while to get this script to run properly, my main issue was I couldn't keep up with what the logs were spitting out and me (and to be frank, I was a little too lazy to start digging through the logs lol)

But what I had to do, was the first line of the script, change it from
"#!/usr/bin/env python"
to,
"#!/usr/bin/env python3"

and on line #79 it should look exactly as follows (without quotation marks):
" 79 print('[INFO] Script successfully started')"

Hopefully that helps you out!

Post Reply

Who is online

Users browsing this forum: No registered users and 48 guests