Compare commits

..

97 Commits

Author SHA1 Message Date
shypike
bc9be3f92b Update text files for 0.7.14 2013-07-07 13:12:15 +02:00
shypike
2dc5c329c9 Fix special case of unjustified encryption warning. 2013-07-07 13:11:01 +02:00
shypike
67817978f4 Missing mini-par2 sometimes prevents the other par2 files from being downloaded. 2013-06-27 20:41:57 +02:00
shypike
e2ab8c6ce4 Make sure even invalid RAR files are fed to unrar and handle its reporting. 2013-06-27 20:29:04 +02:00
shypike
f33a952536 Update text files for 0.7.13 (again). 2013-06-13 21:35:14 +02:00
shypike
cc582b5321 Accept "nzbname" parameter in api-call "add url" even when a ZIP file is retrieved. 2013-06-13 21:33:00 +02:00
shypike
bdc526c91b Update text files for 0.7.13 2013-06-12 22:59:28 +02:00
shypike
52039c29b4 Accept partial par2 file when no others are available. 2013-06-12 21:03:29 +02:00
shypike
1dc4175f82 Add "special" option enable_recursion to control recursive unpacking. 2013-06-09 09:59:38 +02:00
shypike
92f70fc177 When post has just one par2-set, use full wildcard so that all files are repair and par candidates. 2013-06-01 11:21:00 +02:00
shypike
fd573208bd Fix encryption detection again. 2013-05-28 19:47:35 +02:00
shypike
ca9f10c12f Update text files for 0.7.12 2013-05-21 21:47:02 +02:00
shypike
49a72d0902 Update translations 2013-05-21 21:34:25 +02:00
shypike
6aafe3c531 Fix problem in encryption detection. 2013-05-07 21:17:06 +02:00
shypike
9e84696f96 Config and Wizard skins: fix problem with Unicode when using Chrome.
The Config skin and the Wizard were missing a proper Content-Type in <head>.
2013-04-14 12:02:33 +02:00
shypike
120c133d7a Implement robots.txt to keep web crawlers out.
Should not really be needed, because users should password-protect any
SABnzbd instance exposed to internet.
2013-04-12 21:25:56 +02:00
shypike
cf9713a4b0 Don't try to join a set of just one file (e.g. IMAGE.000) and reduce memory usage when joining large segments.
When there a single file called something like IMAGE.000, don't try to join it.
The joining procedure tries to read an entire segment file into memory, this may lead to a string overflow.
Use shutil.copyfileobj() with a 24 MB buffer instead.
2013-04-12 21:24:53 +02:00
shypike
d12e9889e7 Make encryption detection more careful. 2013-04-09 19:30:25 +02:00
shypike
711a546989 Make name sorting of the queue case-insensitive. 2013-03-20 23:12:13 +01:00
shypike
7f78e6fac1 Save job admin to disk when setting password or changing other attributes. 2013-03-02 13:09:24 +01:00
shypike
72533eefa4 Plush: add "resume pp" entry to pulldown menu, when pause_pp event is scheduled.
The option allows manual resume of a scheduled paused post-processing.
2013-02-26 20:33:58 +01:00
shypike
d9643d9ea8 Improve RAR detection. 2013-02-25 22:08:26 +01:00
shypike
2de71bb96c Enable "abort if hopeless" for pre-check as well. 2013-02-13 20:40:31 +01:00
shypike
07be241112 Update text files for 0.7.11 2013-02-07 20:21:59 +01:00
shypike
fbdd264653 Update translations 2013-02-07 19:38:48 +01:00
shypike
a8bc793132 Fix regression error that could result in slow verification of NZBs with multiple rar/par sets.
The detection of obfuscated files failed, causing each par2 run to parse all files.
2013-02-07 19:27:03 +01:00
shypike
6bce423f23 Fix "Sorting" file renaming for RAR files that contain an extra folder level.
collapse_folder() should convert filename list accoerding to the renaming it does.
It's also its task to remove the _unpack_ markers from those filenames.
Rename this function to rename_and_collapse().
2013-02-04 22:47:53 +01:00
shypike
51cabf85a1 Plush: default refresh-rate now 4 sec and multi-ops bar visible. 2013-02-04 21:43:12 +01:00
shypike
38fdc2c7c8 Show warning when decoder encounters I/O-errors. 2013-02-03 12:25:33 +01:00
shypike
b91a2af9df Some badly encoded articles can be accepted as valid data.
Regression error since 0.7.9 (commit ccfbb07).
decoder.decode() no long ran into an excepton when no valid data was found.
Solved now by using the "found" flag.
2013-02-02 14:57:28 +01:00
shypike
71ee5969a8 Update text files for 0.7.10 2013-01-30 21:04:24 +01:00
shypike
1b1c772b55 Update text files for 0.7.10 2013-01-30 20:34:13 +01:00
shypike
458eb3a417 Update translations 2013-01-29 19:31:57 +01:00
shypike
98b753f015 Change access to build share, even more improved. 2013-01-28 23:31:25 +01:00
shypike
a3284e12d2 Change access to build share, improved. 2013-01-28 22:51:35 +01:00
shypike
c85120bb4b Change access to build share. 2013-01-28 21:36:12 +01:00
shypike
903925e06b Update main POT file. 2013-01-24 10:35:27 +01:00
shypike
03196f25e4 Accept NNTP error 400 without "too many connection" clues as a transient error.
Previously it would file a warning and lock out the server for a few minutes.
Reduce the lockout to 6 seconds.
400 should report "too many connections" but some servers use it for temporary connectivity issues.
2013-01-24 10:34:18 +01:00
ShyPike
e3f3f962b6 Handle unrar error messages better (like "path too long").
In the case of fully encrypted RAR files, SABnzbd cannot check the resulting files.
Handling unrar errors explicitly is better anyway.
2013-01-23 22:23:11 +01:00
shypike
153f92e697 "Failed" message should also appear in email notifications. 2013-01-22 23:27:21 +01:00
shypike
c1dcafe953 Display next RSS scan moment in Config->RSS 2013-01-19 21:34:31 +01:00
ShyPike
b53d97732b Reset the "today" byte counters at midnight even when idle.
Set a scheduled event at midnight for resetting the "today" byte counters.
Otherwise, when idle, the bpsmeter isn't called at all.
2013-01-17 22:24:12 +01:00
ShyPike
8f47cce9c8 Try to process obfuscated rar/par sets as good as possible.
When detecting a main par2 file without extra pars, use full wildcard for par2-run.
During par2-run, register which par2 files contain matching blocks.
Remove matching par2 files after the repair.
Skip sets of which the main par2 file has been deleted (due to having been used
in another set).
2013-01-15 22:42:59 +01:00
ShyPike
3cf42a7f94 Accept %fn (next to %fn.%ext) as end parameter in sorting strings. 2013-01-14 20:52:37 +01:00
ShyPike
ae74370cfb Add IP address of unauthenticated API-call to warning. 2013-01-14 19:23:47 +01:00
ShyPike
2aaa283991 Plush: repair and unpack icons in History were swapped.
Fixing does mean that order changes too, but that was the only way to
make the icons correspond with the hover popups.
2013-01-11 21:55:14 +01:00
ShyPike
dca7a8ccdb Plush: show speed when forced job is running in Paused mode. 2013-01-11 19:48:17 +01:00
shypike
3172d6e987 Disable scheduled task for newzbin bookmarks. 2013-01-10 21:36:43 +01:00
ShyPike
c237ddfef4 Update text files for 0.7.9 2013-01-06 20:11:33 +01:00
ShyPike
b543dcb5ac Fix text in dropdowns being hard to see in chrome. 2013-01-06 19:33:31 +01:00
ShyPike
ccfbb07333 Take servers that only support ARTICLE into account.
When only full articles are available, the decoder needs to scan more lines
to find the start of the payload.
2013-01-06 19:33:19 +01:00
ShyPike
256ccbd6a1 Prevent crash in decoder.py 2013-01-06 19:06:15 +01:00
ShyPike
d8d507f110 Update text files for 0.7.8 2013-01-03 19:24:27 +01:00
ShyPike
7b3309649f Cancel encryption detection if meta-data if NZB contains password. 2013-01-03 18:44:31 +01:00
shypike
9a7a6652e8 Update text files for 0.7.8 2013-01-03 18:41:50 +01:00
shypike
db4891748f Update copyright year. 2013-01-03 18:40:49 +01:00
ShyPike
3dce2e8908 Support NZB 1.1 meta data; currently "category" and "password" are used.
"category" will trigger category conversion.
"password" value(s) will be used when an encrypted download is encountered.
The latter will also suppress the on-the-fly encryption detection.
2013-01-02 23:05:15 +01:00
ShyPike
c91291c315 Don't retry an empty but correct NZB retrieved from an indexer.
Also add special option "warn_empty_nzb" to control warning about empty NZBs.
2013-01-02 19:37:49 +01:00
shypike
a2a5a1f8e4 Make sure "Abort" error message ends up in download report. 2013-01-01 22:04:24 +01:00
shypike
7651f709ad API functions "addfile" and "addlocalfile" now support "nzbname" parameter for ZIP files with single NZB.
Also, prevent crash on calling "cat_convert" in those api functions (undefined).
2012-12-31 14:11:09 +01:00
shypike
a565077348 Update translations 2012-12-31 12:27:13 +01:00
shypike
6cf99e7d3a Add handling of an extra par2 error message. 2012-12-30 15:06:35 +01:00
shypike
f730a82005 Check for IPv6 connectivity should not use specific exceptions. 2012-12-30 13:16:46 +01:00
ShyPike
5449607c1d Update POT file. 2012-12-28 14:12:36 +01:00
ShyPike
c62415abfd Add "Abort" option to encryption detection.
The option pause_on_pwrar gets an extra value (2) which will
abort an encrypted job. Retrying the job will disable the check.
2012-12-28 14:10:53 +01:00
ShyPike
dcbea3057c Register removed articles and list in download report. 2012-12-28 13:23:34 +01:00
ShyPike
91642d16c8 Update POT file. 2012-12-27 22:26:33 +01:00
ShyPike
2f2773149d Fix missing Retry link for "Out of retention" jobs. 2012-12-27 22:26:05 +01:00
ShyPike
adaba03f50 Option to terminate download if too much data is missing.
Option 'fail_hopeless' Config->Switches.
On-the-fly check for possible completion after each file is processed.
Abort if it's no longer possible to download at least 99% of total data (payload + par2).
Don't do the check when retrying from History.
2012-12-27 21:56:00 +01:00
shypike
58a5e09540 Prevent web-watchdog from crashing when using Python 2.5 2012-12-27 11:28:06 +01:00
shypike
20dc906095 Support servers that don't support STAT and BODY commands.
When server sends error 500, use alternative "HEADER" and "ARTICLE" instead,
which are less efficient.
2012-12-24 20:12:01 +01:00
shypike
e2f41d3761 Add special "wait_for_dfolder", will wait for "temp download folder" at startup.
At startup, wait for the temporary download folder to come on line.
Supports situations where external drives are used, which do not mount before
SABnzbd starts up.
2012-12-23 12:11:18 +01:00
ShyPike
ab1372c7fc Prevent crash in DateSorter. 2012-12-20 18:46:45 +01:00
ShyPike
e305678cf4 In Sorting the %fn substitution sometimes fails to rename the file properly.
The Sorting code assumed that the file name used as the source for %fn
is always a base name. Sometimes it can be a full name. Deal with it.
2012-12-19 21:51:00 +01:00
ShyPike
a82df9bf2e Update text files for 0.7.7 2012-12-14 20:47:59 +01:00
ShyPike
986604f27c Update feedparser.py to from 5.1 to 5.1.3 2012-12-14 19:04:50 +01:00
shypike
59324c7453 Remove "Indexers" support page from the Wizard. 2012-12-09 13:03:03 +01:00
shypike
91613a5b37 Remove "Indexers" page from all skins. 2012-12-09 12:28:02 +01:00
shypike
5ca05fd2c0 OSX: remove association with "rar" and "zip" files. 2012-12-08 14:44:54 +01:00
shypike
4d4045cff4 Update translations 2012-12-05 21:27:04 +01:00
ShyPike
1f209a42d8 Filter unusable folders from lists generated by pathbrowser. 2012-12-03 21:13:13 +01:00
shypike
bffbb362db Update POT file. 2012-12-01 10:53:05 +01:00
shypike
435eed8818 Add 'B' to download totals on main page. 2012-12-01 10:48:27 +01:00
shypike
f86656543a Add schedule: when schedule has no days, assume daily instead of ignoring. 2012-12-01 10:06:11 +01:00
ShyPike
9c510c6dd1 When re-evaluating RSS feed, the original sort order was not preserved.
When re-using RSS entries from memory, use the original feed order and not
Python's random dictionary order.
2012-11-30 20:48:03 +01:00
ShyPike
f81ab3d1c0 Prevent crash when nzbxxx.com's category cannot be determined. 2012-11-30 18:47:38 +01:00
ShyPike
d1585c28a9 Remove all visible features for newzbin. 2012-11-29 22:07:45 +01:00
ShyPike
9c314532c0 Add optional web-watchdog to the watchdog. 2012-11-29 21:47:14 +01:00
ShyPike
853bda5d86 Add 'B' to server amounts. 2012-11-28 21:18:02 +01:00
ShyPike
d05e31f7f0 Remove placeholder for Cleanup filter in Config->General. Confusing for users. 2012-11-28 20:49:16 +01:00
ShyPike
383354871d Generic sort didn't always rename media files in multi-part jobs properly.
`rename_similar()` should be called outside of the media rename loop.
`rar_extract_core` should always return full paths.
2012-11-26 22:10:48 +01:00
ShyPike
2086a217e0 Don't use SFV check when more par2 files can still be downloaded. 2012-11-24 22:38:04 +01:00
ShyPike
34f3574746 Update unrar for Windows to 4.20 2012-11-24 21:50:14 +01:00
ShyPike
1dfe0b957e Catch a renaming bug in par2-tbb and retry with par2-classic. 2012-11-24 21:33:58 +01:00
shypike
17d14bc3b4 OSX: update unrar to version 4.20 2012-11-24 21:33:36 +01:00
ShyPike
885032e436 Improve handling of orphaned jobs.
Re-queue of a set without a nzb.gz file would not recognize par2 sets.
Convert "None" strings in the attrib file to None.
2012-11-24 21:21:06 +01:00
ShyPike
ceee95aaf7 Orphan re-queue and delete failed when path contains non-plain ASCII characters.
Convert UTF-8 name coming from CherryPy to a platform compatible name.
2012-11-24 20:38:29 +01:00
74 changed files with 9003 additions and 8194 deletions

View File

@@ -1,5 +1,5 @@
*******************************************
*** This is SABnzbd 0.7.6 ***
*** This is SABnzbd 0.7.14 ***
*******************************************
SABnzbd is an open-source cross-platform binary newsreader.
It simplifies the process of downloading from Usenet dramatically,

View File

@@ -1,3 +1,77 @@
-------------------------------------------------------------------------------
0.7.14Final by The SABnzbd-Team
-------------------------------------------------------------------------------
- Another encryption detection fix (special case)
- Missing mini-par2 sometimes prevents the other par2 files from being downloaded.
- Make sure even invalid RAR files are fed to unrar and handle its reporting.
-------------------------------------------------------------------------------
0.7.13Final by The SABnzbd-Team
-------------------------------------------------------------------------------
- Another encryption detection fix
- Special option "enable_recursion" to control recursive unpacking
- When post has just one par2 set, use wildcard so that all files are used
- Accept partial par2 file when only one is available
- Accept "nzbname" parameter in api-call "add url" even when a ZIP file is retrieved.
-------------------------------------------------------------------------------
0.7.12Final by The SABnzbd-Team
-------------------------------------------------------------------------------
- Fix issue in encryption detection
- Don't try to "join" a single X.000 file
- Fix memory overflow caused by very large files to be joined
- Make name sorting of the queue case-insensitive
- Save data to disk after changing job password or other attributes
- Add "resume_pp" entry to Plush pull-down menu when pause_pp event is scheduled
- Deploy "abort when completion not possible" method also in pre-download check
-------------------------------------------------------------------------------
0.7.11Final by The SABnzbd-Team
-------------------------------------------------------------------------------
- Bad articles from some servers were accepted as valid data
- Show warning when the decoder encounters I/O errors
- Generic Sort failed to rename files when an extra folder level was present in the RAR files
- Obfuscated file name support caused regular NZBs to verify slower
-------------------------------------------------------------------------------
0.7.10Final by The SABnzbd-Team
-------------------------------------------------------------------------------
- Disable obsolete newzbin bookmark readout
- Show speed when downloading in Forced mode while paused
- Plush History icons repair and unpack were swapped
- Try to repair rar/par sets with obfuscated names
- Reset "today" byte counters at midnight even when idle
- Display next RSS scan moment in Cfg->RSS
- An email about a failed should say that the download failed
- Report errors coming from fully encrypted rar files
- Accept NNTP error 400 without "too many connection" clues as a transient error.
- Accept %fn (next to %fn.%ext) as end parameter in sorting strings.
-------------------------------------------------------------------------------
0.7.9Final by The SABnzbd-Team
-------------------------------------------------------------------------------
- Fix fatal error in decoder when encountering a malformed article
- Fix compatibility with free.xsusenet.com
- Small fix in smpl-black CSS
-------------------------------------------------------------------------------
0.7.8Final by The SABnzbd-Team
-------------------------------------------------------------------------------
- Fix problem with %fn substitution in Sorting
- Add special "wait_for_dfolder", enables waiting for external temp download folder
- Work-around for servers that do not support STAT command
- Removed articles are now listed seperately in download report
- Add "abort" option to encryption detection
- Fix missing Retry link for "Out of retention" jobs.
- Option to abort download when it is clear that not enough data is available
- Support "nzbname" parameter in addfile/addlocalfile api calls for
ZIP files with a single NZB
- Support NZB-1.1 meta data "password" and "category"
- Don't retry an empty but correct NZB from an indexer
-------------------------------------------------------------------------------
0.7.7Final by The SABnzbd-Team
-------------------------------------------------------------------------------
- Windows/OSX: Update unrar to 4.20
- Fix some issues with orphaned items
- Generic sort didn't always rename media files in multi-part jobs properly
- Optional web-ui watchdog
- Always show RSS items in the same order as the original RSS feed
- Remove unusable folders from folder selector (Plush skin)
- Remove newzbin support
-------------------------------------------------------------------------------
0.7.6Final by The SABnzbd-Team
-------------------------------------------------------------------------------

