Page 1 of 1
count missing blocks before downloading rars?
Posted: September 7th, 2010, 1:15 pm
by billschu
Apologies if I missed it somewhere but I don't see anyplace we can tell sabnzbd to scan an nzb and total missing blocks to determine whether or not there are enough pars to repair BEFORE downloading all the rars. (something like
http://www.jongma.org/nzbscan/ only for linux)
(whether or not the feature exists, the FAQ on par post-proceesing would be a great place to include this info)
TIA
Re: count missing blocks before downloading rars?
Posted: February 4th, 2011, 6:50 am
by john3voltas
Sorry but I'm reviving an old thread but a most interesting one.
Who hasn't already bumped into fake usenet posts/nzb's?
Checking for password protection AND for enough repairing blocks BEFORE the download actually starts would be a killer!
I'd say, nzbscan but not for Windows-only. We'd need it for Win32/64 and all *nix (linux/bsd/mac osx).
Does anyone know how nzbscan works?
How can it detect if articles are missing prior to downloading?
How can it detect if the content is password protected prior to downloading?
If we can understand how it works, maybe someone can make an addon for SAB+.
Cheers
Re: count missing blocks before downloading rars?
Posted: February 4th, 2011, 10:40 am
by inpheaux
This has actually already been done as a python script, and it was pretty damn fast too. Unfortunately, I can't seem to find the thread now.
Re: count missing blocks before downloading rars?
Posted: February 4th, 2011, 11:10 am
by john3voltas
inpheaux wrote:
This has actually already been done as a python script, and it was pretty damn fast too. Unfortunately, I can't seem to find the thread now.
Really??
That'd be a cool thing to have running on my box.
Can you remember who coded the Py script?
Thanks Inpheaux.
Cheers
Re: count missing blocks before downloading rars?
Posted: February 4th, 2011, 12:27 pm
by john3voltas
Could by any chance,
this be it?
Re: count missing blocks before downloading rars?
Posted: February 4th, 2011, 12:57 pm
by inpheaux
Yep, that's it. Now that we've got pre-processing scripts in 0.6 this would be pretty easy to implement.
Re: count missing blocks before downloading rars?
Posted: February 4th, 2011, 1:18 pm
by john3voltas
Thanks Inpheaux.
Your tips were valuable in this search.
I'll, hpefully, take a look at this over the weekend.
Cheers
Re: count missing blocks before downloading rars?
Posted: February 9th, 2011, 10:21 am
by RXP
Would be really great to see this implemented in the actual program rather than a script in a new version. Would save a ton of collective bandwidth!
Re: count missing blocks before downloading rars?
Posted: February 9th, 2011, 6:49 pm
by john3voltas
RXP wrote:
Would be really great to see this implemented in the actual program rather than a script in a new version. Would save a ton of collective bandwidth!
I second that

And also check for passworded articles too

Cheers
Re: count missing blocks before downloading rars?
Posted: February 10th, 2011, 6:53 am
by shypike
john3voltas wrote:
And also check for passworded articles too
Already in the code for 0.6.0
As for the pre-download check:
It's a massive amount of work, because it doesn't fit very well in the current design.
Re: count missing blocks before downloading rars?
Posted: February 10th, 2011, 9:49 am
by sander
@shypike:
has a pre-queue script access to the sabnzbd-settings/parameters/functions like newsserver(s) and accounts? Or is it a completely separate scope?
Re: count missing blocks before downloading rars?
Posted: February 10th, 2011, 10:18 am
by shypike
Separate scope.
You'd need to find and parse the INI file.
The API is not usable, because it won't give you the actual server passwords (security!).
Re: count missing blocks before downloading rars?
Posted: February 10th, 2011, 12:13 pm
by sander
shypike wrote:
Separate scope.
You'd need to find and parse the INI file.
The API is not usable, because it won't give you the actual server passwords (security!).
To parse the INI: I tried Python's ConfigParser, but it doesn't like the first line "__version__ = 19". When I remove that line, it's OK.
So: ConfigParser (if so: how to handle the first line), or a hand made parser (like
http://www.decalage.info/en/python/configparser)?
EDIT:
This is what ConfigParser sees (after removing the first line from the ini):
Code: Select all
sander@lifebook:~/config-parser$ python lezen.py
['[apps', '[misc', '[consoles', '[music', 'servers', '[books', 'newzbin', '[emulation', '[unknown', 'nzbmatrix', 'misc', '[reader.ipv6.xsnews.nl', '[tv', '[news.lightningusenet.com', 'categories', '[anime', 'logging', '[movies', '[games', '[pda', '[newsreader3.eweka.nl', '[newszilla6.xs4all.nl:119', '[resources', '[*']
... which is quite a different order than what's in the sabnzbd.ini file :-(
Code: Select all
sander@lifebook:~/config-parser$ grep "\[" sabbie.ini
[misc]
[logging]
[newzbin]
[nzbmatrix]
[categories]
[[misc]]
[[tv]]
[[unknown]]
[[resources]]
[[apps]]
[[movies]]
[[consoles]]
[[books]]
[[games]]
[[anime]]
[[music]]
[[pda]]
[[emulation]]
[[*]]
[servers]
[[newszilla6.xs4all.nl:119]]
[[reader.ipv6.xsnews.nl]]
[[news.lightningusenet.com]]
[[newsreader3.eweka.nl]]
sander@lifebook:~/config-parser$
Re: count missing blocks before downloading rars?
Posted: February 10th, 2011, 12:48 pm
by jcfp
Sab itself uses
configobj.
Re: count missing blocks before downloading rars?
Posted: February 10th, 2011, 1:33 pm
by sander
Cool. That works. See code snippet.
Thank you.
Code: Select all
from sabnzbd.utils import configobj
# config = ConfigObj('/home/sander/.sabnzbd/sabnzbd.ini')
CFG = configobj.ConfigObj('/home/sander/.sabnzbd/sabnzbd.ini')
section1 = CFG['misc']
#print section1
serversection = CFG['servers']
# print serversection
print "servers defined:"
for server in CFG['servers']:
print server
print CFG['servers'][server]
print "... with host name:"
print CFG['servers'][server]['host']
print "... with username:"
print CFG['servers'][server]['username']
print "subsection:"
print CFG['servers']['newszilla6.xs4all.nl:119']
print "... with host name:"
print CFG['servers']['newszilla6.xs4all.nl:119']['host']