mirror of
https://github.com/sabnzbd/sabnzbd.git
synced 2026-01-21 22:09:06 -05:00
Compare commits
21 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7170325df5 | ||
|
|
c44d98da66 | ||
|
|
018410afb0 | ||
|
|
fc47238a7a | ||
|
|
9561b8a64e | ||
|
|
7b0e56b55f | ||
|
|
c6d5a79776 | ||
|
|
faa4cacd3e | ||
|
|
56e417eea1 | ||
|
|
5f02ec00f9 | ||
|
|
5ea35db922 | ||
|
|
5dcf26a56c | ||
|
|
35b598d10e | ||
|
|
5e7b27c4ef | ||
|
|
9ed408d35b | ||
|
|
6c782fe255 | ||
|
|
1689323dc3 | ||
|
|
a3c50a907a | ||
|
|
36a3792846 | ||
|
|
4cd0c0691a | ||
|
|
6ac98dcacd |
@@ -1,5 +1,5 @@
|
||||
*******************************************
|
||||
*** This is SABnzbd 0.7.1 ***
|
||||
*** This is SABnzbd 0.7.2 ***
|
||||
*******************************************
|
||||
SABnzbd is an open-source cross-platform binary newsreader.
|
||||
It simplifies the process of downloading from Usenet dramatically,
|
||||
|
||||
@@ -1,3 +1,25 @@
|
||||
-------------------------------------------------------------------------------
|
||||
0.7.2Final by The SABnzbd-Team
|
||||
-------------------------------------------------------------------------------
|
||||
- Fix for NZB-icon issue when 0.7.0 was previously installed
|
||||
- Check validity of totals9.sab file
|
||||
- Fix startup problem when localhost has unexpected order of IP addresses
|
||||
-------------------------------------------------------------------------------
|
||||
0.7.2RC2 by The SABnzbd-Team
|
||||
-------------------------------------------------------------------------------
|
||||
- Improve support for nzbsrus.com
|
||||
- Don't try to show NZB age when not known yet
|
||||
- Prevent systems with unresolvable hostnames from always using 0.0.0.0
|
||||
-------------------------------------------------------------------------------
|
||||
0.7.2RC1 by The SABnzbd-Team
|
||||
-------------------------------------------------------------------------------
|
||||
- Fix fatal error in nzbsrus.com support
|
||||
- Initial "quota left" was not set correctly when enabling quota
|
||||
- Report incorrect RSS filter expressions (instead of aborting analysis)
|
||||
- Improve detection of invalid articles (so that backup server will be tried)
|
||||
- Windows installer: improve NZB association so that a reboot isn't needed
|
||||
- Windows installer: don't remove settimngs by default when uninstalling
|
||||
- Fix sorting of rar files in job so that .rar preceeds .r00
|
||||
-------------------------------------------------------------------------------
|
||||
0.7.1Final by The SABnzbd-Team
|
||||
-------------------------------------------------------------------------------
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
SABnzbd 0.7.1
|
||||
SABnzbd 0.7.2
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
0) LICENSE
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
|
||||
!include "MUI2.nsh"
|
||||
!include "registerExtension.nsh"
|
||||
!include "FileFunc.nsh"
|
||||
!include "LogicLib.nsh"
|
||||
!include "WinVer.nsh"
|
||||
!include "WinSxSQuery.nsh"
|
||||
@@ -351,7 +352,7 @@ SectionEnd ; end of desktop icon section
|
||||
|
||||
Section /o $(MsgAssoc) assoc
|
||||
${registerExtension} "$INSTDIR\icons\nzb.ico" "$INSTDIR\SABnzbd.exe" ".nzb" "NZB File"
|
||||
;${registerExtension} "$INSTDIR\SABnzbd.exe" ".nzb" "NZB File"
|
||||
${RefreshShellIcons}
|
||||
SectionEnd ; end of file association section
|
||||
|
||||
; begin uninstall settings/section
|
||||
@@ -407,11 +408,11 @@ Section "un.$(MsgDelProgram)" Uninstall
|
||||
DeleteRegKey HKEY_CURRENT_USER "Software\SABnzbd"
|
||||
|
||||
${unregisterExtension} ".nzb" "NZB File"
|
||||
|
||||
${RefreshShellIcons}
|
||||
|
||||
SectionEnd ; end of uninstall section
|
||||
|
||||
Section "un.$(MsgDelSettings)" DelSettings
|
||||
Section /o "un.$(MsgDelSettings)" DelSettings
|
||||
DetailPrint "Uninstall settings $LOCALAPPDATA"
|
||||
Delete "$LOCALAPPDATA\sabnzbd\sabnzbd.ini"
|
||||
RMDir /r "$LOCALAPPDATA\sabnzbd"
|
||||
|
||||
4
PKG-INFO
4
PKG-INFO
@@ -1,7 +1,7 @@
|
||||
Metadata-Version: 1.0
|
||||
Name: SABnzbd
|
||||
Version: 0.7.1
|
||||
Summary: SABnzbd-0.7.1
|
||||
Version: 0.7.2
|
||||
Summary: SABnzbd-0.7.2
|
||||
Home-page: http://sourceforge.net/projects/sabnzbdplus
|
||||
Author: The SABnzbd Team
|
||||
Author-email: team@sabnzbd.org
|
||||
|
||||
20
README.rtf
20
README.rtf
@@ -4,16 +4,30 @@
|
||||
\paperw11900\paperh16840\vieww16360\viewh15680\viewkind0
|
||||
\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720
|
||||
|
||||
\f0\b\fs48 \cf0 SABnzbd 0.7.1\
|
||||
\f0\b\fs48 \cf0 SABnzbd 0.7.2\
|
||||
\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\pardirnatural
|
||||
|
||||
\b0\fs26 \cf0 \
|
||||
|
||||
\b Fixes in 0.7.2
|
||||
\b0 \
|
||||
- Improve support for nzbsrus.com\
|
||||
- Don't try to show NZB age when not known yet\
|
||||
- Prevent systems with unresolvable hostnames from always using 0.0.0.0\
|
||||
- Initial "quota left" was not set correctly when enabling quota\
|
||||
- Report incorrect RSS filter expressions (instead of aborting analysis)\
|
||||
- Improve detection of invalid articles (so that backup server will be tried)\
|
||||
- Windows installer: don't remove settings by default when uninstalling\
|
||||
- Fix sorting of rar files in job so that .rar preceeds .r00\
|
||||
- Fix for NZB-icon issue when 0.7.0 was previously installed\
|
||||
- Fix startup problem on Windows when IPv4 has precedence over IPv6\
|
||||
\
|
||||
|
||||
\b Fixes in 0.7.1
|
||||
\b0 \
|
||||
- Fixed problem were fetching par2 files after first verification could stall in the queue\
|
||||
- Fixed retry behaviour of NZB fetching from URL (with handling of nzbsrus.com error codes)\
|
||||
- Verification/repair would not be executed properly when one more RAR files missed their first article\
|
||||
- Verification/repair would not be executed properly when one more RAR files missed their first article.\
|
||||
- Improved backup of sabnzbd.ini file, now uses backup when original is gone or corrupt\
|
||||
- Several translations extended/improved\
|
||||
- Plush skin: fix problems with pull-down menus in Mobile Safari\
|
||||
@@ -31,7 +45,7 @@
|
||||
- Fix signing of OSX DMG\
|
||||
\
|
||||
|
||||
\b What's new
|
||||
\b What's new in 0.7.0
|
||||
\b0 \
|
||||
- Download quota management\
|
||||
- Windows: simple system tray menu\
|
||||
|
||||
14
README.txt
14
README.txt
@@ -1,6 +1,18 @@
|
||||
Release Notes - SABnzbd 0.7.1
|
||||
Release Notes - SABnzbd 0.7.2
|
||||
===============================
|
||||
|
||||
## Fixes in 0.7.2
|
||||
- Improve support for nzbsrus.com
|
||||
- Don't try to show NZB age when not known yet
|
||||
- Prevent systems with unresolvable hostnames from always using 0.0.0.0
|
||||
- Initial "quota left" was not set correctly when enabling quota
|
||||
- Report incorrect RSS filter expressions (instead of aborting analysis)
|
||||
- Improve detection of invalid articles (so that backup server will be tried)
|
||||
- Windows installer: don't remove settings by default when uninstalling
|
||||
- Fix sorting of rar files in job so that .rar preceeds .r00
|
||||
- Fix for NZB-icon issue when 0.7.0 was previously installed
|
||||
- Fix startup problem on Windows when IPv4 has precedence over IPv6
|
||||
|
||||
## Fixes in 0.7.1
|
||||
- Fixed problem were fetching par2 files after first verification could stall in the queue
|
||||
- Fixed retry behaviour of NZB fetching from URL (with handling of nzbsrus.com error codes)
|
||||
|
||||
42
SABnzbd.py
42
SABnzbd.py
@@ -525,30 +525,24 @@ def all_localhosts():
|
||||
return ips
|
||||
|
||||
|
||||
def ipv_localhost(v):
|
||||
""" Return True if localhost resolves to some IPV4 ('4') or IPV6 ('6') address
|
||||
def check_resolve(host):
|
||||
""" Return True if 'host' resolves
|
||||
"""
|
||||
try:
|
||||
info = socket.getaddrinfo('localhost', None)
|
||||
info = socket.getaddrinfo(host, None)
|
||||
except:
|
||||
# localhost does not resolve
|
||||
# Does not resolve
|
||||
return False
|
||||
for item in info:
|
||||
item = item[4][0]
|
||||
if v == '4' and ':' not in item:
|
||||
return True
|
||||
elif v == '6' and ':' in item:
|
||||
return True
|
||||
return False
|
||||
return True
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
def get_webhost(cherryhost, cherryport, https_port):
|
||||
""" Determine the webhost address and port,
|
||||
return (host, port, browserhost)
|
||||
"""
|
||||
if cherryhost == '0.0.0.0' and not ipv_localhost('4'):
|
||||
if cherryhost == '0.0.0.0' and not check_resolve('127.0.0.1'):
|
||||
cherryhost = ''
|
||||
elif cherryhost == '::' and not ipv_localhost('6'):
|
||||
elif cherryhost == '::' and not check_resolve('::1'):
|
||||
cherryhost = ''
|
||||
|
||||
if cherryhost is None:
|
||||
@@ -563,14 +557,18 @@ def get_webhost(cherryhost, cherryport, https_port):
|
||||
try:
|
||||
info = socket.getaddrinfo(socket.gethostname(), None)
|
||||
except:
|
||||
# Hostname does not resolve, use 0.0.0.0
|
||||
if cherryhost not in ('localhost', '127.0.0.1', '::1'):
|
||||
cherryhost = '0.0.0.0'
|
||||
# Hostname does not resolve
|
||||
try:
|
||||
info = socket.getaddrinfo(localhost, None)
|
||||
# Valid user defined name?
|
||||
info = socket.getaddrinfo(cherryhost, None)
|
||||
except:
|
||||
info = socket.getaddrinfo('127.0.0.1', None)
|
||||
localhost = '127.0.0.1'
|
||||
if cherryhost not in ('localhost', '127.0.0.1', '::1'):
|
||||
cherryhost = '0.0.0.0'
|
||||
try:
|
||||
info = socket.getaddrinfo(localhost, None)
|
||||
except:
|
||||
info = socket.getaddrinfo('127.0.0.1', None)
|
||||
localhost = '127.0.0.1'
|
||||
for item in info:
|
||||
ip = str(item[4][0])
|
||||
if ip.startswith('169.254.'):
|
||||
@@ -1372,8 +1370,8 @@ def main():
|
||||
hosts[1] = '::1'
|
||||
|
||||
# The Windows binary requires numeric localhost as primary address
|
||||
if multilocal and cherryhost == 'localhost' and hosts[1] == '127.0.0.1':
|
||||
cherryhost = '::1'
|
||||
if multilocal and cherryhost == 'localhost':
|
||||
cherryhost = hosts[0]
|
||||
|
||||
if enable_https:
|
||||
if https_port:
|
||||
@@ -1817,4 +1815,4 @@ if __name__ == '__main__':
|
||||
main()
|
||||
|
||||
else:
|
||||
main()
|
||||
main()
|
||||
@@ -208,6 +208,7 @@
|
||||
<input type="hidden" name="feed" value="$feed"/>
|
||||
<input type="hidden" name="session" value="$session">
|
||||
<input type="submit" value="$T('button-save')"/>
|
||||
<!--#if not $rss[$feed].filter_states[$fnum]#--> $T('Incorrect filter')<!--#end if#-->
|
||||
</td>
|
||||
</form>
|
||||
</tr>
|
||||
|
||||
@@ -100,7 +100,7 @@
|
||||
</fieldset>
|
||||
</div><!-- /col1 -->
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!--#end if#-->
|
||||
|
||||
@@ -341,6 +341,7 @@
|
||||
<td>
|
||||
<input type="submit" class="Save" value="$T('button-save')" />
|
||||
<input type="button" class="delFilter" value="$T('button-x')" />
|
||||
<!--#if not $rss[$feed].filter_states[$fnum]#--> $T('Incorrect filter')<!--#end if#-->
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
@@ -510,7 +511,7 @@
|
||||
}).done(function( msg ) {
|
||||
location.reload();
|
||||
});
|
||||
} else {
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
@@ -310,6 +310,7 @@ $T('explain-RSS')
|
||||
<input type="hidden" name="feed" value="$feed"/>
|
||||
<input type="hidden" name="session" value="$session">
|
||||
<input type="submit" class="juiButton" value="$T('button-save')"/>
|
||||
<!--#if not $rss[$feed].filter_states[$fnum]#--> $T('Incorrect filter')<!--#end if#-->
|
||||
</td>
|
||||
</form>
|
||||
</tr>
|
||||
|
||||
@@ -56,7 +56,7 @@
|
||||
</td>
|
||||
|
||||
<td class="download-title">
|
||||
<a href="nzb/$slot.nzo_id/" title="$T('status'): $T('post-'+$slot.status)<br/>$T('nzo-age'): $slot.avg_age<br/><!--#if $slot.missing#-->$T('missingArt'): $slot.missing<!--#end if#-->">$slot.filename</a>
|
||||
<a href="nzb/$slot.nzo_id/" title="$T('status'): $T('post-'+$slot.status)<br/>$T('nzo-age'): $slot.avg_age<br/><!--#if $slot.missing#-->$T('missingArt'): $slot.missing<!--#end if#-->">$slot.filename.replace('.', '.​').replace('_', '_​')</a>
|
||||
</td>
|
||||
|
||||
<td>
|
||||
|
||||
@@ -213,6 +213,7 @@ MochiKit.DOM.addLoadEvent(location = "../../#config-rss");
|
||||
<input type="hidden" name="index" value="$fnum"/>
|
||||
<input type="hidden" name="feed" value="$feed"/>
|
||||
<input type="submit" value="$T('button-save')" onclick="javascript:submitconfig('config/rss/upd_rss_filter', this,'$feed+$fnum','1' )"/>
|
||||
<!--#if not $rss[$feed].filter_states[$fnum]#--> $T('Incorrect filter')<!--#end if#-->
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
|
||||
@@ -8,9 +8,8 @@
|
||||
<br/>
|
||||
<div id="tips" class="hidden">
|
||||
$T('wizard-tip1') <span class="bold">$T('wizard-tip2')</span><br/>
|
||||
<!--#if len($urls) > 1#--><!--#set $s = 's'#--><!--#else#--><!--#set $s = ''#--><!--#end if#-->
|
||||
<!--#set $tip3 = $T('wizard-tip3') % $s#-->
|
||||
$tip3:<br/><br/>
|
||||
<!--#set $tip3 = $T('wizard-tip3') % ''#-->
|
||||
$tip3<br/><br/>
|
||||
<div class="quoteBlock">
|
||||
<!--#set $i = 0#-->
|
||||
<!--#for $url in $urls#-->
|
||||
|
||||
@@ -578,6 +578,9 @@ elif target in ('binary', 'installer'):
|
||||
# Curl for Python 2.5
|
||||
os.system(r'unzip -o win\curl\curl.zip -d dist\lib')
|
||||
|
||||
############################
|
||||
# Fix icon issue with NZB association
|
||||
os.system(r'copy dist\icons\nzb.ico dist')
|
||||
|
||||
############################
|
||||
if target == 'installer':
|
||||
|
||||
@@ -1138,7 +1138,11 @@ def build_queue(web_dir=None, root=None, verbose=False, prim=True, webdir='', ve
|
||||
datestart = datetime.datetime.now()
|
||||
slot['eta'] = 'unknown'
|
||||
|
||||
slot['avg_age'] = calc_age(average_date, bool(trans))
|
||||
if status == Status.GRABBING:
|
||||
slot['avg_age'] = '---'
|
||||
else:
|
||||
slot['avg_age'] = calc_age(average_date, bool(trans))
|
||||
|
||||
slot['verbosity'] = ""
|
||||
if web_dir:
|
||||
finished = []
|
||||
|
||||
@@ -136,8 +136,21 @@ class BPSMeter(object):
|
||||
sabnzbd.save_admin(data, BYTES_FILE_NAME)
|
||||
|
||||
|
||||
def defaults(self):
|
||||
""" Get the latest data from the database and assign to a fake server
|
||||
"""
|
||||
logging.debug('Setting default BPS meter values')
|
||||
grand, month, week = sabnzbd.proxy_get_history_size()
|
||||
if grand: self.grand_total['x'] = grand
|
||||
if month: self.month_total['x'] = month
|
||||
if week: self.week_total['x'] = week
|
||||
self.quota = self.left = cfg.quota_size.get_float()
|
||||
|
||||
|
||||
def read(self):
|
||||
""" Read admin from disk """
|
||||
""" Read admin from disk, return True when pause is needed
|
||||
"""
|
||||
res = False
|
||||
quota = self.left = cfg.quota_size.get_float() # Quota for this period
|
||||
self.have_quota = bool(cfg.quota_size())
|
||||
data = sabnzbd.load_admin(BYTES_FILE_NAME)
|
||||
@@ -155,16 +168,14 @@ class BPSMeter(object):
|
||||
self.quota = self.left = cfg.quota_size.get_float()
|
||||
res = self.reset_quota()
|
||||
except:
|
||||
# Get the latest data from the database and assign to a fake server
|
||||
logging.debug('Setting default BPS meter values')
|
||||
grand, month, week = sabnzbd.proxy_get_history_size()
|
||||
if grand: self.grand_total['x'] = grand
|
||||
if month: self.month_total['x'] = month
|
||||
if week: self.week_total['x'] = week
|
||||
self.quota = self.left = cfg.quota_size.get_float()
|
||||
res = False
|
||||
# Force update of counters
|
||||
self.update()
|
||||
self.defaults()
|
||||
# Force update of counters and validate data
|
||||
try:
|
||||
for server in self.grand_total:
|
||||
self.update(server)
|
||||
except TypeError:
|
||||
self.defaults()
|
||||
self.update()
|
||||
return res
|
||||
|
||||
|
||||
@@ -330,7 +341,12 @@ class BPSMeter(object):
|
||||
self.have_quota = bool(cfg.quota_size())
|
||||
if self.have_quota:
|
||||
quota = cfg.quota_size.get_float()
|
||||
self.left = quota - (self.quota - self.left)
|
||||
if self.quota:
|
||||
# Quota change, recalculate amount left
|
||||
self.left = quota - (self.quota - self.left)
|
||||
else:
|
||||
# If previously no quota, self.left holds this period's usage
|
||||
self.left = quota - self.left
|
||||
self.quota = quota
|
||||
else:
|
||||
self.quota = self.left = 0L
|
||||
|
||||
@@ -37,6 +37,7 @@ from sabnzbd.articlecache import ArticleCache
|
||||
import sabnzbd.downloader
|
||||
import sabnzbd.cfg as cfg
|
||||
from sabnzbd.encoding import name_fixer
|
||||
from sabnzbd.misc import match_str
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
|
||||
@@ -85,18 +86,19 @@ class Decoder(Thread):
|
||||
data = None
|
||||
|
||||
register = True # Finish article
|
||||
found = True # Article found (only relevant for precheck)
|
||||
found = False # Proper article found
|
||||
|
||||
if lines:
|
||||
logme = None
|
||||
try:
|
||||
if nzo.precheck and '223' in lines[0]:
|
||||
raise IndexError
|
||||
if nzo.precheck:
|
||||
raise BadYenc
|
||||
register = True
|
||||
logging.debug("Decoding %s", article)
|
||||
|
||||
data = decode(article, lines)
|
||||
nzf.article_count += 1
|
||||
found = True
|
||||
except IOError, e:
|
||||
logme = Ta('Decoding %s failed') % article
|
||||
logging.info(logme)
|
||||
@@ -121,24 +123,44 @@ class Decoder(Thread):
|
||||
logme = None
|
||||
|
||||
except BadYenc:
|
||||
logme = Ta('Badly formed yEnc article in %s') % article
|
||||
logging.info(logme)
|
||||
# Handles precheck and badly formed articles
|
||||
killed = False
|
||||
found = False
|
||||
if nzo.precheck and lines and lines[0].startswith('223 '):
|
||||
# STAT was used, so we only get a status code
|
||||
found = True
|
||||
else:
|
||||
# Examine headers (for precheck) or body (for download)
|
||||
# And look for DMCA clues (while skipping "X-" headers)
|
||||
for line in lines:
|
||||
if not line.startswith('X-') and match_str(line.lower(), ('dmca', 'removed', 'cancel')):
|
||||
logging.info('Article removed from server (%s)', article)
|
||||
killed = True
|
||||
break
|
||||
if nzo.precheck:
|
||||
if found or not killed:
|
||||
# Pre-check, proper article found, just register
|
||||
logging.debug('Server has article %s', article)
|
||||
register = True
|
||||
elif not killed and not found:
|
||||
logme = Ta('Badly formed yEnc article in %s') % article
|
||||
logging.info(logme)
|
||||
|
||||
if cfg.fail_on_crc():
|
||||
if not found:
|
||||
new_server_found = self.__search_new_server(article)
|
||||
if new_server_found:
|
||||
register = False
|
||||
logme = None
|
||||
|
||||
except IndexError:
|
||||
# Pre-check, article found, just register
|
||||
register = True
|
||||
|
||||
except:
|
||||
logme = Ta('Unknown Error while decoding %s') % article
|
||||
logging.info(logme)
|
||||
logging.info("Traceback: ", exc_info = True)
|
||||
pass
|
||||
|
||||
new_server_found = self.__search_new_server(article)
|
||||
if new_server_found:
|
||||
register = False
|
||||
logme = None
|
||||
|
||||
if logme:
|
||||
article.nzf.nzo.inc_log('bad_art_log', logme)
|
||||
|
||||
@@ -1616,6 +1616,7 @@ class ConfigRss(object):
|
||||
rss[feed] = feeds[feed].get_dict()
|
||||
filters = feeds[feed].filters()
|
||||
rss[feed]['filters'] = filters
|
||||
rss[feed]['filter_states'] = [bool(sabnzbd.rss.convert_filter(f[4])) for f in filters]
|
||||
rss[feed]['filtercount'] = len(filters)
|
||||
|
||||
rss[feed]['pick_cat'] = pick_cat
|
||||
|
||||
@@ -150,10 +150,12 @@ class NzbQueue(TryList):
|
||||
""" Reconstruct admin for a single job folder, optionally with new NZB """
|
||||
name = os.path.basename(folder)
|
||||
path = os.path.join(folder, JOB_ADMIN)
|
||||
if new_nzb is None or not new_nzb.filename:
|
||||
if verified_flag_file(folder):
|
||||
filename = ''
|
||||
else:
|
||||
if hasattr(new_nzb, 'filename'):
|
||||
filename = new_nzb.filename
|
||||
else:
|
||||
filename = ''
|
||||
if not filename:
|
||||
if not verified_flag_file(folder):
|
||||
filename = globber(path, '*.gz')
|
||||
if len(filename) > 0:
|
||||
logging.debug('Repair job %s by reparsing stored NZB', latin1(name))
|
||||
@@ -164,7 +166,7 @@ class NzbQueue(TryList):
|
||||
self.add(nzo)
|
||||
else:
|
||||
remove_all(path, '*.gz')
|
||||
logging.debug('Repair job %s with new NZB (%s)', latin1(name), latin1(new_nzb.filename))
|
||||
logging.debug('Repair job %s with new NZB (%s)', latin1(name), latin1(filename))
|
||||
sabnzbd.add_nzbfile(new_nzb, pp=None, script=None, cat=None, priority=None, nzbname=name, reuse=True)
|
||||
|
||||
|
||||
|
||||
@@ -1391,7 +1391,7 @@ def nzf_cmp_date(nzf1, nzf2):
|
||||
return nzf_cmp_name(nzf1, nzf2, name=False)
|
||||
|
||||
|
||||
RE_RAR = re.compile(r'(\.rar|\.r\d\d)|\.s\d\d|\.t\d\d|\.u\d\d|\.v\d\d', re.I)
|
||||
RE_RAR = re.compile(r'(\.rar|\.r\d\d|\.s\d\d|\.t\d\d|\.u\d\d|\.v\d\d)$', re.I)
|
||||
|
||||
def nzf_cmp_name(nzf1, nzf2, name=True):
|
||||
# The comparison will sort .par2 files to the top of the queue followed by .rar files,
|
||||
|
||||
@@ -125,7 +125,7 @@ def convert_filter(text):
|
||||
try:
|
||||
return re.compile(txt, re.I)
|
||||
except:
|
||||
logging.error(Ta('Could not compile regex: %s'), text)
|
||||
logging.debug('Could not compile regex: %s', text)
|
||||
return None
|
||||
|
||||
_EXPIRE_SEC = 3*24*3600 # 3 days
|
||||
@@ -407,7 +407,10 @@ class RSSQueue(object):
|
||||
result = False
|
||||
break
|
||||
else:
|
||||
found = re.search(regexes[n], title)
|
||||
if regexes[n]:
|
||||
found = re.search(regexes[n], title)
|
||||
else:
|
||||
found = False
|
||||
if reTypes[n] == 'M' and not found:
|
||||
logging.debug("Filter rejected on rule %d", n)
|
||||
result = False
|
||||
|
||||
@@ -49,7 +49,6 @@ class URLGrabber(Thread):
|
||||
|
||||
def __init__(self):
|
||||
Thread.__init__(self)
|
||||
now = time.time()
|
||||
self.queue = Queue.Queue()
|
||||
for tup in NzbQueue.do.get_urls():
|
||||
url, nzo = tup
|
||||
@@ -115,7 +114,10 @@ class URLGrabber(Thread):
|
||||
logging.info('Removing nzbmatrix bookmark %s', matrix_id)
|
||||
else:
|
||||
logging.info('Grabbing URL %s', url)
|
||||
opener = urllib.FancyURLopener({})
|
||||
if '.nzbsrus.' in url:
|
||||
opener = urllib.URLopener({})
|
||||
else:
|
||||
opener = urllib.FancyURLopener({})
|
||||
opener.prompt_user_passwd = None
|
||||
opener.addheaders = []
|
||||
opener.addheader('User-Agent', 'SABnzbd+/%s' % sabnzbd.version.__version__)
|
||||
@@ -314,6 +316,14 @@ def _analyse_matrix(fn, matrix_id):
|
||||
return fn, msg, False, 0
|
||||
|
||||
|
||||
|
||||
RUS_FATAL = ('DENIED_MISSING_CREDENTIALS', 'DENIED_NO_ACCOUNT',
|
||||
'DENIED_INVALID_CREDENTIALS', 'INCORRECT_URL',
|
||||
'NZB_DELETED', 'POST_NUKED', 'FILE_UNAVAILABLE'
|
||||
)
|
||||
RUS_15M = ('SQL_ERROR', 'SERVICE_OFFLINE')
|
||||
RUS_60M = ('MAX_DOWNLOAD_REACHED_UPGRADE_TO_VIP', 'MAX_DOWNLOAD_REACHED')
|
||||
|
||||
def _analyse_others(fn, url):
|
||||
""" Analyse respons of indexer
|
||||
returns fn|None, error-message|None, retry, wait-seconds
|
||||
@@ -337,29 +347,16 @@ def _analyse_others(fn, url):
|
||||
return None, msg, True, 60
|
||||
|
||||
if '.nzbsrus.' in url:
|
||||
# Provisional support for nzbsrus.com's lack of an API
|
||||
# Trying to make sense of their response
|
||||
# Their non-VIP limiting is particularly weak
|
||||
f = open(fn, 'r')
|
||||
data = f.read(10000)
|
||||
f.close()
|
||||
ldata = data[:100].lower()
|
||||
if misc.match_str(ldata, ('invalid link', 'nuked', 'deleted')):
|
||||
# Partial support for nzbsrus.com's API
|
||||
if misc.match_str(data, RUS_FATAL):
|
||||
logging.debug('nzbsrus says: %s, abort', data)
|
||||
return None, data, False, 0
|
||||
if 'temporarily' in ldata:
|
||||
logging.debug('nzbsrus says: %s, retry', data)
|
||||
return None, data, True, 600
|
||||
if 'Upgrade To ViP' in data:
|
||||
logging.debug('nzbsrus says: upgrade to VIP, retry after an hour')
|
||||
return None, 'upgrade to VIP', True, 3600
|
||||
if 'Maintenance' in data:
|
||||
logging.debug('nzbsrus says: Maintenance, retry after an hour')
|
||||
return None, 'Maintenance', True, 3600
|
||||
if '<nzb' not in ldata and '<!doctype' in ldata:
|
||||
msg = Ta('Invalid URL for nzbsrus')
|
||||
logging.debug(msg)
|
||||
return None, msg, False, 0
|
||||
if misc.match_str(data, RUS_15M):
|
||||
logging.debug('nzbsrus says: %s, wait 15m', data)
|
||||
return None, data, True, 900
|
||||
if misc.match_str(data, RUS_60M):
|
||||
logging.debug('nzbsrus says: %s, wait 60m', data)
|
||||
return None, data, True, 3600
|
||||
|
||||
return fn, msg, False, 0
|
||||
|
||||
|
||||
Reference in New Issue
Block a user