View File

@@ -1,5 +1,5 @@
(c) Copyright 2007-2012 by "The SABnzbd-team" <team@sabnzbd.org>
(c) Copyright 2007-2013 by "The SABnzbd-team" <team@sabnzbd.org>
The SABnzbd-team is:

View File

@@ -1,10 +1,10 @@
SABnzbd 0.7.6
SABnzbd 0.7.14
-------------------------------------------------------------------------------
0) LICENSE
-------------------------------------------------------------------------------
(c) Copyright 2007-2012 by "The SABnzbd-team" <team@sabnzbd.org>
(c) Copyright 2007-2013 by "The SABnzbd-team" <team@sabnzbd.org>
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License

View File

@@ -1,4 +1,4 @@
(c) Copyright 2007-2012 by "The SABnzbd-team" <team@sabnzbd.org>
(c) Copyright 2007-2013 by "The SABnzbd-team" <team@sabnzbd.org>
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License

View File

@@ -1,7 +1,7 @@
Metadata-Version: 1.0
Name: SABnzbd
Version: 0.7.6
Summary: SABnzbd-0.7.6
Version: 0.7.14
Summary: SABnzbd-0.7.14
Home-page: http://sabnzbd.org
Author: The SABnzbd Team
Author-email: team@sabnzbd.org

View File

@@ -1,19 +1,12 @@
Release Notes - SABnzbd 0.7.6
===============================
Release Notes - SABnzbd 0.7.14
================================
## Features
- Properly handle par2-sets that were renamed after creation by the poster
- Recursive scanning when re-queuing downloaded NZB files
## Bug fixes
- Prevent blocking assembly of completed files, (this resulted in excessive CPU and memory usage)
- Fix speed issues with some Usenet servers due to unreachable IPv6 addresses
- Fix issues with SFV-base checks
- Successfully pre-checked job lost its attributes when those were changed during check
- No longer check version when looking for a running instance of SABnzbd (this prevents unintended multiple instances).
- A damaged base par2 file could block download of more par2 files
- Fix evaluation of schedules at startup
- Fix possible failing startup when running as a Windows Service
- Missing mini-par2 sometimes prevents the other par2 files from being downloaded
- When unrar reports invalid RAR files, show a proper error message
- Fix special case of unjustified encryption warning
## What's new in 0.7.0
@@ -43,7 +36,7 @@ Release Notes - SABnzbd 0.7.6
built-in post-processing options that automatically verify, repair,
extract and clean up posts downloaded from Usenet.
(c) Copyright 2007-2012 by "The SABnzbd-team" \<team@sabnzbd.org\>
(c) Copyright 2007-2013 by "The SABnzbd-team" \<team@sabnzbd.org\>
### IMPORTANT INFORMATION about release 0.7.x

View File

@@ -1,5 +1,5 @@
#!/usr/bin/python -OO
# Copyright 2008-2012 The SABnzbd-Team <team@sabnzbd.org>
# Copyright 2008-2013 The SABnzbd-Team <team@sabnzbd.org>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
@@ -260,7 +260,7 @@ def print_version():
print """
%s-%s
Copyright (C) 2008-2012, The SABnzbd-Team <team@sabnzbd.org>
Copyright (C) 2008-2013, The SABnzbd-Team <team@sabnzbd.org>
SABnzbd comes with ABSOLUTELY NO WARRANTY.
This is free software, and you are welcome to redistribute it
under certain conditions. It is licensed under the
@@ -686,12 +686,12 @@ def attach_server(host, port, cert=None, key=None, chain=None):
adapter.subscribe()
def is_sabnzbd_running(url):
def is_sabnzbd_running(url, timeout=None):
""" Return True when there's already a SABnzbd instance running.
"""
try:
url = '%s&mode=version' % (url)
ver = sabnzbd.newsunpack.get_from_url(url)
ver = sabnzbd.newsunpack.get_from_url(url, timeout=timeout)
return bool(ver and re.search(r'\d+\.\d+\.', ver))
except:
return False
@@ -1563,7 +1563,7 @@ def main():
add_local(f)
# Have to keep this running, otherwise logging will terminate
timer = 0
timer = timer5 = 0
while not sabnzbd.SABSTOP:
if sabnzbd.WIN_SERVICE:
rc = win32event.WaitForMultipleObjects((sabnzbd.WIN_SERVICE.hWaitStop,
@@ -1603,6 +1603,15 @@ def main():
if sabnzbd.WIN_SERVICE and mail:
mail.send('active')
if timer5 > 9:
### 5 minute polling tasks
timer5 = 0
if sabnzbd.cfg.web_watchdog() and not is_sabnzbd_running('%s/api?tickleme=1' % sabnzbd.BROWSER_URL, 120):
autorestarted = True
cherrypy.engine.execv = True
else:
timer5 += 1
else:
timer += 1

View File

@@ -1,5 +1,5 @@
#
# Copyright 2008-2012 The SABnzbd-Team <team@sabnzbd.org>
# Copyright 2008-2013 The SABnzbd-Team <team@sabnzbd.org>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License

View File

@@ -6,59 +6,6 @@
<!--#set global $submenu="newzbin"#-->
<!--#include $webdir + "/inc_cmenu.tmpl"#-->
<h2>Newzbin</h2>
$T('explain-newzbin')<br/><br/>
<form action="saveNewzbin" method="post" autocomplete="off">
<div class="EntryBlock">
<fieldset class="EntryFieldSet">
<legend>$T('accountInfo')</legend>
<strong>$T('opt-username_newzbin'):</strong><br>
$T('explain-username_newzbin')<br>
<input type="text" name="username_newzbin" value="$username_newzbin">
<br>
<br>
<strong>$T('opt-password_newzbin'):</strong><br>
$T('explain-password_newzbin')<br>
<input type="password" name="password_newzbin" value="$password_newzbin">
</fieldset>
</div>
<div class="EntryBlock">
<fieldset class="EntryFieldSet">
<legend>$T('newzbinBookmarks')</legend>
<label><input type="checkbox" name="newzbin_bookmarks" value="1" <!--#if $newzbin_bookmarks > 0 then "checked=1" else ""#--> <strong>$T('opt-newzbin_bookmarks'):</strong></label><br>
$T('explain-newzbin_bookmarks')<br>
<a href="getBookmarks?session=$session">$T('link-getBookmarks')</a>
<br>
<!--#if $bookmarks_list#-->
<a href="hideBookmarks?session=$session">$T('link-HideBM')</a>
<!--#else#-->
<a href="showBookmarks?session=$session">$T('link-ShowBM')</a>
<!--#end if#-->
<br/>
<br/>
<label><input type="checkbox" name="newzbin_unbookmark" value="1" <!--#if $newzbin_unbookmark > 0 then "checked=1" else ""#--> /> <strong>$T('opt-newzbin_unbookmark'):</strong></label><br>
$T('explain-newzbin_unbookmark')<br>
<br/>
<strong>$T('opt-bookmark_rate'):</strong><br>
$T('explain-bookmark_rate')<br>
<input type="text" name="bookmark_rate" value="$bookmark_rate">
</fieldset>
</div>
<!--#if $bookmarks_list#-->
<fieldset class="EntryFieldSet">
<legend>$T('processedBM')</legend>
<!--#for $msgid in $bookmarks_list#-->
<a href="https://$newzbin_url/browse/post/$msgid/" target="_blank">$msgid</a>&nbsp;
<!--#end for#-->
</fieldset>
<!--#end if#-->
<input type="hidden" name="session" value="$session">
<p><input type="submit" value="$T('button-saveChanges')"></p>
</form>
<hr/>
<h2>NzbMatrix</h2>
$T('explain-nzbmatrix')<br/><br/>

View File

@@ -47,11 +47,13 @@
<a href="$cpath/notify/">$T('cmenu-notif')</a> |
<!--#end if#-->
<!--#if 0#-->
<!--#if $submenu=="indexers"#-->
<a class="current" href="./">$T('cmenu-newzbin')</a> |
<!--#else#-->
<a href="$cpath/indexers/">$T('cmenu-newzbin')</a> |
<!--#end if#-->
<!--#end if#-->
<!--#if $submenu=="categories"#-->
<a class="current" href="./">$T('cmenu-cat')</a> |

View File

@@ -17,8 +17,7 @@
<div class="EntryBlock">
<form action="addID" method="get">
<fieldset class="EntryFieldSet">
<legend>$T('add')
<!--#if $varExists('newzbinDetails')#--> $T('reportId') / <!--#end if#-->URL</legend>
<legend>$T('add') URL</legend>
<input type="text" name="id">
<!--#if $cat_list#-->
<select name="cat" >

View File

@@ -1,7 +1,7 @@
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>SABnzbd $version - $T('queued'): $mbleft $T('MB')</title>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
@@ -128,9 +128,11 @@
<a href="${root}config/notify/">
<div #if $pane == "Email" then 'class="active"' else ""#>$T('cmenu-notif')</div>
</a>
<!--#if 0#-->
<a href="${root}config/indexers/">
<div #if $pane == "Index Sites" then 'class="active"' else ""#>$T('cmenu-newzbin')</div>
</a>
<!--#end if#-->
<a href="${root}config/categories/">
<div #if $pane == "Categories" then 'class="active"' else ""#>$T('cmenu-cat')</div>
</a>

View File

@@ -21,7 +21,7 @@
</table>
</div>
<div class="padding alt">
<h5 class="copyright">Copyright &copy; 2008-2012 The SABnzbd Team &lt;<span style="color: #0000ff;">team@sabnzbd.org</span>&gt;</h5>
<h5 class="copyright">Copyright &copy; 2008-2013 The SABnzbd Team &lt;<span style="color: #0000ff;">team@sabnzbd.org</span>&gt;</h5>
<p class="copyright"><small>$T('yourRights')</small></p>
</div>
<!--#if $news_items#-->

View File

@@ -157,7 +157,7 @@
</div>
<div class="field-pair alt">
<label class="config" for="cleanup_list">$T('opt-cleanup_list')</label>
<input type="text" name="cleanup_list" id="cleanup_list" value="$cleanup_list" size="50" placeholder=".nfo, .sfv" />
<input type="text" name="cleanup_list" id="cleanup_list" value="$cleanup_list" size="50"/>
<span class="desc">$T('explain-cleanup_list')</span>
</div>
<div class="field-pair">

View File

@@ -33,84 +33,6 @@
</fieldset>
</div><!-- /col1 -->
</div><!-- /section -->
<div class="section">
<div class="col2">
<h3>Newzbin $T('accountInfo')</h3>
<p>$T('explain-newzbin')</p>
</div><!-- /col2 -->
<div class="col1">
<fieldset>
<div class="field-pair alt">
<label class="config" for="username_newzbin">$T('opt-username_newzbin')</label>
<input type="text" name="username_newzbin" id="username_newzbin" value="$username_newzbin" size="30" />
<span class="desc">$T('explain-username_newzbin')</span>
</div>
<div class="field-pair">
<label class="config" for="password_newzbin">$T('opt-password_newzbin')</label>
<input type="password" name="password_newzbin" id="password_newzbin" value="$password_newzbin" size="30" />
<span class="desc">$T('explain-password_newzbin')</span>
</div>
<div class="field-pair">
<input type="submit" value="$T('button-saveChanges')" class="saveButton" />
</div>
</fieldset>
</div><!-- /col1 -->
</div><!-- /section -->
<div class="section">
<div class="col2">
<h3>Newzbin $T('newzbinBookmarks')</h3>
<p>
<input type="button" id="getBookmarks" value="$T('link-getBookmarks')" />
<span id="getBookmarks-result" class="icon">&nbsp;</span>
<br/><br/>
<!--#if $bookmarks_list#-->
<input type="button" id="hideBookmarks" value="$T('link-HideBM')" />
<!--#else#-->
<input type="button" id="showBookmarks" value="$T('link-ShowBM')" />
<!--#end if#-->
</p>
</div><!-- /col2 -->
<div class="col1">
<fieldset>
<div class="field-pair alt">
<label class="config" for="newzbin_bookmarks">$T('opt-newzbin_bookmarks')</label>
<input type="checkbox" name="newzbin_bookmarks" id="newzbin_bookmarks" value="1" <!--#if int($newzbin_bookmarks) > 0 then 'checked="checked"' else ""#--> />
<span class="desc">$T('explain-newzbin_bookmarks')</span>
</div>
<div class="field-pair">
<label class="config" for="newzbin_unbookmark">$T('opt-newzbin_unbookmark')</label>
<input type="checkbox" name="newzbin_unbookmark" id="newzbin_unbookmark" value="1" <!--#if int($newzbin_unbookmark) > 0 then 'checked="checked"' else ""#--> />
<span class="desc">$T('explain-newzbin_unbookmark')</span>
</div>
<div class="field-pair alt">
<label class="config" for="bookmark_rate">$T('opt-bookmark_rate')</label>
<input type="number" name="bookmark_rate" id="bookmark_rate" value="$bookmark_rate" size="8" min="15" max="1440" />
<span class="desc">$T('explain-bookmark_rate')</span>
</div>
<div class="field-pair">
<input type="submit" value="$T('button-saveChanges')" class="saveButton" />
</div>
</fieldset>
</div><!-- /col1 -->
</div><!-- /section -->
<!--#if $bookmarks_list#-->
<div class="section">
<div class="col2">
<h3>Newzbin Bookmarks</h3>
</div><!-- /col2 -->
<div class="col1">
<fieldset>
<!--#set $odd = False#-->
<!--#for $msgid in $bookmarks_list#-->
<!--#set $odd = not $odd#-->
<div class="field-pair <!--#if $odd then "alt" else ""#-->">
<a href="https://$newzbin_url/browse/post/$msgid/" target="_blank">$msgid</a><br/>
</div>
<!--#end for#-->
</fieldset>
</div><!-- /col1 -->
</div><!-- /section -->
<!--#end if#-->
<div class="padding alt">
<input type="submit" value="$T('button-saveChanges')" class="saveButton" />
<input type="button" value="$T('button-restart') SABnzbd" class="sabnzbd_restart" />

View File

@@ -95,6 +95,7 @@
<label class="config narrow" for="rss_rate">$T('opt-rss_rate')</label>
<input type="number" name="rss_rate" id="rss_rate" value="$rss_rate" size="8" min="15" max="1440" />
<input type="submit" value="$T('button-save')" />
<span class "config narrow">&nbsp;&nbsp;$T('Next scan at:')&nbsp;$rss_next</span>
<span class="desc narrow">$T('explain-rss_rate')</span>
</div>
</fieldset>

View File

@@ -155,10 +155,10 @@
<div class="col2" style="display:block;">
<!--#if 'amounts' in $servers[$server]#-->
<b>$T('srv-bandwidth'):</b><br/>
$T('total'): $servers[$server]['amounts'][0]<br/>
$T('today'): $servers[$server]['amounts'][3]<br/>
$T('thisWeek'): $servers[$server]['amounts'][2]<br/>
$T('thisMonth'): $servers[$server]['amounts'][1]
$T('total'): $(servers[$server]['amounts'][0])B<br/>
$T('today'): $(servers[$server]['amounts'][3])B<br/>
$T('thisWeek'): $(servers[$server]['amounts'][2])B<br/>
$T('thisMonth'): $(servers[$server]['amounts'][1])B
<!--#end if#-->
</div>
</div><!-- /section -->

View File

@@ -83,6 +83,11 @@
</div><!-- /col2 -->
<div class="col1">
<fieldset>
<div class="field-pair">
<label class="config" for="fail_hopeless">$T('opt-fail_hopeless')</label>
<input type="checkbox" name="fail_hopeless" id="fail_hopeless" value="1" <!--#if int($fail_hopeless) > 0 then 'checked="checked"' else ""#--> />
<span class="desc">$T('explain-fail_hopeless')</span>
</div>
<div class="field-pair alt">
<label class="config" for="pre_check">$T('opt-pre_check')</label>
<input type="checkbox" name="pre_check" id="pre_check" value="1" <!--#if int($pre_check) > 0 then 'checked="checked"' else ""#--> />
@@ -104,7 +109,11 @@
</div>
<div class="field-pair">
<label class="config" for="pause_on_pwrar">$T('opt-pause_on_pwrar')</label>
<input type="checkbox" name="pause_on_pwrar" id="pause_on_pwrar" value="1" <!--#if int($pause_on_pwrar) > 0 then 'checked="checked"' else ""#--> />
<select name="pause_on_pwrar" id="pause_on_pwrar">
<option value="0" <!--#if int($pause_on_pwrar) == 0 then 'selected="selected" class="selected"' else ""#--> >$T('nodupes-off')</option>
<option value="1" <!--#if int($pause_on_pwrar) == 1 then 'selected="selected" class="selected"' else ""#--> >$T('nodupes-pause')</option>
<option value="2" <!--#if int($pause_on_pwrar) == 2 then 'selected="selected" class="selected"' else ""#--> >$T('abort')</option>
</select>
<span class="desc">$T('explain-pause_on_pwrar')</span>
</div>
<div class="field-pair alt">

View File

@@ -126,8 +126,10 @@
<div class="config_sprite_container sprite_config_nav_scheduling">$T('Plush-cmenu-scheduling')</div></a></li>
<li><a class="#if $pane=="Email"#nav_active#end if#" id="config_nav_email" href="${path}config/notify/">
<div class="config_sprite_container sprite_config_nav_email">$T('cmenu-notif')</div></a></li>
<!--#if 0#-->
<li><a class="#if $pane=="Index Sites"#nav_active#end if#" id="config_nav_index_sites" href="${path}config/indexers/">
<div class="config_sprite_container sprite_config_nav_indexsites">$T('cmenu-newzbin')</div></a></li>
<!--#end if#-->
<li><a class="#if $pane=="Categories"#nav_active#end if#" id="config_nav_categories" href="${path}config/categories/">
<div class="config_sprite_container sprite_config_nav_categories">$T('cmenu-cat')</div></a></li>
<li><a class="#if $pane=="Sorting"#nav_active#end if#" id="config_nav_sorting" href="${path}config/sorting/">

View File

@@ -10,7 +10,7 @@
</table>
<div class="sabnzbd_logo main_sprite_container sprite_sabnzbdplus_logo"></div>
<p><strong>SABnzbd $T('version'):</strong> $version</p>
<p><small>Copyright (C) 2008-2012, The SABnzbd Team &lt;team@sabnzbd.org&gt;</small></p>
<p><small>Copyright (C) 2008-2013, The SABnzbd Team &lt;team@sabnzbd.org&gt;</small></p>
<p><small>$T('yourRights')</small></p>
</div>

View File

@@ -43,90 +43,6 @@
</fieldset>
</div><!-- /component-group1 -->
<div id="core-component-group2" class="component-group clearfix">
<div class="component-group-desc">
<h3>Newzbin $T('accountInfo')</h3>
<p>$T('explain-newzbin')</p>
</div>
<fieldset class="component-group-list">
<div class="field-pair">
<label class="nocheck clearfix" for="username_newzbin">
<span class="component-title">$T('opt-username_newzbin')</span>
<input type="text" name="username_newzbin" id="username_newzbin" value="$username_newzbin"/>
</label>
<label class="nocheck clearfix">
<span class="component-title">&nbsp;</span>
<span class="component-desc">$T('explain-username_newzbin')</span>
</label>
</div>
<div class="field-pair alt">
<label class="nocheck clearfix" for="password_newzbin">
<span class="component-title">$T('opt-password_newzbin')</span>
<input type="password" name="password_newzbin" id="password_newzbin" value="$password_newzbin"/>
</label>
<label class="nocheck clearfix">
<span class="component-title">&nbsp;</span>
<span class="component-desc">$T('explain-password_newzbin')</span>
</label>
</div>
</fieldset>
</div><!-- /component-group2 -->
<div id="core-component-group3" class="component-group clearfix">
<div class="component-group-desc">
<h3>Newzbin $T('newzbinBookmarks')</h3>
<p>
<input type="button" class="juiButton" id="getBookmarks" value="$T('link-getBookmarks')" />
<br/><br/>
<!--#if $bookmarks_list#-->
<input type="button" class="juiButton" id="hideBookmarks" value="$T('link-HideBM')" />
<!--#else#-->
<input type="button" class="juiButton" id="showBookmarks" value="$T('link-ShowBM')" />
<!--#end if#-->
</p>
</div>
<fieldset class="component-group-list">
<div class="field-pair">
<input type="checkbox" name="newzbin_bookmarks" id="newzbin_bookmarks" value="1" <!--#if $newzbin_bookmarks > 0 then "checked=1" else ""#--> />
<label class="clearfix" for="newzbin_bookmarks">
<span class="component-title">$T('opt-newzbin_bookmarks')</span>
<span class="component-desc">$T('explain-newzbin_bookmarks')</span>
</label>
</div>
<div class="field-pair alt">
<input type="checkbox" name="newzbin_unbookmark" id="newzbin_unbookmark" value="1" <!--#if $newzbin_unbookmark > 0 then "checked=1" else ""#--> />
<label class="clearfix" for="newzbin_unbookmark">
<span class="component-title">$T('opt-newzbin_unbookmark')</span>
<span class="component-desc">$T('explain-newzbin_unbookmark')</span>
</label>
</div>
<div class="field-pair">
<label class="nocheck clearfix" for="bookmark_rate">
<span class="component-title">$T('opt-bookmark_rate')</span>
<input type="text" name="bookmark_rate" id="bookmark_rate" size="6" value="$bookmark_rate"/>
</label>
<label class="nocheck clearfix">
<span class="component-title">&nbsp;</span>
<span class="component-desc">$T('explain-bookmark_rate')</span>
</label>
</div>
</fieldset>
</div><!-- /component-group3 -->
<!--#if $bookmarks_list#-->
<div id="core-component-group4" class="component-group clearfix">
<div class="component-group-desc">
<h3>Newzbin $T('accountInfo')</h3>
<p>$T('explain-newzbin')</p>
</div>
<fieldset class="component-group-list">
<!--#for $msgid in $bookmarks_list#-->
<a href="https://$newzbin_url/browse/post/$msgid/" target="_blank">$msgid</a><br/>
<!--#end for#-->
</fieldset>
</div><!-- /component-group4 -->
<!--#end if#-->
<div class="component-group-last clearfix">
<div class="component-group-desc">
<h3>&nbsp;</h3>

View File

@@ -26,9 +26,9 @@
<a class="sf-with-ul">$T('menu-queue')</a>
<ul>
<!--#if $have_quota#--><li><a id="reset_quota_now" class="pointer">$T('link-resetQuota')</a></li><!--#end if#-->
<!--#if $varExists('newzbinDetails')#--><li><a id="get_bookmarks_now" class="pointer">$T('link-getBookmarks')</a></li><!--#end if#-->
<!--#if $have_rss_defined#--><li><a id="get_rss_now" class="pointer">$T('button-rssNow')</a></li><!--#end if#-->
<!--#if $have_watched_dir#--><li><a id="get_watched_now" class="pointer">$T('sch-scan_folder')</a></li><!--#end if#-->
<!--#if $pp_pause_event#--><li><a id="resume_pp" class="pointer">$T('sch-resume_post')</a></li><!--#end if#-->
<li><a id="topmenu_toggle" class="pointer">$T('Plush-topMenu')</a></li>
<li><a id="multiops_toggle" class="pointer">$T('Plush-multiOperations')</a></li>
<li>

View File

@@ -8,7 +8,7 @@ jQuery(function($){
// ***************************************************************
// Plush defaults
refreshRate: $.cookie('plushRefreshRate') ? $.cookie('plushRefreshRate') : 30, // refresh rate in seconds
refreshRate: $.cookie('plushRefreshRate') ? $.cookie('plushRefreshRate') : 4, // refresh rate in seconds
containerWidth: $.cookie('plushContainerWidth') ? $.cookie('plushContainerWidth') : '100%', // width of all elements on page
queuePerPage: $.cookie('plushQueuePerPage') ? $.cookie('plushQueuePerPage') : 5, // pagination - nzbs per page
histPerPage: $.cookie('plushHistPerPage') ? $.cookie('plushHistPerPage') : 5, // pagination - nzbs per page
@@ -16,7 +16,7 @@ jQuery(function($){
confirmDeleteHistory: $.cookie('plushConfirmDeleteHistory') == 0 ? false : true, // confirm history nzb removal
blockRefresh: $.cookie('plushBlockRefresh') == 0 ? false : true, // prevent refreshing when hovering queue
failedOnly: $.cookie('plushFailedOnly') == 1 ? 1 : 0, // prevent refreshing when hovering queue
multiOps: $.cookie('plushMultiOps') == 1 ? true : false, // is multi-operations menu visible in queue
multiOps: $.cookie('plushMultiOps') == 0 ? false : true, // is multi-operations menu visible in queue
noTopMenu: $.cookie('plushNoTopMenu') == 1 ? false : true, // is top menu visible
multiOpsChecks: null,
@@ -329,6 +329,17 @@ jQuery(function($){
});
});
// Resume Post Processing
$('#resume_pp').click(function() {
$.ajax({
headers: {"Cache-Control": "no-cache"},
type: "POST",
url: "tapi",
data: {mode:'resume_pp', apikey: $.plush.apikey},
success: $.plush.RefreshQueue
});
});
$('#multiops_toggle').click(function(){
if( $('#multiops_bar').is(':visible') ) { // hide
$('#multiops_bar').hide();
@@ -1242,7 +1253,7 @@ $.plush.histprevslots = $.plush.histnoofslots; // for the next refresh
SetQueueETAStats : function(speed,kbpersec,timeleft,eta) {
// ETA/speed stats at top of queue
if (kbpersec < 1 || $.plush.paused) {
if (kbpersec < 100 && $.plush.paused) {
$('#stats_eta').html('&mdash;');
$('#stats_speed').html('&mdash;');
$('#time-left').attr('title','&mdash;'); // Tooltip on "time left"

View File

@@ -401,12 +401,12 @@ body {
.sprite_hv_download{ background-position: 0 -167px; }
.sprite_hv_error{ background-position: 0 -193px; }
.sprite_hv_filejoin{ background-position: 0 -219px; }
.sprite_hv_repair{ background-position: 0 -245px; }
.sprite_hv_unpack{ background-position: 0 -245px; }
.sprite_hv_report{ background-position: 0 -271px; }
.sprite_hv_script{ background-position: 0 -297px; }
.sprite_hv_star{ background-position: 0 -323px; }
.sprite_hv_stats{ background-position: 0 -349px; }
.sprite_hv_unpack{ background-position: 0 -375px; }
.sprite_hv_repair{ background-position: 0 -375px; }
.sprite_progress_done{ background-position: 0 -401px; } /* queue.tmpl */
.sprite_progressbar_bg{ background-position: 0 -430px; }
.sprite_q_menu_pausefor{ background-position: 0 -459px; }

View File

@@ -1,69 +1,4 @@
<a href="${helpuri}Configure+Indexers-0-7" id="help" target="_blank">$T('menu-help')</a><h3>Newzbin</h3>
<form id="configNewzbin" class="cmxform" autocomplete="off">
$T('explain-newzbin')<br/>
<br/>
<div class="EntryBlock">
<fieldset class="EntryFieldSet">
<legend>$T('accountInfo')</legend>
<hr />
<label class="label">$T('opt-username_newzbin'):</label>
<input type="text" name="username_newzbin" value="$username_newzbin">
<span class="tips">$T('explain-username_newzbin')</span>
<br class="clear" />
<label class="label">$T('opt-password_newzbin'):</label>
<input type="password" name="password_newzbin" value="$password_newzbin">
<span class="tips">$T('explain-password_newzbin')</span>
<br class="clear" />
</fieldset>
<fieldset class="EntryFieldSet">
<legend>$T('newzbinBookmarks')</legend>
<hr />
<label><span class="label">$T('newzbinBookmarks'):</span>
<input class="radio" type="checkbox" name="newzbin_bookmarks" value="1" <!--#if $newzbin_bookmarks > 0 then "checked=1" else ""#--> />
<span class="tips">$T('explain-newzbin_bookmarks')</span></label>
<br class="clear" />
<label><span class="label">$T('opt-newzbin_unbookmark'):</span>
<input class="radio" type="checkbox" name="newzbin_unbookmark" value="1" <!--#if $newzbin_unbookmark > 0 then "checked=1" else ""#--> />
<span class="tips">$T('explain-newzbin_unbookmark')</span></label>
<br class="clear" />
<label class="label">$T('opt-bookmark_rate'):</label>
<input type="text" name="bookmark_rate" value="$bookmark_rate">
<span class="tips">$T('explain-bookmark_rate')</span>
<br class="clear" />
</fieldset>
<a class="config" onClick="getBookmarks();">$T('link-getBookmarks')</a>
<!--#if $bookmarks_list#-->
<a class="config" onClick="lr('config/indexers/hideBookmarks');">$T('link-HideBM')</a>
<!--#else#-->
<a class="config" onClick="lr('config/indexers/showBookmarks');">$T('link-ShowBM')</a>
<!--#end if#-->
<!--#if $bookmarks_list#-->
<fieldset class="EntryFieldSet">
<legend>$T('processedBM')</legend>
<hr />
<!--#for $msgid in $bookmarks_list#-->
<a href="https://$newzbin_url/browse/post/$msgid/" target="_blank">$msgid</a>&nbsp;
<!--#end for#-->
<br class="clear" />
</fieldset>
<!--#end if#-->
</div>
<br/><hr/>
<a href="${helpuri}Configure+Indexers-0-7" id="help" target="_blank">$T('menu-help')</a>
<h3>NzbMatrix</h3><br/>
$T('explain-nzbmatrix')<br/>

View File

@@ -1133,7 +1133,9 @@ function loadingJSON(){
<li><a class="config" href="$prefix/config/scheduling/" onclick="lr('config/scheduling/','', 0, 0);">$T('cmenu-scheduling')</a> </li>
<li><a class="config" href="$prefix/config/rss/" onclick="lr('config/rss/','', 0, 0);">$T('cmenu-rss')</a> </li>
<li><a class="config" href="$prefix/config/notify/" onclick="lr('config/notify/','', 0, 0);">$T('cmenu-notif')</a></li>
<!--#if 0#-->
<li><a class="config" href="$prefix/config/indexers/" onclick="lr('config/indexers/', '', 0, 0);">$T('cmenu-newzbin')</a></li>
<!--#end if#-->
<li><a class="config" href="$prefix/config/categories/" onclick="lr('config/categories/', '', 0, 0);">$T('cmenu-cat')</a></li>
<li><a class="config" href="$prefix/config/sorting/" onclick="lr('config/sorting/', '', 0, 0);">$T('cmenu-sorting')</a></li>
</ul>
@@ -1152,9 +1154,6 @@ function loadingJSON(){
<li><a class="config" onclick="javascript:timedPause()">$T("smpl-custom")</a></li>
</ul>
<!--#if $varExists('newzbinDetails')#-->
<li><a onclick="getBookmarks()">$T('smpl-getbookmarks')</a></li>
<!--#end if#-->
<!--#if $have_quota#-->
<li><a onclick="resetQuota()">$T('link-resetQuota')</a></li>
<!--#end if#-->
@@ -1183,7 +1182,7 @@ function loadingJSON(){
<div id="RightContainer" class="left-border">
<div id="addNew" class="centerLinks" style="overflow: hidden; display: none;">
<form action="addID" method="get">
<input type="text" style="width:218px;" name="id" value="$T('enterURL')<!--#if $varExists('newzbinDetails') then $T('enterID') else '' #-->" onfocus="clearForm(this, 'Enter URL<!--#if $varExists('newzbinDetails') then " or Report ID" else "" #-->')" onblur="setForm(this, 'Enter URL<!--#if $varExists('newzbinDetails') then " or Report ID" else "" #-->')">
<input type="text" style="width:218px;" name="id" value="$T('enterURL')" onfocus="clearForm(this, 'Enter URL<!--#if $varExists('newzbinDetails') then " or Report ID" else "" #-->')" onblur="setForm(this, 'Enter URL<!--#if $varExists('newzbinDetails') then " or Report ID" else "" #-->')">
<!--#if $cat_list#-->
<select name="cat" >
<optgroup label="$T('category')">

View File

@@ -24,15 +24,15 @@ border-top: 1px dotted #222;
}
#progressBar {
background-color: #fff;
border: 1px solid #000;
background-color: #fff;
border: 1px solid #000;
}
#progressBartop {
background-color: #fff;
border: 1px solid #ccc;
background-color: #fff;
border: 1px solid #ccc;
}
#percentageBar {
background-color: #4B4545;
background-color: #4B4545;
}
@@ -83,7 +83,7 @@ table{border-spacing:0;}
input, select {
input, select, option {
background-color:#232323;
border-color:#3a3a3a;
color:white;
@@ -110,4 +110,4 @@ span.unselected {
color: white;
background-color:#333;
border: 1px solid #555;
}
}

View File

@@ -1,34 +0,0 @@
<!--#include $webdir + "/inc_top.tmpl"#-->
<script type="text/javascript" src="static/javascript/jquery.js"></script>
<script type="text/javascript" src="static/javascript/restart.js"></script>
<br/><br/>
<h4 id="restarting" class="align-center">$T('wizard-restarting')</h4>
<h4 id="complete" class="align-center success hidden">$T('wizard-complete')</h4>
<br />
<br/>
<div id="tips" class="hidden">
$T('wizard-tip1') <span class="bold">$T('wizard-tip2')</span><br/>
<!--#set $tip3 = $T('wizard-tip3') % ''#-->
$tip3<br/><br/>
<div class="quoteBlock">
<!--#set $i = 0#-->
<!--#for $url in $urls#-->
<!--#set $i = $i+1#-->
<a href="$url">$url</a><!--#if $i != len($urls)#--><br /><!--#end if#-->
<!--#end for#-->
</div><br/>
$T('wizard-tip4')
<br/><br/>
$T('wizard-tip-wiki') <a href="$helpuri">wiki</a>
</div>
</div>
<hr /><br/>
<div class="full-width">
<table class="full-width">
<tr class="align-center">
<td><input type="hidden" name="session" id="apikey" value="$session"><input class="bigbutton disabled" type="button" onclick="document.location ='$access_url'" value="$T('wizard-goto')" disabled="disabled"/></td>
</tr>
</table>
</div>
<!--#include $webdir + "/inc_bottom.tmpl"#-->

View File

@@ -1,5 +1,6 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>$T('wizard-quickstart')</title>
<link rel="stylesheet" type="text/css" href="static/style.css"/>
<link rel="shortcut icon" href="static/images/favicon.ico" />

View File

@@ -1,39 +1,34 @@
<!--#include $webdir + "/inc_top.tmpl"#-->
<form action="./four" method="post" autocomplete="off">
<p>$T('wizard-index-explain')</p>
<div id="serverDetails">
<h3><a href="http://$newzbin_url" target="_blank">Newzbin2.es</a> ($T('wizard-optional'))</h3>
<label class="label">$T('srv-username'):</label><input type="text" size="20" value="$newzbin_user" name="newzbin_user">
<br class="clear" />
<label class="label">$T('srv-password'):</label><input type="password" size="20" value="$newzbin_pass" name="newzbin_pass">
<br class="clear" />
<input type="checkbox" name="newzbin_bookmarks" id="newzbin_bookmarks" value="1" <!--#if $newzbin_bookmarks == 1 then 'checked="checked"' else ''#-->> <label for="newzbin_bookmarks">$T('wizard-index-bookmark')</label><br />
<h3><a href="http://nzbmatrix.com" target="_blank">NZBMatrix.com</a> ($T('wizard-optional'))</h3>
<label class="label">$T('srv-username'):</label><input type="text" size="20" value="$matrix_user" name="matrix_user">
<br class="clear" />
<label class="label">$T('opt-apikey'):</label><input type="text" size="20" value="$matrix_apikey" name="matrix_apikey">
</div></div>
<script type="text/javascript" src="static/javascript/jquery.js"></script>
<script type="text/javascript" src="static/javascript/restart.js"></script>
<br/><br/>
<h4 id="restarting" class="align-center">$T('wizard-restarting')</h4>
<h4 id="complete" class="align-center success hidden">$T('wizard-complete')</h4>
<br />
<br/>
<div id="tips" class="hidden">
$T('wizard-tip1') <span class="bold">$T('wizard-tip2')</span><br/>
<!--#set $tip3 = $T('wizard-tip3') % ''#-->
$tip3<br/><br/>
<div class="quoteBlock">
<!--#set $i = 0#-->
<!--#for $url in $urls#-->
<!--#set $i = $i+1#-->
<a href="$url">$url</a><!--#if $i != len($urls)#--><br /><!--#end if#-->
<!--#end for#-->
</div><br/>
$T('wizard-tip4')
<br/><br/>
$T('wizard-tip-wiki') <a href="$helpuri">wiki</a>
</div>
</div>
<hr /><br/>
<div class="full-width">
<table class="full-width">
<tr>
<td><input class="bigbutton" type="button" onclick="document.location ='./two'" value="&lsaquo; $T('wizard-previous')" /></td>
<td>
<div class="align-center">
<!--#for $step in xrange($steps)#-->
<!--#set $step = $step + 1#-->
<span class="<!--#if $step == $number then 'selected' else 'unselected'#-->">$step</span>
<!--#end for#-->
</div>
</td>
<td class="align-right"><input class="bigbutton" type="submit" value="$T('wizard-next') &raquo;" /></td>
<tr class="align-center">
<td><input type="hidden" name="session" id="apikey" value="$session"><input class="bigbutton disabled" type="button" onclick="document.location ='$access_url'" value="$T('wizard-goto')" disabled="disabled"/></td>
</tr>
</table>
</div>
</form>
<!--#include $webdir + "/inc_bottom.tmpl"#-->
<!--#include $webdir + "/inc_bottom.tmpl"#-->

View File

@@ -39,9 +39,14 @@ build_folders = (
)
# Check presense of all builds
sharepath = os.environ.get('SHARE')
if not (sharepath and os.path.exists(sharepath)):
print 'Build share not defined or not found'
exit(1)
build_paths = []
for build in builds:
path = os.path.join(os.environ['HOME'], 'project/osx/%s-%s.cpio' % (prod, build))
path = os.path.join(sharepath,'%s-%s.cpio' % (prod, build))
if os.path.exists(path):
build_paths.append(path)
else:
@@ -100,4 +105,4 @@ print 'Make image internet-enabled'
os.system("hdiutil internet-enable %s" % fileDmg)
print 'Copy GZ file'
os.system('cp ~/project/osx/%s .' % fileOSr)
os.system('cp "%s" .' % os.path.join(sharepath, fileOSr))

View File

Binary file not shown.

View File

@@ -382,7 +382,7 @@ if target == 'app':
DATA_FILES = ['interfaces', 'locale', 'email', ('', glob.glob("osx/resources/*"))]
NZBFILE = dict(
CFBundleTypeExtensions = [ "nzb","zip","rar" ],
CFBundleTypeExtensions = [ "nzb" ],
CFBundleTypeIconFile = 'nzbfile.icns',
CFBundleTypeMIMETypes = [ "text/nzb" ],
CFBundleTypeName = 'NZB File',
@@ -438,8 +438,8 @@ if target == 'app':
os.system('rm dist/SABnzbd.app/Contents/Resources/site.py')
# Add the SabNotifier app
if OSX_ML and os.path.exists('/project/sabnotifier/SABnzbd.app'):
os.system("cp -pR /project/sabnotifier/SABnzbd.app dist/SABnzbd.app/Contents/Resources/")
if OSX_ML and os.path.exists(os.path.join(os.environ['HOME'], 'sabnotifier/SABnzbd.app')):
os.system("cp -pR $HOME/sabnotifier/SABnzbd.app dist/SABnzbd.app/Contents/Resources/")
# Add License files
os.mkdir("dist/SABnzbd.app/Contents/Resources/licenses/")
@@ -448,19 +448,20 @@ if target == 'app':
os.system("sleep 5")
# Archive result to share
dest_path = '/Volumes/VMware Shared Folders/osx'
if not os.path.exists(dest_path):
dest_path = '$HOME/project/osx'
cpio_path = os.path.join(dest_path, prod) + '-' + postfix + '.cpio'
print 'Create CPIO file %s' % cpio_path
delete_files(cpio_path)
os.system('ditto -c -z dist/ "%s"' % cpio_path)
# Archive result to share, if present
dest_path = os.environ.get('SHARE')
if dest_path and os.path.exists(dest_path):
cpio_path = os.path.join(dest_path, prod) + '-' + postfix + '.cpio'
print 'Create CPIO file %s' % cpio_path
delete_files(cpio_path)
os.system('ditto -c -z dist/ "%s"' % cpio_path)
else:
print 'No SHARE variable set, build result not copied'
if OSX_ML:
print 'Create src %s' % fileOSr
delete_files(fileOSr)
os.system('tar -czf %s --exclude ".git*" --exclude "sab*.zip" --exclude "SAB*.tar.gz" --exclude "*.cmd" --exclude "*.pyc" '
os.system('tar -czf "%s" --exclude ".git*" --exclude "sab*.zip" --exclude "SAB*.tar.gz" --exclude "*.cmd" --exclude "*.pyc" '
'--exclude "*.sparseimage*" --exclude "dist" --exclude "build" --exclude "*.nsi" --exclude "win" --exclude "*.dmg" '
'./ >/dev/null' % os.path.join(dest_path, fileOSr) )

View File

@@ -8,14 +8,14 @@ msgstr ""
"Project-Id-Version: sabnzbd\n"
"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
"POT-Creation-Date: 2012-04-28 12:01+0000\n"
"PO-Revision-Date: 2011-06-26 10:50+0000\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"PO-Revision-Date: 2012-12-28 10:58+0000\n"
"Last-Translator: Thomas Lucke (Lucky) <Unknown>\n"
"Language-Team: German <de@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2012-04-29 05:17+0000\n"
"X-Generator: Launchpad (build 15149)\n"
"X-Launchpad-Export-Date: 2012-12-29 05:11+0000\n"
"X-Generator: Launchpad (build 16378)\n"
#: email/email.tmpl:1
msgid ""
@@ -189,3 +189,24 @@ msgid ""
"\n"
"Bye\n"
msgstr ""
"## Translation by Thomas Lucke (Lucky)\n"
"##\n"
"## Bad URL Fetch Email template for SABnzbd\n"
"## This a Cheetah template\n"
"## Documentation: http://sabnzbd.wikidot.com/email-templates\n"
"##\n"
"## Newlines and whitespace are significant!\n"
"##\n"
"## These are the email headers\n"
"To: $to\n"
"From: $from\n"
"Date: $date\n"
"Subject: SABnzbd konnte eine NZB-Datei nicht herunterladen\n"
"X-priority: 5\n"
"X-MS-priority: 5\n"
"## After this comes the body, the empty line is required!\n"
"\n"
"Hallo,\n"
"\n"
"SABnzbd konnte die NZB-Datei von $url nicht herrunterladen.\n"
"Die Fehlermeldung war: $msg\n"

View File

File diff suppressed because it is too large Load Diff

View File

File diff suppressed because it is too large Load Diff

View File

File diff suppressed because it is too large Load Diff

View File

File diff suppressed because it is too large Load Diff

View File

File diff suppressed because it is too large Load Diff

View File

File diff suppressed because it is too large Load Diff

View File

File diff suppressed because it is too large Load Diff

View File

File diff suppressed because it is too large Load Diff

View File

File diff suppressed because it is too large Load Diff

View File

File diff suppressed because it is too large Load Diff

View File

File diff suppressed because it is too large Load Diff

View File

@@ -8,14 +8,14 @@ msgstr ""
"Project-Id-Version: sabnzbd\n"
"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
"POT-Creation-Date: 2012-08-14 18:42+0000\n"
"PO-Revision-Date: 2012-05-03 03:22+0000\n"
"Last-Translator: Rene <Unknown>\n"
"PO-Revision-Date: 2012-12-28 11:02+0000\n"
"Last-Translator: Steffen Thomsen <urskov@gmail.com>\n"
"Language-Team: Danish <da@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2012-08-15 05:11+0000\n"
"X-Generator: Launchpad (build 15801)\n"
"X-Launchpad-Export-Date: 2012-12-29 05:12+0000\n"
"X-Generator: Launchpad (build 16378)\n"
#: NSIS_Installer.nsi:425
msgid "Go to the SABnzbd Wiki"
@@ -27,11 +27,11 @@ msgstr "Vis udgivelsesbemærkninger"
#: NSIS_Installer.nsi:429
msgid "Support the project, Donate!"
msgstr "Støtte projektet, donere!"
msgstr "Støt projektet, donér!"
#: NSIS_Installer.nsi:431
msgid "Please close \"SABnzbd.exe\" first"
msgstr "Luk 'SABnzbd.exe' først"
msgstr "Luk venligst \"SABnzbd.exe\" først"
#: NSIS_Installer.nsi:433
msgid ""
@@ -52,7 +52,7 @@ msgstr "Kør ved opstart"
#: NSIS_Installer.nsi:439
msgid "Desktop Icon"
msgstr "Skrivebords ikon"
msgstr "Skrivebordsikon"
#: NSIS_Installer.nsi:441
msgid "NZB File association"
@@ -64,19 +64,19 @@ msgstr "Slet program"
#: NSIS_Installer.nsi:445
msgid "Delete Settings"
msgstr "Slet instillinger"
msgstr "Slet indstillinger"
#: NSIS_Installer.nsi:447
msgid ""
"This system requires the Microsoft runtime library VC90 to be installed "
"first. Do you want to do that now?"
msgstr ""
"Dette system kræver, at Microsoft runtime biblioteket VC90, der skal "
"installeres først. Ønsker du at gøre det nu?"
"Dette system kræver, at Microsoft runtime biblioteket VC90 skal installeres "
"først. Ønsker du at gøre det nu?"
#: NSIS_Installer.nsi:449
msgid "Downloading Microsoft runtime installer..."
msgstr "Downloading Microsoft runtime installer..."
msgstr "Downloader Microsoft runtime installationsfil..."
#: NSIS_Installer.nsi:451
msgid "Download error, retry?"
@@ -91,12 +91,13 @@ msgid ""
"You cannot overwrite an existing installation. \\n\\nClick `OK` to remove "
"the previous version or `Cancel` to cancel this upgrade."
msgstr ""
"Du kan ikke overskrive en eksisterende installation. Klik `OK` for at fjerne "
"den tidligere version eller `Annuller` for at annullere denne opgradering."
"Du kan ikke overskrive en eksisterende installation. \\n\\nKlik `OK` for at "
"fjerne den tidligere version eller `Annuller` for at annullere denne "
"opgradering."
#: NSIS_Installer.nsi:457
msgid "Your settings and data will be preserved."
msgstr "Dine indstillinger og data vil blive opbevaret."
msgstr "Dine indstillinger og data vil blive bevaret."
#~ msgid "Start SABnzbd (hidden)"
#~ msgstr "Start SABnzbd"

View File

@@ -220,6 +220,13 @@ def initialize(pause_downloader = False, clean_up = False, evalSched=False, repa
# New admin folder
misc.remove_all(cfg.admin_dir.get_path(), '*.sab')
### Optionally wait for "incomplete" to become online
if cfg.wait_for_dfolder():
wait_for_download_folder()
else:
cfg.download_dir.set(cfg.download_dir(), create=True)
cfg.download_dir.set_create(True)
### Set access rights for "incomplete" base folder
misc.set_permissions(cfg.download_dir.get_path(), recursive=False)
@@ -617,7 +624,7 @@ def add_nzbfile(nzbfile, pp=None, script=None, cat=None, priority=NORMAL_PRIORIT
logging.info("Traceback: ", exc_info = True)
if ext.lower() in ('.zip', '.rar'):
return ProcessArchiveFile(filename, path, pp, script, cat, priority=priority)
return ProcessArchiveFile(filename, path, pp, script, cat, priority=priority, nzbname=nzbname)
else:
return ProcessSingleFile(filename, path, pp, script, cat, priority=priority, nzbname=nzbname, keep=keep, reuse=reuse)
@@ -1075,6 +1082,13 @@ def check_incomplete_vs_complete():
cfg.download_dir.set('incomplete')
def wait_for_download_folder():
""" Wait for download folder to become available """
while not cfg.download_dir.test_path():
logging.debug('Waiting for "incomplete" folder')
time.sleep(2.0)
# Required wrapper because nzbstuff.py cannot import downloader.py
def active_primaries():
return sabnzbd.downloader.Downloader.do.active_primaries()

View File

@@ -52,7 +52,7 @@ from sabnzbd.utils.json import JsonWriter
from sabnzbd.utils.pathbrowser import folders_at_path
from sabnzbd.misc import loadavg, to_units, diskfree, disktotal, get_ext, \
get_filename, int_conv, globber, time_format, remove_all, \
starts_with_path
starts_with_path, cat_convert
from sabnzbd.encoding import xml_name, unicoder, special_fixer, platform_encode, html_escape
from sabnzbd.postproc import PostProcessor
from sabnzbd.articlecache import ArticleCache
@@ -346,7 +346,7 @@ def _api_addlocalfile(name, output, kwargs):
if get_ext(name) in ('.zip', '.rar'):
res = sabnzbd.dirscanner.ProcessArchiveFile(\
fn, name, pp=pp, script=script, cat=cat, priority=priority, keep=True)
fn, name, pp=pp, script=script, cat=cat, priority=priority, keep=True, nzbname=nzbname)
elif get_ext(name) in ('.nzb', '.gz'):
res = sabnzbd.dirscanner.ProcessSingleFile(\
fn, name, pp=pp, script=script, cat=cat, priority=priority, keep=True, nzbname=nzbname)
@@ -632,6 +632,12 @@ def _api_watched_now(name, output, kwargs):
return report(output)
def _api_resume_pp(name, output, kwargs):
""" API: accepts output """
PostProcessor.do.paused = False
return report(output)
def _api_rss_now(name, output, kwargs):
""" API: accepts output """
# Run RSS scan async, because it can take a long time
@@ -650,7 +656,7 @@ def _api_test_email(name, output, kwargs):
pack['unpack'] = ['action 1', 'action 2']
res = sabnzbd.emailer.endjob('I had a d\xe8ja vu', 123, 'unknown', True,
os.path.normpath(os.path.join(cfg.complete_dir.get_path(), '/unknown/I had a d\xe8ja vu')),
123*MEBI, pack, 'my_script', 'Line 1\nLine 2\nLine 3\nd\xe8ja vu\n', 0)
123*MEBI, None, pack, 'my_script', 'Line 1\nLine 2\nLine 3\nd\xe8ja vu\n', 0)
if res == 'Email succeeded':
res = None
return report(output, error=res)
@@ -795,6 +801,7 @@ _api_table = {
'rescan' : _api_rescan,
'eval_sort' : _api_eval_sort,
'watched_now' : _api_watched_now,
'resume_pp' : _api_resume_pp,
'rss_now' : _api_rss_now,
'browse' : _api_browse,
'reset_quota' : _api_reset_quota,
@@ -1594,6 +1601,7 @@ def build_header(prim, webdir=''):
header['quota'] = to_units(BPSMeter.do.quota)
header['have_quota'] = bool(BPSMeter.do.quota > 0.0)
header['left_quota'] = to_units(BPSMeter.do.left)
header['pp_pause_event'] = sabnzbd.scheduler.pp_pause_event()
status = ''
if Downloader.do.paused or Downloader.do.postproc:

View File

@@ -112,8 +112,14 @@ class Assembler(Thread):
logging.debug('Got md5pack for set %s', setname)
if check_encrypted_rar(nzo, filepath):
logging.warning(Ta('WARNING: Paused job "%s" because of encrypted RAR file'), latin1(nzo.final_name))
nzo.pause()
if cfg.pause_on_pwrar() == 1:
logging.warning(Ta('WARNING: Paused job "%s" because of encrypted RAR file'), latin1(nzo.final_name))
nzo.pause()
else:
logging.warning(Ta('WARNING: Aborted job "%s" because of encrypted RAR file'), latin1(nzo.final_name))
nzo.fail_msg = T('Aborted, encryption detected')
import sabnzbd.nzbqueue
sabnzbd.nzbqueue.NzbQueue.do.end_job(nzo)
nzf.completed = True
else:
sabnzbd.nzbqueue.NzbQueue.do.remove(nzo.nzo_id, add_to_history=False, cleanup=False)
@@ -284,9 +290,16 @@ def ParseFilePacket(f, header):
def is_cloaked(path, names):
""" Return True if this is likely to be a cloaked encrypted post """
fname = unicoder(os.path.split(path)[1]).lower()
fname = os.path.splitext(fname)[0]
for name in names:
name = unicoder(name.lower())
if fname == name or 'password' in name:
name = os.path.split(name.lower())[1]
name, ext = os.path.splitext(unicoder(name))
if ext == u'.rar' and fname.startswith(name) and (len(fname) - len(name)) < 8 and \
'.subs.' not in fname:
logging.debug('File %s is probably encrypted due to RAR with same name inside this RAR', fname)
return True
elif 'password' in name:
logging.debug('RAR %s is probably encrypted: "password" in filename %s', fname, name)
return True
return False
@@ -294,11 +307,11 @@ def is_cloaked(path, names):
def check_encrypted_rar(nzo, filepath):
""" Check if file is rar and is encrypted """
encrypted = False
if not nzo.password and cfg.pause_on_pwrar() and is_rarfile(filepath):
if not nzo.password and not nzo.meta.get('password') and cfg.pause_on_pwrar() and is_rarfile(filepath):
try:
zf = RarFile(filepath, all_names=True)
encrypted = zf.encrypted or is_cloaked(filepath, zf.namelist())
if encrypted and int(nzo.encrypted) < 2:
if encrypted and int(nzo.encrypted) < 2 and not nzo.reuse:
nzo.encrypted = 1
else:
encrypted = False

View File

@@ -398,10 +398,20 @@ class BPSMeter(object):
return None, 0, 0
def midnight(self):
""" Midnight action: dummy update for all servers """
for server in self.day_total:
self.update(server)
def quota_handler():
""" To be called from scheduler """
logging.debug('Checking quota')
BPSMeter.do.reset_quota()
def midnight_action():
if BPSMeter.do:
BPSMeter.do.midnight()
BPSMeter()

View File

@@ -88,6 +88,7 @@ start_paused = OptionBool('misc', 'start_paused', False)
enable_unrar = OptionBool('misc', 'enable_unrar', True)
enable_unzip = OptionBool('misc', 'enable_unzip', True)
enable_recursive = OptionBool('misc', 'enable_recursive', True)
enable_filejoin = OptionBool('misc', 'enable_filejoin', True)
enable_tsjoin = OptionBool('misc', 'enable_tsjoin', True)
enable_par_cleanup = OptionBool('misc', 'enable_par_cleanup', True)
@@ -103,6 +104,7 @@ par2_multicore = OptionBool('misc', 'par2_multicore', True)
allow_64bit_tools = OptionBool('misc', 'allow_64bit_tools', True)
allow_streaming = OptionBool('misc', 'allow_streaming', False)
pre_check = OptionBool('misc', 'pre_check', False)
fail_hopeless = OptionBool('misc', 'fail_hopeless', False)
req_completion_rate = OptionNumber('misc', 'req_completion_rate', 100.2, 100, 200)
newzbin_username = OptionStr('newzbin', 'username')
@@ -162,7 +164,7 @@ xxx_apikey = OptionStr('nzbxxx', 'apikey')
configlock = OptionBool('misc', 'config_lock', 0)
umask = OptionStr('misc', 'permissions', '', validation=validate_octal)
download_dir = OptionDir('misc', 'download_dir', DEF_DOWNLOAD_DIR, validation=validate_safedir)
download_dir = OptionDir('misc', 'download_dir', DEF_DOWNLOAD_DIR, create=False, validation=validate_safedir)
download_free = OptionStr('misc', 'download_free')
complete_dir = OptionDir('misc', 'complete_dir', DEF_COMPLETE_DIR, create=False, \
apply_umask=True, validation=validate_notempty)
@@ -176,6 +178,8 @@ dirscan_speed = OptionNumber('misc', 'dirscan_speed', DEF_SCANRATE, 0, 3600)
size_limit = OptionStr('misc', 'size_limit', '0')
password_file = OptionDir('misc', 'password_file', '', create=False)
fsys_type = OptionNumber('misc', 'fsys_type', 0, 0, 2)
wait_for_dfolder = OptionBool('misc', 'wait_for_dfolder', False)
warn_empty_nzb = OptionBool('misc', 'warn_empty_nzb', True)
cherryhost = OptionStr('misc', 'host', DEF_HOST)
if sabnzbd.WIN32:
@@ -255,6 +259,7 @@ marker_file = OptionStr('misc', 'nomedia_marker', '')
wait_ext_drive = OptionNumber('misc', 'wait_ext_drive', 5, 1, 60)
history_limit = OptionNumber('misc', 'history_limit', 50, 0)
show_sysload = OptionNumber('misc', 'show_sysload', 2, 0, 2)
web_watchdog = OptionBool('misc', 'web_watchdog', False)
#------------------------------------------------------------------------------
# Set root folders for Folder config-items

View File

@@ -186,6 +186,14 @@ class OptionDir(Option):
res, path = sabnzbd.misc.create_real_path(self.ident()[1], self.__root, value, self.__apply_umask)
return path
def test_path(self):
""" Return True if path exists """
value = self.get()
if value:
return os.path.exists(sabnzbd.misc.real_path(self.__root, value))
else:
return False
def set_root(self, root):
""" Set new root, is assumed to be valid """
self.__root = root
@@ -210,6 +218,10 @@ class OptionDir(Option):
self._Option__set(value)
return error
def set_create(self, value):
""" Set auto-creation value """
self.__create = value
class OptionList(Option):
""" List option class """

View File

@@ -84,6 +84,8 @@ class Decoder(Thread):
article, lines = art_tup
nzf = article.nzf
nzo = nzf.nzo
art_id = article.article
killed = False
data = None
@@ -96,14 +98,16 @@ class Decoder(Thread):
if nzo.precheck:
raise BadYenc
register = True
logging.debug("Decoding %s", article)
logging.debug("Decoding %s", art_id)
data = decode(article, lines)
nzf.article_count += 1
found = True
except IOError, e:
logme = Ta('Decoding %s failed') % article
logging.info(logme)
logme = Ta('Decoding %s failed') % art_id
logging.warning(logme)
logging.info("Traceback: ", exc_info = True)
sabnzbd.downloader.Downloader.do.pause()
article.fetcher = None
@@ -113,7 +117,7 @@ class Decoder(Thread):
register = False
except CrcError, e:
logme = Ta('CRC Error in %s (%s -> %s)') % (article, e.needcrc, e.gotcrc)
logme = Ta('CRC Error in %s (%s -> %s)') % (art_id, e.needcrc, e.gotcrc)
logging.info(logme)
data = e.data
@@ -135,27 +139,32 @@ class Decoder(Thread):
# 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', 'blocked')):
logging.info('Article removed from server (%s)', article)
lline = line.lower()
if 'message-id:' in lline:
found = True
if not line.startswith('X-') and match_str(lline, ('dmca', 'removed', 'cancel', 'blocked')):
killed = True
break
if killed:
logme = 'Article removed from server (%s)'
logging.info(logme, art_id)
if nzo.precheck:
if found or not killed:
if found and not killed:
# Pre-check, proper article found, just register
logging.debug('Server has article %s', article)
logging.debug('Server has article %s', art_id)
register = True
elif not killed and not found:
logme = Ta('Badly formed yEnc article in %s') % article
logme = Ta('Badly formed yEnc article in %s') % art_id
logging.info(logme)
if not found:
if not found or killed:
new_server_found = self.__search_new_server(article)
if new_server_found:
register = False
logme = None
except:
logme = Ta('Unknown Error while decoding %s') % article
logme = Ta('Unknown Error while decoding %s') % art_id
logging.info(logme)
logging.info("Traceback: ", exc_info = True)
@@ -165,7 +174,10 @@ class Decoder(Thread):
logme = None
if logme:
article.nzf.nzo.inc_log('bad_art_log', logme)
if killed:
article.nzf.nzo.inc_log('killed_art_log', art_id)
else:
article.nzf.nzo.inc_log('bad_art_log', art_id)
else:
new_server_found = self.__search_new_server(article)
@@ -236,7 +248,7 @@ def decode(article, data):
if not ybegin:
found = False
try:
for i in xrange(10):
for i in xrange(min(40, len(data))):
if data[i].startswith('begin '):
nzf.filename = name_fixer(data[i].split(None, 2)[2])
nzf.type = 'uu'
@@ -252,7 +264,10 @@ def decode(article, data):
except IndexError:
raise BadYenc()
decoded_data = '\r\n'.join(data)
if found:
decoded_data = '\r\n'.join(data)
else:
raise BadYenc()
#Deal with yenc encoded posts
elif (ybegin and yend):
@@ -300,7 +315,7 @@ def yCheck(data):
yend = None
## Check head
for i in xrange(40):
for i in xrange(min(40, len(data))):
try:
if data[i].startswith('=ybegin '):
splits = 3

View File

@@ -59,7 +59,8 @@ def CompareStat(tup1, tup2):
return True
def ProcessArchiveFile(filename, path, pp=None, script=None, cat=None, catdir=None, keep=False, priority=None, url=''):
def ProcessArchiveFile(filename, path, pp=None, script=None, cat=None, catdir=None, keep=False,
priority=None, url='', nzbname=None):
""" Analyse ZIP file and create job(s).
Accepts ZIP files with ONLY nzb/nfo/folder files in it.
returns (status, nzo_ids)
@@ -88,6 +89,7 @@ def ProcessArchiveFile(filename, path, pp=None, script=None, cat=None, catdir=No
status = 1
names = zf.namelist()
names.sort()
nzbcount = 0
for name in names:
name = name.lower()
if not (name.endswith('.nzb') or name.endswith('.nfo') or name.endswith('/')):
@@ -95,7 +97,10 @@ def ProcessArchiveFile(filename, path, pp=None, script=None, cat=None, catdir=No
break
elif name.endswith('.nzb'):
status = 0
nzbcount += 1
if status == 0:
if nzbcount != 1:
nzbname = None
for name in names:
if name.lower().endswith('.nzb'):
try:
@@ -108,7 +113,8 @@ def ProcessArchiveFile(filename, path, pp=None, script=None, cat=None, catdir=No
name = misc.sanitize_foldername(name)
if data:
try:
nzo = nzbstuff.NzbObject(name, 0, pp, script, data, cat=cat, url=url, priority=priority)
nzo = nzbstuff.NzbObject(name, 0, pp, script, data, cat=cat, url=url,
priority=priority, nzbname=nzbname)
except:
nzo = None
if nzo:
@@ -171,6 +177,9 @@ def ProcessSingleFile(filename, path, pp=None, script=None, cat=None, catdir=Non
except TypeError:
# Duplicate, ignore
nzo = None
except ValueError:
# Empty, but correct file
return -1, nzo_ids
except:
if data.find("<nzb") >= 0 and data.find("</nzb") < 0:
# Looks like an incomplete file, retry

View File

@@ -47,6 +47,8 @@ _PENALTY_SHARE = 10 # Account sharing detected
_PENALTY_TOOMANY = 10 # Too many connections
_PENALTY_PERM = 10 # Permanent error, like bad username/password
_PENALTY_SHORT = 1 # Minimal penalty when no_penalties is set
_PENALTY_VERYSHORT = 0.1 # Error 400 without cause clues
TIMER_LOCK = RLock()
@@ -77,7 +79,8 @@ class Server(object):
self.warning = ''
self.info = None # Will hold getaddrinfo() list
self.request = False # True if a getaddrinfo() request is pending
self.oddball = 'free.xsusenet.com' in host
self.have_body = 'free.xsusenet.com' not in host
self.have_stat = True # Assume server has "STAT", until proven otherwise
for i in range(threads):
self.idle_threads.append(NewsWrapper(self, i+1))
@@ -502,8 +505,7 @@ class Downloader(Thread):
ecode = msg[:3]
display_msg = ' [%s]' % msg
logging.debug('Server login problem: %s, %s', ecode, msg)
if ((ecode in ('502', '400')) and clues_too_many(msg)) or \
(ecode == '481' and clues_too_many(msg)):
if ecode in ('502', '481', '400') and clues_too_many(msg):
# Too many connections: remove this thread and reduce thread-setting for server
# Plan to go back to the full number after a penalty timeout
if server.active:
@@ -536,6 +538,12 @@ class Downloader(Thread):
else:
penalty = _PENALTY_502
block = True
elif ecode == '400':
# Temp connection problem?
if server.active:
logging.debug('Unspecified error 400 from server %s', server.host)
penalty = _PENALTY_VERYSHORT
block = True
else:
# Unknown error, just keep trying
if server.active:
@@ -599,6 +607,19 @@ class Downloader(Thread):
msg = T('Server %s requires user/password') % ('%s:%s' % (nw.server.host, nw.server.port))
self.__reset_nw(nw, msg, quit=True)
elif code == '500':
if nzo.precheck:
# Assume "STAT" command is not supported
server.have_stat = False
logging.debug('Server %s does not support STAT', server.host)
else:
# Assume "BODY" command is not supported
server.have_body = False
logging.debug('Server %s does not support BODY', server.host)
nw.lines = []
nw.data = ''
self.__request_article(nw)
if done:
server.bad_cons = 0 # Succesful data, clear "bad" counter
if sabnzbd.LOG_ALL:

View File

@@ -187,12 +187,16 @@ def send_with_template(prefix, parm):
return ret
def endjob(filename, msgid, cat, status, path, bytes, stages, script, script_output, script_ret):
def endjob(filename, msgid, cat, status, path, bytes, fail_msg, stages, script, script_output, script_ret):
""" Send end-of-job email """
# Translate the stage names
tr = sabnzbd.api.Ttemplate
xstages = {}
if not status and fail_msg:
xstages = {tr('stage-fail'): (fail_msg,)}
else:
xstages = {}
for stage in stages:
lines = []
for line in stages[stage]:

View File

@@ -185,7 +185,7 @@ def check_apikey(kwargs, nokey=False):
Return None when OK, otherwise an error message
"""
def log_warning(txt):
txt = '%s %s' % (txt, cherrypy.request.headers.get('User-Agent', '??'))
txt = '%s %s>%s' % (txt, cherrypy.request.remote.ip, cherrypy.request.headers.get('User-Agent', '??'))
logging.warning('%s', txt)
output = kwargs.get('output')
@@ -415,8 +415,9 @@ class MainPage(object):
def api(self, **kwargs):
"""Handler for API over http, with explicit authentication parameters
"""
logging.debug('API-call from %s [%s] %s', cherrypy.request.remote.ip, \
cherrypy.request.headers.get('User-Agent', '??'), kwargs)
if not kwargs.get('tickleme') or not cfg.web_watchdog():
logging.debug('API-call from %s [%s] %s', cherrypy.request.remote.ip, \
cherrypy.request.headers.get('User-Agent', '??'), kwargs)
if kwargs.get('mode', '') not in ('version', 'auth'):
msg = check_apikey(kwargs)
if msg: return msg
@@ -460,6 +461,12 @@ class MainPage(object):
retry_job(kwargs.get('job'), kwargs.get('nzbfile'))
raise dcRaiser(self.__root, kwargs)
@cherrypy.expose
def robots_txt(self):
""" Keep web crawlers out """
cherrypy.response.headers['Content-Type'] = 'text/plain'
return 'User-agent: *\nDisallow: /\n'
#------------------------------------------------------------------------------
class NzoPage(object):
@@ -885,9 +892,11 @@ class HistoryPage(object):
#history_items, total_bytes, bytes_beginning = sabnzbd.history_info()
#history['bytes_beginning'] = "%.2f" % (bytes_beginning / GIGI)
postfix = T('B') #: Abbreviation for bytes, as in GB
grand, month, week, day = BPSMeter.do.get_sums()
history['total_size'], history['month_size'], history['week_size'], history['day_size'] = \
to_units(grand), to_units(month), to_units(week), to_units(day)
to_units(grand, postfix=postfix), to_units(month, postfix=postfix), \
to_units(week, postfix=postfix), to_units(day, postfix=postfix)
history['lines'], history['fetched'], history['noofslots'] = build_history(limit=limit, start=start, verbose=self.__verbose, verbose_list=self.__verbose_list, search=search, failed_only=failed_only)
@@ -1089,12 +1098,14 @@ class ConfigPage(object):
def orphan_delete(kwargs):
path = kwargs.get('name')
if path:
path = platform_encode(path)
path = os.path.join(cfg.download_dir.get_path(), path)
remove_all(path, recursive=True)
def orphan_add(kwargs):
path = kwargs.get('name')
if path:
path = platform_encode(path)
path = os.path.join(cfg.download_dir.get_path(), path)
sabnzbd.nzbqueue.repair_job(path, None)
@@ -1158,7 +1169,7 @@ SWITCH_LIST = \
'ignore_samples', 'pause_on_post_processing', 'quick_check', 'nice', 'ionice',
'ssl_type', 'pre_script', 'pause_on_pwrar', 'ampm', 'sfv_check', 'folder_rename',
'unpack_check', 'quota_size', 'quota_day', 'quota_resume', 'quota_period',
'pre_check', 'max_art_tries', 'max_art_opt'
'pre_check', 'max_art_tries', 'max_art_opt', 'fail_hopeless'
)
#------------------------------------------------------------------------------
@@ -1212,7 +1223,9 @@ SPECIAL_BOOL_LIST = \
'queue_complete_pers', 'api_warnings', 'allow_64bit_tools', 'par2_multicore',
'never_repair', 'allow_streaming', 'ignore_unrar_dates', 'rss_filenames', 'news_items',
'osx_menu', 'osx_speed', 'win_menu', 'uniconfig', 'use_pickle', 'allow_incomplete_nzb',
'randomize_server_ip', 'no_ipv6', 'keep_awake', 'overwrite_files', 'empty_postproc'
'randomize_server_ip', 'no_ipv6', 'keep_awake', 'overwrite_files', 'empty_postproc',
'web_watchdog', 'wait_for_dfolder', 'warn_empty_nzb', 'enable_recursive'
)
SPECIAL_VALUE_LIST = \
( 'size_limit', 'folder_max_length', 'fsys_type', 'movie_rename_limit', 'nomedia_marker',
@@ -1670,6 +1683,7 @@ class ConfigRss(object):
active_feed = kwargs.get('feed', '')
conf['active_feed'] = active_feed
conf['rss'] = rss
conf['rss_next'] = time.strftime(time_format('%H:%M'),time.localtime(sabnzbd.rss.next_run()))
if active_feed:
readout = bool(self.__refresh_readout)
@@ -2009,6 +2023,8 @@ class ConfigScheduling(object):
minute = kwargs.get('minute')
hour = kwargs.get('hour')
days_of_week = ''.join([str(x) for x in kwargs.get('daysofweek', '')])
if not days_of_week:
days_of_week = '1234567'
action = kwargs.get('action')
arguments = kwargs.get('arguments')

View File

@@ -73,8 +73,10 @@ def safe_lower(txt):
#------------------------------------------------------------------------------
def globber(path, pattern='*'):
""" Do a glob.glob(), disabling the [] pattern in 'path' """
return glob.glob(os.path.join(path, pattern).replace('[', '[[]'))
if pattern:
return glob.glob(os.path.join(path, pattern).replace('[', '[[]'))
else:
return glob.glob(path.replace('[', '[[]'))
#------------------------------------------------------------------------------
def cat_to_opts(cat, pp=None, script=None, priority=None):
@@ -631,7 +633,7 @@ def from_units(val):
else:
return 0.0
def to_units(val, spaces=0, dec_limit=2):
def to_units(val, spaces=0, dec_limit=2, postfix=''):
""" Convert number to K/M/G/T/P notation
Add "spaces" if not ending in letter
dig_limit==1 show single decimal for M and higher
@@ -660,8 +662,8 @@ def to_units(val, spaces=0, dec_limit=2):
else:
decimals = 0
format = '%%s%%.%sf %%s' % decimals
return format % (sign, val, unit)
format = '%%s%%.%sf %%s%%s' % decimals
return format % (sign, val, unit, postfix)
#------------------------------------------------------------------------------
def same_file(a, b):

View File

@@ -26,13 +26,14 @@ import subprocess
import logging
from time import time
import binascii
import shutil
import sabnzbd
from sabnzbd.encoding import TRANS, UNTRANS, unicode2local, name_fixer, \
reliable_unpack_names, unicoder, latin1, platform_encode
from sabnzbd.utils.rarfile import RarFile, is_rarfile
from sabnzbd.misc import format_time_string, find_on_path, make_script_path, int_conv, \
flag_file
flag_file, real_path, globber
from sabnzbd.tvsort import SeriesSorter
import sabnzbd.cfg as cfg
from sabnzbd.constants import Status, QCHECK_FILE, RENAMES_FILE
@@ -233,7 +234,7 @@ def unpack_magic(nzo, workdir, workdir_complete, dele, one_folder, joinables, zi
nzo.set_action_line()
if rerun:
if rerun and (cfg.enable_recursive() or new_ts or new_joins):
z, y = unpack_magic(nzo, workdir, workdir_complete, dele, one_folder,
xjoinables, xzips, xrars, xts, depth)
if z:
@@ -289,7 +290,6 @@ def get_seq_number(name):
match, set, num = match_ts(name)
else:
num = tail[1:]
assert isinstance(num, str)
if num.isdigit():
return int(num)
else:
@@ -300,6 +300,7 @@ def file_join(nzo, workdir, workdir_complete, delete, joinables):
when succesful, delete originals
"""
newfiles = []
bufsize = 24*1024*1024
# Create matching sets from the list of files
joinable_sets = {}
@@ -330,6 +331,11 @@ def file_join(nzo, workdir, workdir_complete, delete, joinables):
# done, go to next set
continue
# Only join when there is more than one file
size = len(current)
if size < 2:
continue
# Prepare joined file
filename = joinable_set
if workdir_complete:
@@ -338,7 +344,6 @@ def file_join(nzo, workdir, workdir_complete, delete, joinables):
joined_file = open(filename, 'ab')
# Join the segments
size = len(current)
n = get_seq_number(current[0])
seq_error = n > 1
for joinable in current:
@@ -348,7 +353,7 @@ def file_join(nzo, workdir, workdir_complete, delete, joinables):
logging.debug("Processing %s", joinable)
nzo.set_action_line(T('Joining'), '%.0f%%' % perc)
f = open(joinable, 'rb')
joined_file.write(f.read())
shutil.copyfileobj(f, joined_file, bufsize)
f.close()
if delete:
logging.debug("Deleting %s", joinable)
@@ -471,13 +476,15 @@ def rar_extract(rarfile, numrars, one_folder, nzo, setname, extraction_path):
passwords = [nzo.password]
else:
passwords = []
# Append meta passwords, to prevent changing the original list
passwords.extend(nzo.meta.get('password', []))
pw_file = cfg.password_file.get_path()
if pw_file:
try:
pwf = open(pw_file, 'r')
passwords = pwf.read().split('\n')
lines = pwf.read().split('\n')
# Remove empty lines and space-only passwords and remove surrounding spaces
passwords = [pw.strip('\r\n ') for pw in passwords if pw.strip('\r\n ')]
passwords.extend([pw.strip('\r\n ') for pw in lines if pw.strip('\r\n ')])
pwf.close()
logging.info('Read the passwords file %s', pw_file)
except IOError:
@@ -609,7 +616,20 @@ def rar_extract_core(rarfile, numrars, one_folder, nzo, setname, extraction_path
nzo.fail_msg = T('Unpacking failed, write error or disk is full?')
msg = ('[%s] ' + Ta('Unpacking failed, write error or disk is full?')) % setname
nzo.set_unpack_info('Unpack', unicoder(msg), set=setname)
logging.warning(Ta('ERROR: write error (%s)'), line[11:])
logging.error(Ta('ERROR: write error (%s)'), line[11:])
fail = 1
elif line.startswith('Cannot create'):
line2 = proc.readline()
if 'must not exceed 260' in line2:
nzo.fail_msg = T('Unpacking failed, path is too long')
msg = '[%s] %s: %s' % (Ta('Unpacking failed, path is too long'), setname, line[13:])
logging.error(Ta('ERROR: path too long (%s)'), line[13:])
else:
nzo.fail_msg = T('Unpacking failed, write error or disk is full?')
msg = '[%s] %s: %s' % (Ta('Unpacking failed, write error or disk is full?'), setname, line[13:])
logging.error(Ta('ERROR: write error (%s)'), line[13:])
nzo.set_unpack_info('Unpack', unicoder(msg), set=setname)
fail = 1
elif line.startswith('ERROR: '):
@@ -634,10 +654,22 @@ def rar_extract_core(rarfile, numrars, one_folder, nzo, setname, extraction_path
nzo.set_unpack_info('Unpack', unicoder(msg), set=setname)
fail = 2
elif 'is not RAR archive' in line:
# Unrecognizable RAR file
m = re.search('(.+) is not RAR archive', line)
if m:
filename = TRANS(m.group(1)).strip()
else:
filename = '???'
nzo.fail_msg = T('Unusable RAR file')
msg = ('[%s][%s] '+ Ta('Unusable RAR file')) % (setname, latin1(filename))
nzo.set_unpack_info('Unpack', unicoder(msg), set=setname)
fail = 1
else:
m = re.search(r'^(Extracting|Creating|...)\s+(.*?)\s+OK\s*$', line)
if m:
extracted.append(TRANS(m.group(2)))
extracted.append(real_path(extraction_path, TRANS(m.group(2))))
if fail:
if proc:
@@ -774,15 +806,16 @@ def ZIP_Extract(zipfile, extraction_path, one_folder):
# PAR2 Functions
#------------------------------------------------------------------------------
def par2_repair(parfile_nzf, nzo, workdir, setname):
def par2_repair(parfile_nzf, nzo, workdir, setname, single):
""" Try to repair a set, return readd or correctness """
#set the current nzo status to "Repairing". Used in History
parfile = os.path.join(workdir, parfile_nzf.filename)
old_dir_content = os.listdir(workdir)
used_joinables = []
joinables = []
used_joinables = ()
joinables = ()
used_par2 = ()
setpars = pars_of_set(workdir, setname)
result = readd = False
@@ -806,8 +839,8 @@ def par2_repair(parfile_nzf, nzo, workdir, setname):
joinables, zips, rars, ts = build_filelists(workdir, None, check_rar=False)
finished, readd, pars, datafiles, used_joinables = PAR_Verify(parfile, parfile_nzf, nzo,
setname, joinables)
finished, readd, pars, datafiles, used_joinables, used_par2 = PAR_Verify(parfile, parfile_nzf, nzo,
setname, joinables, single=single)
if finished:
result = True
@@ -876,6 +909,7 @@ def par2_repair(parfile_nzf, nzo, workdir, setname):
if f in setpars:
deletables.append(os.path.join(workdir, f))
deletables.extend(used_joinables)
deletables.extend(used_par2)
for filepath in deletables:
if filepath in joinables:
joinables.remove(filepath)
@@ -895,8 +929,10 @@ def par2_repair(parfile_nzf, nzo, workdir, setname):
_RE_BLOCK_FOUND = re.compile('File: "([^"]+)" - found \d+ of \d+ data blocks from "([^"]+)"')
_RE_IS_MATCH_FOR = re.compile('File: "([^"]+)" - is a match for "([^"]+)"')
_RE_LOADING_PAR2 = re.compile('Loading "([^"]+)"\.')
_RE_LOADED_PAR2 = re.compile('Loaded (\d+) new packets')
def PAR_Verify(parfile, parfile_nzf, nzo, setname, joinables, classic=False):
def PAR_Verify(parfile, parfile_nzf, nzo, setname, joinables, classic=False, single=False):
""" Run par2 on par-set """
if cfg.never_repair():
cmd = 'v'
@@ -904,6 +940,8 @@ def PAR_Verify(parfile, parfile_nzf, nzo, setname, joinables, classic=False):
cmd = 'r'
retry_classic = False
used_joinables = []
used_par2 = []
extra_par2_name = None
#set the current nzo status to "Verifying...". Used in History
nzo.status = Status.VERIFYING
start = time()
@@ -927,7 +965,11 @@ def PAR_Verify(parfile, parfile_nzf, nzo, setname, joinables, classic=False):
command.append(joinable)
# Append the wildcard for this set
command.append('%s*' % os.path.join(os.path.split(parfile)[0], setname))
wildcard = '%s*' % os.path.join(os.path.split(parfile)[0], setname)
if single or len(globber(wildcard, None)) < 2:
# Support bizarre naming conventions
wildcard = os.path.join(os.path.split(parfile)[0], '*')
command.append(wildcard)
stup, need_shell, command, creationflags = build_command(command)
logging.debug('Starting par2: %s', command)
@@ -977,6 +1019,16 @@ def PAR_Verify(parfile, parfile_nzf, nzo, setname, joinables, classic=False):
if 'Repairing:' not in line:
lines.append(line)
if extra_par2_name and line.startswith('Loading:') and line.endswith('%'):
continue
if extra_par2_name and line.startswith('Loaded '):
m = _RE_LOADED_PAR2.search(line)
if m and int(m.group(1)) > 0:
used_par2.append(os.path.join(nzo.downpath, extra_par2_name))
extra_par2_name = None
continue
extra_par2_name = None
if line.startswith('Invalid option specified'):
msg = T('[%s] PAR2 received incorrect options, check your Config->Switches settings') % unicoder(setname)
nzo.set_unpack_info('Repair', msg, set=setname)
@@ -997,6 +1049,12 @@ def PAR_Verify(parfile, parfile_nzf, nzo, setname, joinables, classic=False):
start = time()
verified = 1
elif line.startswith('Loading "'):
# Found an extra par2 file. Only the next line will tell whether it's usable
m = _RE_LOADING_PAR2.search(line)
if m and m.group(1).lower().endswith('.par2'):
extra_par2_name = m.group(1)
elif line.startswith('Main packet not found') or 'The recovery file does not exist' in line:
## Initialparfile probably didn't decode properly,
logging.info(Ta('Main packet not found...'))
@@ -1141,6 +1199,17 @@ def PAR_Verify(parfile, parfile_nzf, nzo, setname, joinables, classic=False):
# Hit a bug in par2-tbb, retry with par2-classic
retry_classic = True
elif ' cannot be renamed to ' in line:
if not classic and sabnzbd.WIN32:
# Hit a bug in par2-tbb, retry with par2-classic
retry_classic = True
else:
msg = unicoder(line.strip())
nzo.fail_msg = msg
msg = u'[%s] %s' % (unicoder(setname), msg)
nzo.set_unpack_info('Repair', msg, set=setname)
nzo.status = Status.FAILED
# File: "oldname.rar" - is a match for "newname.rar".
elif 'is a match for' in line:
m = _RE_IS_MATCH_FOR.search(line)
@@ -1150,6 +1219,13 @@ def PAR_Verify(parfile, parfile_nzf, nzo, setname, joinables, classic=False):
logging.debug('PAR2 will rename "%s" to "%s"', old_name, new_name)
renames[new_name] = old_name
elif 'No details available for recoverable file' in line:
msg = unicoder(line.strip())
nzo.fail_msg = msg
msg = u'[%s] %s' % (unicoder(setname), msg)
nzo.set_unpack_info('Repair', msg, set=setname)
nzo.status = Status.FAILED
elif not verified:
if line.startswith('Verifying source files'):
nzo.set_action_line(T('Verifying'), '01/%02d' % verifytotal)
@@ -1199,9 +1275,9 @@ def PAR_Verify(parfile, parfile_nzf, nzo, setname, joinables, classic=False):
if retry_classic:
logging.debug('Retry PAR2-joining with par2-classic')
return PAR_Verify(parfile, parfile_nzf, nzo, setname, joinables, classic=True)
return PAR_Verify(parfile, parfile_nzf, nzo, setname, joinables, classic=True, single=single)
else:
return finished, readd, pars, datafiles, used_joinables
return finished, readd, pars, datafiles, used_joinables, used_par2
#-------------------------------------------------------------------------------
@@ -1308,10 +1384,7 @@ def build_filelists(workdir, workdir_complete, check_rar=True):
zips = [f for f in filelist if ZIP_RE.search(f)]
if check_rar:
rars = [f for f in filelist if RAR_RE.search(f) and is_rarfile(f)]
else:
rars = [f for f in filelist if RAR_RE.search(f)]
rars = [f for f in filelist if RAR_RE.search(f)]
ts = [f for f in filelist if TS_RE.search(f) and f not in joinables]
@@ -1515,7 +1588,10 @@ def list2cmdline(lst):
#------------------------------------------------------------------------------
# Work-around for the failure of Python2.5 on Windows to support IPV6 with HTTPS
def get_from_url(url):
def get_from_url(url, timeout=None):
""" Retrieve URL and return content
`timeout` sets non-standard timeout and skips when on Windows
"""
if 'https:' in url and sabnzbd.WIN32 and sys.version_info < (2,6) and sabnzbd.newsunpack.CURL_COMMAND:
command = [sabnzbd.newsunpack.CURL_COMMAND, "-k", url]
stup, need_shell, command, creationflags = build_command(command)
@@ -1527,6 +1603,14 @@ def get_from_url(url):
p.wait()
else:
import urllib2
s = urllib2.urlopen(url)
output = s.read()
if sys.version_info < (2, 6):
timeout = 0
try:
if timeout:
s = urllib2.urlopen(url, timeout=timeout)
else:
s = urllib2.urlopen(url)
output = s.read()
except:
output = None
return output

View File

@@ -320,11 +320,14 @@ class NewsWrapper(object):
def body(self, precheck):
self.timeout = time.time() + self.server.timeout
if precheck:
command = 'STAT <%s>\r\n' % (self.article.article)
elif self.server.oddball:
command = 'ARTICLE <%s>\r\n' % (self.article.article)
else:
if self.server.have_stat:
command = 'STAT <%s>\r\n' % (self.article.article)
else:
command = 'HEAD <%s>\r\n' % (self.article.article)
elif self.server.have_body:
command = 'BODY <%s>\r\n' % (self.article.article)
else:
command = 'ARTICLE <%s>\r\n' % (self.article.article)
self.nntp.sock.sendall(command)
def send_group(self, group):
@@ -433,17 +436,17 @@ def test_ipv6():
try:
info = socket.getaddrinfo('www.google.com', 80, socket.AF_INET6, socket.SOCK_STREAM,
socket.IPPROTO_IP, socket.AI_CANONNAME)
except socket.gaierror:
except:
return False
try:
af, socktype, proto, canonname, sa = info[0]
sock = socket.socket(af, socktype, proto)
sock.settimeout(4)
sock.settimeout(6)
sock.connect(sa[0:2])
sock.close()
return True
except socket.error:
except:
return False
_EXTERNAL_IPV6 = test_ipv6()

View File

@@ -220,7 +220,7 @@ class NzbQueue(TryList):
if save_nzo is None or nzo is save_nzo:
sabnzbd.save_data(nzo, nzo.nzo_id, nzo.workpath)
if not nzo.futuretype:
nzo.save_attribs()
nzo.save_to_disk()
sabnzbd.save_admin((QUEUE_VERSION, nzo_ids, []), QUEUE_FILE_NAME)
@@ -595,7 +595,7 @@ class NzbQueue(TryList):
return nzo_id_pos1
nzo.priority = priority
nzo.save_attribs()
nzo.save_to_disk()
if nzo_id_pos1 != -1:
del self.__nzo_list[nzo_id_pos1]
@@ -755,7 +755,7 @@ class NzbQueue(TryList):
if not nzo.deleted:
nzo.deleted = True
if nzo.precheck:
nzo.save_attribs()
nzo.save_to_disk()
# Check result
enough, ratio = nzo.check_quality()
if enough:
@@ -886,7 +886,7 @@ def _nzo_date_cmp(nzo1, nzo2):
return cmp(avg_date1, avg_date2)
def _nzo_name_cmp(nzo1, nzo2):
return cmp(nzo1.filename, nzo2.filename)
return cmp(nzo1.filename.lower(), nzo2.filename.lower())
def _nzo_size_cmp(nzo1, nzo2):
return cmp(nzo1.bytes, nzo2.bytes)

View File

@@ -322,6 +322,11 @@ class NzbParser(xml.sax.handler.ContentHandler):
self.in_group = False
self.in_segments = False
self.in_segment = False
self.in_head = False
self.in_meta = False
self.meta_type = ''
self.meta_types = {}
self.meta_content = []
self.filename = ''
self.avg_age = 0
self.valids = 0
@@ -374,6 +379,16 @@ class NzbParser(xml.sax.handler.ContentHandler):
elif name == 'groups' and self.in_nzb and self.in_file:
self.in_groups = True
elif name == 'head' and self.in_nzb:
self.in_head = True
elif name == 'meta' and self.in_nzb and self.in_head:
self.in_meta = True
meta_type = attrs.get('type')
if meta_type:
self.meta_type = meta_type.lower()
self.meta_content = []
elif name == 'nzb':
self.in_nzb = True
@@ -382,6 +397,8 @@ class NzbParser(xml.sax.handler.ContentHandler):
self.group_name.append(content)
elif self.in_segment:
self.article_id.append(content)
elif self.in_meta:
self.meta_content.append(content)
def endElement(self, name):
if name == 'group' and self.in_group:
@@ -436,12 +453,24 @@ class NzbParser(xml.sax.handler.ContentHandler):
sabnzbd.remove_data(nzf.nzf_id, self.nzo.workpath)
self.skipped_files += 1
elif name == 'head':
self.in_head = False
elif name == 'meta':
self.in_meta = False
if self.meta_type:
if self.meta_type not in self.meta_types:
self.meta_types[self.meta_type] = []
self.meta_types[self.meta_type].append(''.join(self.meta_content))
elif name == 'nzb':
self.in_nzb = False
def endDocument(self):
""" End of the file """
self.nzo.groups = self.groups
self.nzo.meta = self.meta_types
logging.debug('META-DATA = %s', self.nzo.meta)
files = max(1, self.valids)
self.nzo.avg_stamp = self.avg_age / files
self.nzo.avg_date = datetime.datetime.fromtimestamp(self.avg_age / files)
@@ -501,7 +530,9 @@ NzbObjectMapper = (
('oversized', 'oversized'), # Was detected as oversized
('create_group_folder', 'create_group_folder'),
('precheck', 'precheck'),
('incomplete', 'incomplete') # Was detected as incomplete
('incomplete', 'incomplete'), # Was detected as incomplete
('reuse', 'reuse'),
('meta', 'meta') # Meta-date from 1.1 type NZB
)
class NzbObject(TryList):
@@ -537,6 +568,7 @@ class NzbObject(TryList):
self.work_name = work_name
self.final_name = work_name
self.meta = {}
self.created = False # dirprefixes + work_name created
self.bytes = 0 # Original bytesize
self.bytes_downloaded = 0 # Downloaded byte
@@ -588,6 +620,7 @@ class NzbObject(TryList):
self.oversized = False
self.precheck = False
self.incomplete = False
self.reuse = reuse
if self.status == Status.QUEUED and not reuse:
self.precheck = cfg.pre_check()
if self.precheck:
@@ -695,12 +728,23 @@ class NzbObject(TryList):
if not self.files and not reuse:
self.purge_data(keep_basic=False)
if self.url:
logging.warning(Ta('Empty NZB file %s') + ' [%s]', filename, self.url)
if cfg.warn_empty_nzb():
mylog = logging.warning
else:
logging.warning(Ta('Empty NZB file %s'), filename)
mylog = logging.info
if self.url:
mylog(Ta('Empty NZB file %s') + ' [%s]', filename, self.url)
else:
mylog(Ta('Empty NZB file %s'), filename)
raise ValueError
if cat is None:
for metacat in self.meta.get('category', ()):
metacat = cat_convert(metacat)
if metacat:
cat = metacat
break
if cat is None:
for grp in self.groups:
cat = cat_convert(grp)
@@ -845,8 +889,8 @@ class NzbObject(TryList):
head, vol, block = analyse_par2(fn)
## Is a par2file and repair mode activated
if head and (self.repair or cfg.allow_streaming()):
## Skip if mini-par2 is not complete
if not block and nzf.bytes_left:
## Skip if mini-par2 is not complete and there are more par2 files
if not block and nzf.bytes_left and self.extrapars.get(head):
return
nzf.set_par2(head, vol, block)
## Already got a parfile for this set?
@@ -890,6 +934,14 @@ class NzbObject(TryList):
if file_done:
self.remove_nzf(nzf)
if not self.reuse and cfg.fail_hopeless() and not self.check_quality(99)[0]:
#set the nzo status to return "Queued"
self.status = Status.QUEUED
self.set_download_report()
self.fail_msg = T('Aborted, cannot be completed')
self.set_unpack_info('Download', self.fail_msg, unique=False)
logging.debug('Abort job "%s", due to impossibility to complete it', self.final_name_pw_clean)
return True, True, True
if reset:
self.reset_try_list()
@@ -935,6 +987,7 @@ class NzbObject(TryList):
if (nzf.filename == filename) or (subject == filename) or (filename in subject):
nzf.filename = filename
nzf.completed = True
nzf.bytes_left = 0
self.handle_par2(nzf, file_done=True)
self.remove_nzf(nzf)
nzfs.remove(nzf)
@@ -952,6 +1005,7 @@ class NzbObject(TryList):
self.bytes += nzf.bytes
nzf.filename = filename
nzf.completed = True
nzf.bytes_left = 0
self.handle_par2(nzf, file_done=True)
self.remove_nzf(nzf)
logging.info('File %s added to job', filename)
@@ -968,6 +1022,7 @@ class NzbObject(TryList):
def set_pp(self, value):
self.repair, self.unpack, self.delete = sabnzbd.pp_to_opts(value)
self.save_to_disk()
@property
def final_name_pw(self):
@@ -1000,7 +1055,7 @@ class NzbObject(TryList):
if isinstance(name, str):
name, self.password = scan_password(platform_encode(name))
self.final_name = sanitize_foldername(name)
self.save_attribs()
self.save_to_disk()
def pause(self):
self.status = 'Paused'
@@ -1028,7 +1083,7 @@ class NzbObject(TryList):
self.partable.pop(setname)
__re_quick_par2_check = re.compile('\.par2\W*', re.I)
def check_quality(self):
def check_quality(self, req_ratio=0):
""" Determine amount of articles present on servers
and return (gross available, nett) bytes
"""
@@ -1039,7 +1094,8 @@ class NzbObject(TryList):
for nzf_id in self.files_table:
nzf = self.files_table[nzf_id]
assert isinstance(nzf, NzbFile)
short += nzf.bytes_left
if nzf.deleted:
short += nzf.bytes_left
if self.__re_quick_par2_check.search(nzf.subject):
pars += nzf.bytes
anypars = True
@@ -1048,7 +1104,7 @@ class NzbObject(TryList):
have = need + pars - short
ratio = float(have) / float(max(1, need))
if anypars:
enough = ratio * 100.0 >= float(cfg.req_completion_rate())
enough = ratio * 100.0 >= (req_ratio or float(cfg.req_completion_rate()))
else:
enough = have >= need
logging.debug('Download Quality: enough=%s, have=%s, need=%s, ratio=%s', enough, have, need, ratio)
@@ -1072,15 +1128,18 @@ class NzbObject(TryList):
msg1 = T('Downloaded in %s at an average of %sB/s') % (complete_time, to_units(avg_bps*1024, dec_limit=1))
bad = self.nzo_info.get('bad_art_log', [])
miss = self.nzo_info.get('missing_art_log', [])
killed = self.nzo_info.get('killed_art_log', [])
dups = self.nzo_info.get('dup_art_log', [])
msg2 = msg3 = msg4 = ''
msg2 = msg3 = msg4 = msg5 = ''
if bad:
msg2 = ('<br/>' + T('%s articles were malformed')) % len(bad)
if miss:
msg3 = ('<br/>' + T('%s articles were missing')) % len(miss)
if dups:
msg4 = ('<br/>' + T('%s articles had non-matching duplicates')) % len(dups)
msg = ''.join((msg1, msg2, msg3, msg4,))
if killed:
msg5 = ('<br/>' + T('%s articles were removed')) % len(killed)
msg = ''.join((msg1, msg2, msg3, msg4, msg5, ))
self.set_unpack_info('Download', msg, unique=True)
if self.url:
self.set_unpack_info('Source', format_source_url(self.url), unique=True)
@@ -1354,6 +1413,12 @@ class NzbObject(TryList):
def repair_opts(self):
return self.repair, self.unpack, self.delete
def save_to_disk(self):
""" Save job's admin to disk """
self.save_attribs()
if self.nzo_id:
sabnzbd.save_data(self, self.nzo_id, self.workpath)
def save_attribs(self):
set_attrib_file(self.workpath, (self.cat, self.pp, self.script, self.priority, self.final_name_pw_clean, self.url))
@@ -1393,6 +1458,8 @@ class NzbObject(TryList):
self.pp_active = False
self.avg_stamp = time.mktime(self.avg_date.timetuple())
self.wait = None
if self.meta is None:
self.meta = {}
TryList.__init__(self)
@@ -1574,8 +1641,10 @@ def get_attrib_file(path, size):
return [None for n in xrange(size)]
for n in xrange(size):
line = f.readline().strip('\n ')
line = f.readline().strip('\r\n ')
if line:
if line.lower() == 'none':
line = None
try:
line = int(line)
except:

View File

@@ -234,6 +234,12 @@ def process_job(nzo):
nzo.save_attribs()
all_ok = False
if nzo.fail_msg: # Special case: aborted due to too many missing data
nzo.status = Status.FAILED
nzo.save_attribs()
all_ok = False
par_error = unpack_error = True
try:
# Get the folder containing the download result
@@ -241,7 +247,7 @@ def process_job(nzo):
tmp_workdir_complete = None
# if no files are present (except __admin__), fail the job
if len(globber(workdir)) < 2:
if all_ok and len(globber(workdir)) < 2:
if nzo.precheck:
enough, ratio = nzo.check_quality()
req_ratio = float(cfg.req_completion_rate()) / 100.0
@@ -272,7 +278,7 @@ def process_job(nzo):
filename, flag_repair, flag_unpack, flag_delete, script, cat)
## Par processing, if enabled
if flag_repair:
if all_ok and flag_repair:
par_error, re_add = parring(nzo, workdir)
if re_add:
# Try to get more par files
@@ -384,14 +390,17 @@ def process_job(nzo):
if not nzb_list:
## Give destination its final name
if cfg.folder_rename() and tmp_workdir_complete and not one_folder:
if not all_ok:
if all_ok:
try:
newfiles = rename_and_collapse_folder(tmp_workdir_complete, workdir_complete, newfiles)
except:
logging.error(Ta('Error renaming "%s" to "%s"'), tmp_workdir_complete, workdir_complete)
logging.info('Traceback: ', exc_info = True)
# Better disable sorting because filenames are all off now
file_sorter.sort_file = None
else:
workdir_complete = tmp_workdir_complete.replace('_UNPACK_', '_FAILED_')
workdir_complete = get_unique_path(workdir_complete, n=0, create_dir=False)
try:
collapse_folder(tmp_workdir_complete, workdir_complete)
except:
logging.error(Ta('Error renaming "%s" to "%s"'), tmp_workdir_complete, workdir_complete)
logging.info("Traceback: ", exc_info = True)
if empty:
job_result = -1
@@ -414,7 +423,7 @@ def process_job(nzo):
## Run the user script
script_path = make_script_path(script)
if all_ok and (not nzb_list) and script_path:
if (all_ok or not cfg.safe_postproc()) and (not nzb_list) and script_path:
#set the current nzo status to "Ext Script...". Used in History
nzo.status = Status.RUNNING
nzo.set_action_line(T('Running script'), unicoder(script))
@@ -437,7 +446,7 @@ def process_job(nzo):
if (not nzb_list) and cfg.email_endjob():
if (cfg.email_endjob() == 1) or (cfg.email_endjob() == 2 and (unpack_error or par_error)):
emailer.endjob(dirname, msgid, cat, all_ok, workdir_complete, nzo.bytes_downloaded,
nzo.unpack_info, script, TRANS(script_log), script_ret)
nzo.fail_msg, nzo.unpack_info, script, TRANS(script_log), script_ret)
if script_output:
# Can do this only now, otherwise it would show up in the email
@@ -464,6 +473,9 @@ def process_job(nzo):
elif all_ok and isinstance(nzo.url, str):
sabnzbd.proxy_rm_bookmark(nzo.url)
## Force error for empty result
all_ok = all_ok and not empty
## Show final status in history
if all_ok:
growler.send_notification(T('Download Completed'), filename, 'complete')
@@ -482,11 +494,9 @@ def process_job(nzo):
nzo.status = Status.FAILED
par_error = True
all_ok = False
info = nzo.unpack_info.copy()
info['fail'] = [nzo.fail_msg]
if cfg.email_endjob():
emailer.endjob(dirname, msgid, cat, all_ok, workdir_complete, nzo.bytes_downloaded,
info, '', '', 0)
nzo.fail_msg, nzo.unpack_info, '', '', 0)
if all_ok:
@@ -549,6 +559,7 @@ def parring(nzo, workdir):
re_add = False
par_error = False
single = len(repair_sets) == 1
if repair_sets:
for setname in repair_sets:
@@ -557,11 +568,14 @@ def parring(nzo, workdir):
if not verified.get(setname, False):
logging.info("Running repair on set %s", setname)
parfile_nzf = par_table[setname]
need_re_add, res = par2_repair(parfile_nzf, nzo, workdir, setname)
re_add = re_add or need_re_add
if not res and cfg.sfv_check():
res = try_sfv_check(nzo, workdir, setname)
verified[setname] = res
if os.path.exists(os.path.join(nzo.downpath, parfile_nzf.filename)) or parfile_nzf.extrapars:
need_re_add, res = par2_repair(parfile_nzf, nzo, workdir, setname, single=single)
re_add = re_add or need_re_add
if not res and not need_re_add and cfg.sfv_check():
res = try_sfv_check(nzo, workdir, setname)
verified[setname] = res
else:
continue
par_error = par_error or not res
else:
logging.info("No par2 sets for %s", filename)
@@ -741,9 +755,10 @@ def remove_samples(path):
#------------------------------------------------------------------------------
def collapse_folder(oldpath, newpath):
def rename_and_collapse_folder(oldpath, newpath, files):
""" Rename folder, collapsing when there's just a single subfolder
oldpath --> newpath OR oldpath/subfolder --> newpath
Modify list of filenames accordingly
"""
orgpath = oldpath
items = globber(oldpath)
@@ -754,11 +769,16 @@ def collapse_folder(oldpath, newpath):
logging.info('Collapsing %s', os.path.join(newpath, folder))
oldpath = folder_path
oldpath = os.path.normpath(oldpath)
newpath = os.path.normpath(newpath)
files = [os.path.normpath(f).replace(oldpath, newpath) for f in files]
renamer(oldpath, newpath)
try:
remove_dir(orgpath)
except:
pass
return files
#------------------------------------------------------------------------------

View File

@@ -84,6 +84,16 @@ def run_method():
else:
return None
def next_run(t=None):
global __RSS
if __RSS:
if t:
__RSS.next_run = t
else:
return __RSS.next_run
else:
return time.time()
def save():
global __RSS
if __RSS: __RSS.save()
@@ -159,6 +169,8 @@ class RSSQueue(object):
return False
self.jobs = {}
self.next_run = time.time()
try:
defined = config.get_rss().keys()
feeds = sabnzbd.load_admin(RSS_FILE_NAME)
@@ -348,6 +360,9 @@ class RSSQueue(object):
return unicoder(msg)
else:
entries = jobs.keys()
# Sort in the order the jobs came from the feed
entries.sort(lambda x, y: jobs[x].get('order', 0) - jobs[y].get('order', 0))
order = 0
# Filter out valid new links
@@ -485,6 +500,8 @@ class RSSQueue(object):
"""
if not sabnzbd.PAUSED_ALL:
active = False
if self.next_run < time.time():
self.next_run = time.time() + cfg.rss_rate.get() * 60
feeds = config.get_rss()
for feed in feeds.keys():
try:

View File

@@ -40,7 +40,7 @@ __SCHED = None # Global pointer to Scheduler instance
RSSTASK_MINUTE = random.randint(0, 59)
SCHEDULE_GUARD_FLAG = False
PP_PAUSE_EVENT = False
def schedule_guard():
""" Set flag for scheduler restart """
@@ -53,6 +53,8 @@ def pp_pause():
def pp_resume():
PostProcessor.do.paused = False
def pp_pause_event():
return PP_PAUSE_EVENT
def init():
""" Create the scheduler and set all required events
@@ -136,6 +138,7 @@ def init():
interval = cfg.rss_rate()
delay = random.randint(0, interval-1)
logging.debug("Scheduling RSS interval task every %s min (delay=%s)", interval, delay)
sabnzbd.rss.next_run(time.time() + delay * 60)
__SCHED.add_interval_task(rss.run_method, "RSS", delay*60, interval*60,
kronos.method.sequential, None, None)
__SCHED.add_single_task(rss.run_method, 'RSS', 15, kronos.method.sequential, None, None)
@@ -151,7 +154,7 @@ def init():
kronos.method.sequential, [], None)
if cfg.newzbin_bookmarks():
if False: #cfg.newzbin_bookmarks():
interval = cfg.bookmark_rate()
delay = random.randint(0, interval-1)
logging.debug("Scheduling Bookmark interval task every %s min (delay=%s)", interval, delay)
@@ -166,6 +169,10 @@ def init():
__SCHED.add_daytime_task(action, 'quota_reset', range(1, 8), None, (hour, minute),
kronos.method.sequential, [], None)
logging.info('Setting schedule for midnight BPS reset')
__SCHED.add_daytime_task(sabnzbd.bpsmeter.midnight_action, 'midnight_bps', range(1, 8), None, (0, 0),
kronos.method.sequential, [], None)
# Subscribe to special schedule changes
cfg.newzbin_bookmarks.callback(schedule_guard)
@@ -270,6 +277,8 @@ def sort_schedules(all_events, now=None):
def analyse(was_paused=False):
""" Determine what pause/resume state we would have now.
"""
global PP_PAUSE_EVENT
PP_PAUSE_EVENT = False
paused = None
paused_all = False
pause_post = False
@@ -287,13 +296,16 @@ def analyse(was_paused=False):
paused = True
elif action == 'pause_all':
paused_all = True
PP_PAUSE_EVENT = True
elif action == 'resume':
paused = False
paused_all = False
elif action == 'pause_post':
pause_post = True
PP_PAUSE_EVENT = True
elif action == 'resume_post':
pause_post = False
PP_PAUSE_EVENT = True
elif action == 'speedlimit' and value!=None:
speedlimit = int(ev[2])
elif action == 'enable_server':

View File

@@ -380,13 +380,14 @@ SKIN_TEXT = {
'explain-top_only' : TT('Enable for less memory usage. Disable to prevent slow jobs from blocking the queue.'),
'opt-safe_postproc' : TT('Post-Process Only Verified Jobs'),
'explain-safe_postproc' : TT('Only perform post-processing on jobs that passed all PAR2 checks.'),
'opt-pause_on_pwrar' : TT('Pause job when encrypted RAR is downloaded'),
'explain-pause_on_pwrar' : TT('You\'ll need to set a password and resume the job.'),
'opt-pause_on_pwrar' : TT('Action when encrypted RAR is downloaded'),
'explain-pause_on_pwrar' : TT('In case of "Pause", you\'ll need to set a password and resume the job.'),
'opt-no_dupes' : TT('Detect Duplicate Downloads'),
'explain-no_dupes' : TT('Detect identically named NZB files (requires NZB backup option) and duplicate titles across RSS feeds.'),
'nodupes-off' : TT('Off'), #: Three way switch for duplicates
'nodupes-ignore' : TT('Discard'), #: Three way switch for duplicates
'nodupes-pause' : TT('Pause'), #: Three way switch for duplicates
'abort' : TT('Abort'), #: Three way switch for encrypted posts
'opt-sfv_check' : TT('Enable SFV-based checks'),
'explain-sfv_check' : TT('Do an extra verification based on SFV files.'),
'opt-unpack_check' : TT('Check result of unpacking'),
@@ -458,6 +459,8 @@ SKIN_TEXT = {
'explain-max_art_tries' : TT('Maximum number of retries per server'),
'opt-max_art_opt' : TT('Only for optional servers'),
'explain-max_art_opt' : TT('Apply maximum retries only to optional servers'),
'opt-fail_hopeless' : TT('Abort jobs that cannot be completed'),
'explain-fail_hopeless' : TT('When during download it becomes clear that too much data is missing, abort the job'),
# Config->Server

View File

@@ -61,11 +61,12 @@ COUNTRY_REP = ('(US)', '(UK)', '(EU)', '(CA)', '(YU)', '(VE)', '(TR)', '(CH)', \
'(AW)', '(AR)', '(AL)', '(AF)')
_RE_ENDEXT = re.compile(r'\.%ext[{}]*$', re.I)
_RE_ENDFN = re.compile(r'%fn[{}]*$', re.I)
def endswith_ext(path):
""" Return True when path ends with '.%ext'
def ends_in_file(path):
""" Return True when path ends with '.%ext' or '%fn'
"""
return _RE_ENDEXT.search(path) is not None
return bool(_RE_ENDEXT.search(path) or _RE_ENDFN.search(path))
def move_to_parent_folder(workdir):
@@ -333,7 +334,7 @@ class SeriesSorter(object):
sorter = self.sort_string.replace('\\', '/')
mapping = []
if endswith_ext(sorter):
if ends_in_file(sorter):
extension = True
sorter = sorter.replace('.%ext', '')
else:
@@ -402,9 +403,9 @@ class SeriesSorter(object):
def to_filepath(f, current_path):
if is_full_path(f):
filepath = f.replace('_UNPACK_', '')
filepath = os.path.normpath(f)
else:
filepath = os.path.join(current_path, f)
filepath = os.path.normpath(os.path.join(current_path, f))
return filepath
# Create a generator of filepaths, ignore sample files and excluded files (vobs ect)
@@ -425,11 +426,10 @@ class SeriesSorter(object):
file, filepath, size = largest
# >20MB
if filepath and size > 20971520:
tmp, self.ext = os.path.splitext(file)
self.fname = tmp
self.fname, self.ext = os.path.splitext(os.path.split(file)[1])
newname = "%s%s" % (self.filename_set, self.ext)
# Replace %fn with the original filename
newname = newname.replace('%fn', tmp)
newname = newname.replace('%fn', self.fname)
newpath = os.path.join(current_path, newname)
# Replace %ext with extension
newpath = newpath.replace('%ext', self.ext)
@@ -440,7 +440,7 @@ class SeriesSorter(object):
except:
logging.error("Failed to rename: %s to %s", current_path, newpath)
logging.info("Traceback: ", exc_info = True)
rename_similar(current_path, self.ext, self.filename_set)
rename_similar(current_path, self.ext, self.filename_set, ())
else:
logging.debug('Current path already exists, skipping rename, %s', newpath)
else:
@@ -594,7 +594,7 @@ class GenericSorter(object):
sorter = self.sort_string.replace('\\', '/')
mapping = []
if endswith_ext(sorter):
if ends_in_file(sorter):
extension = True
sorter = sorter.replace(".%ext", '')
else:
@@ -657,9 +657,9 @@ class GenericSorter(object):
logging.debug("Renaming Generic file")
def filter_files(_file, current_path):
if is_full_path(_file):
filepath = _file.replace('_UNPACK_', '')
filepath = os.path.normpath(_file)
else:
filepath = os.path.join(current_path, _file)
filepath = os.path.normpath(os.path.join(current_path, _file))
if os.path.exists(filepath):
size = os.stat(filepath).st_size
if size >= cfg.movie_rename_limit.get_int() and not RE_SAMPLE.search(_file) \
@@ -675,14 +675,13 @@ class GenericSorter(object):
if length == 1:
file = files[0]
if is_full_path(file):
filepath = file.replace('_UNPACK_', '')
filepath = os.path.normpath(file)
else:
filepath = os.path.join(current_path, file)
filepath = os.path.normpath(os.path.join(current_path, file))
if os.path.exists(filepath):
tmp, ext = os.path.splitext(file)
self.fname = tmp
self.fname, ext = os.path.splitext(os.path.split(file)[1])
newname = "%s%s" % (self.filename_set, ext)
newname = newname.replace('%fn', tmp)
newname = newname.replace('%fn', self.fname)
newpath = os.path.join(current_path, newname)
try:
logging.debug("Rename: %s to %s", filepath, newpath)
@@ -690,7 +689,7 @@ class GenericSorter(object):
except:
logging.error(Ta('Failed to rename: %s to %s'), filepath, newpath)
logging.info("Traceback: ", exc_info = True)
rename_similar(current_path, ext, self.filename_set)
rename_similar(current_path, ext, self.filename_set, ())
## Sequence File Handling
# if there is more than one extracted file check for CD1/1/A in the title
@@ -699,12 +698,13 @@ class GenericSorter(object):
# rename files marked as in a set
if matched_files:
logging.debug("Renaming a series of generic files (%s)", matched_files)
renamed = matched_files.values()
for index, file in matched_files.iteritems():
filepath = os.path.join(current_path, file)
tmp, ext = os.path.splitext(file)
self.fname = tmp
renamed.append(filepath)
self.fname, ext = os.path.splitext(os.path.split(file)[1])
name = '%s%s' % (self.filename_set, self.extra)
name = name.replace('%1', str(index)).replace('%fn', tmp)
name = name.replace('%1', str(index)).replace('%fn', self.fname)
name = name + ext
newpath = os.path.join(current_path, name)
try:
@@ -713,7 +713,7 @@ class GenericSorter(object):
except:
logging.error(Ta('Failed to rename: %s to %s'), filepath, newpath)
logging.info("Traceback: ", exc_info = True)
rename_similar(current_path, ext, self.filename_set)
rename_similar(current_path, ext, self.filename_set, renamed)
else:
logging.debug("Movie files not in sequence %s", _files)
@@ -805,7 +805,7 @@ class DateSorter(object):
sorter = self.sort_string.replace('\\', '/')
mapping = []
if endswith_ext(sorter):
if ends_in_file(sorter):
extension = True
sorter = sorter.replace(".%ext", '')
else:
@@ -881,18 +881,17 @@ class DateSorter(object):
#find the master file to rename
for file in files:
if is_full_path(file):
filepath = file.replace('_UNPACK_', '')
filepath = os.path.normpath(file)
else:
filepath = os.path.join(current_path, file)
filepath = os.path.normpath(os.path.join(current_path, file))
if os.path.exists(filepath):
size = os.stat(filepath).st_size
if size > cfg.movie_rename_limit.get_int():
if 'sample' not in file:
tmp, ext = os.path.splitext(file)
self.fname = tmp
self.fname, ext = os.path.splitext(os.path.split(file)[1])
newname = "%s%s" % (self.filename_set, ext)
newname = newname.replace('%fn', tmp)
newname = newname.replace('%fn', self.fname)
newpath = os.path.join(current_path, newname)
if not os.path.exists(newpath):
try:
@@ -901,7 +900,7 @@ class DateSorter(object):
except:
logging.error(Ta('Failed to rename: %s to %s'), current_path, newpath)
logging.info("Traceback: ", exc_info = True)
rename_similar(current_path, ext, self.filename_set)
rename_similar(current_path, ext, self.filename_set, ())
break
@@ -1094,10 +1093,11 @@ def strip_folders(path):
return os.path.normpath('/'.join([strip_all(x) for x in f]))
def rename_similar(folder, skip_ext, name):
def rename_similar(folder, skip_ext, name, skipped_files):
""" Rename all other files in the 'folder' hierarchy after 'name'
and move them to the root of 'folder'.
Files having extension 'skip_ext' will be moved, but not renamed.
Don't touch files in list `skipped_files`
"""
logging.debug('Give files in set "%s" matching names.', name)
folder = os.path.normpath(folder)
@@ -1106,6 +1106,8 @@ def rename_similar(folder, skip_ext, name):
for root, dirs, files in os.walk(folder):
for f in files:
path = os.path.join(root, f)
if path in skipped_files:
continue
org, ext = os.path.splitext(f)
if ext.lower() == skip_ext:
# Move file, but do not rename

View File

@@ -207,13 +207,18 @@ class URLGrabber(Thread):
if res == -2:
logging.info('Incomplete NZB, retry after 5 min %s', url)
when = 300
elif res == -1:
# Error, but no reason to retry. Warning is already given
NzbQueue.do.remove(future_nzo.nzo_id, add_to_history=False)
continue
else:
logging.info('Unknown error fetching NZB, retry after 2 min %s', url)
when = 120
self.add(url, future_nzo, when)
# Check if a supported archive
else:
if dirscanner.ProcessArchiveFile(filename, fn, pp, script, cat, priority=priority, url=future_nzo.url)[0] == 0:
if dirscanner.ProcessArchiveFile(filename, fn, pp, script, cat, priority=priority,
nzbname=nzbname, url=future_nzo.url)[0] == 0:
NzbQueue.do.remove(future_nzo.nzo_id, add_to_history=False)
else:
# Not a supported filetype, not an nzb (text/html ect)
@@ -428,7 +433,7 @@ _MATRIX_MAP = {
def get_matrix_category(url, category):
category = _MATRIX_MAP.get(category, category)
if 'nzbxxx.com' in url:
if category and 'nzbxxx.com' in url:
return 'XXX: ' + category
else:
return category

View File

File diff suppressed because it is too large Load Diff

View File

@@ -30,6 +30,12 @@ else:
import sabnzbd
_JUNKFOLDERS = (
'boot', 'bootmgr', 'cache', 'msocache', 'recovery', '$recycle.bin', 'recycler',
'system volume information', 'temporary internet files', # windows specific
'.fseventd', '.spotlight', '.trashes', '.vol', 'cachedmessages', 'caches', 'trash' # osx specific
)
# this is for the drive letter code, it only works on windows
if os.name == 'nt':
from ctypes import windll
@@ -91,6 +97,7 @@ def folders_at_path(path, include_parent = False):
if doit:
file_list.append({ 'name': unicoder(filename), 'path': unicoder(fpath) })
file_list = filter(lambda entry: os.path.isdir(entry['path']), file_list)
file_list = filter(lambda entry: entry['name'].lower() not in _JUNKFOLDERS, file_list)
file_list = sorted(file_list, lambda x, y: cmp(os.path.basename(x['name']).lower(), os.path.basename(y['path']).lower()))
except:
# No access, ignore

View File

@@ -41,7 +41,7 @@ class Wizard(object):
self.__web_dir = sabnzbd.WIZARD_DIR
self.__prim = prim
self.info = {'webdir': sabnzbd.WIZARD_DIR,
'steps':4, 'version':sabnzbd.__version__,
'steps':3, 'version':sabnzbd.__version__,
'T': T}
@cherrypy.expose
@@ -162,46 +162,19 @@ class Wizard(object):
if not cfg.username() or not cfg.password():
sabnzbd.interface.set_auth(cherrypy.config)
# Create Indexers page
info = self.info.copy()
info['num'] = '&raquo; %s' % T('Step Three')
info['number'] = 3
info['newzbin_user'] = cfg.newzbin_username()
info['newzbin_pass'] = cfg.newzbin_password.get_stars()
info['newzbin_bookmarks'] = cfg.newzbin_bookmarks()
info['newzbin_url'] = cfg.newzbin_url()
info['matrix_user'] = cfg.matrix_username()
info['matrix_apikey'] = cfg.matrix_apikey()
info['T'] = Ttemplate
template = Template(file=os.path.join(self.__web_dir, 'three.html'),
searchList=[info], compilerSettings=sabnzbd.interface.DIRECTIVES)
return template.respond()
@cherrypy.expose
def four(self, **kwargs):
""" Accept Indexers and show Restart screen """
if kwargs:
if 'newzbin_user' in kwargs and 'newzbin_pass' in kwargs:
cfg.newzbin_username.set(kwargs.get('newzbin_user',''))
cfg.newzbin_password.set(kwargs.get('newzbin_pass',''))
cfg.newzbin_bookmarks.set(kwargs.get('newzbin_bookmarks', '0'))
if 'matrix_user' in kwargs and 'matrix_apikey' in kwargs:
cfg.matrix_username.set(kwargs.get('matrix_user',''))
cfg.matrix_apikey.set(kwargs.get('matrix_apikey',''))
config.save_config()
# Show Restart screen
info = self.info.copy()
info['num'] = '&raquo; %s' % T('Step Four')
info['number'] = 4
info['num'] = '&raquo; %s' % T('Step Three')
info['number'] = 3
info['helpuri'] = 'http://wiki.sabnzbd.org/'
info['session'] = cfg.api_key()
info['access_url'], info['urls'] = self.get_access_info()
info['T'] = Ttemplate
template = Template(file=os.path.join(self.__web_dir, 'four.html'),
template = Template(file=os.path.join(self.__web_dir, 'three.html'),
searchList=[info], compilerSettings=sabnzbd.interface.DIRECTIVES)
return template.respond()

View File

Binary file not shown.

View File

Binary file not shown.