mirror of
https://github.com/sabnzbd/sabnzbd.git
synced 2026-01-06 14:39:41 -05:00
Compare commits
97 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
bc9be3f92b | ||
|
|
2dc5c329c9 | ||
|
|
67817978f4 | ||
|
|
e2ab8c6ce4 | ||
|
|
f33a952536 | ||
|
|
cc582b5321 | ||
|
|
bdc526c91b | ||
|
|
52039c29b4 | ||
|
|
1dc4175f82 | ||
|
|
92f70fc177 | ||
|
|
fd573208bd | ||
|
|
ca9f10c12f | ||
|
|
49a72d0902 | ||
|
|
6aafe3c531 | ||
|
|
9e84696f96 | ||
|
|
120c133d7a | ||
|
|
cf9713a4b0 | ||
|
|
d12e9889e7 | ||
|
|
711a546989 | ||
|
|
7f78e6fac1 | ||
|
|
72533eefa4 | ||
|
|
d9643d9ea8 | ||
|
|
2de71bb96c | ||
|
|
07be241112 | ||
|
|
fbdd264653 | ||
|
|
a8bc793132 | ||
|
|
6bce423f23 | ||
|
|
51cabf85a1 | ||
|
|
38fdc2c7c8 | ||
|
|
b91a2af9df | ||
|
|
71ee5969a8 | ||
|
|
1b1c772b55 | ||
|
|
458eb3a417 | ||
|
|
98b753f015 | ||
|
|
a3284e12d2 | ||
|
|
c85120bb4b | ||
|
|
903925e06b | ||
|
|
03196f25e4 | ||
|
|
e3f3f962b6 | ||
|
|
153f92e697 | ||
|
|
c1dcafe953 | ||
|
|
b53d97732b | ||
|
|
8f47cce9c8 | ||
|
|
3cf42a7f94 | ||
|
|
ae74370cfb | ||
|
|
2aaa283991 | ||
|
|
dca7a8ccdb | ||
|
|
3172d6e987 | ||
|
|
c237ddfef4 | ||
|
|
b543dcb5ac | ||
|
|
ccfbb07333 | ||
|
|
256ccbd6a1 | ||
|
|
d8d507f110 | ||
|
|
7b3309649f | ||
|
|
9a7a6652e8 | ||
|
|
db4891748f | ||
|
|
3dce2e8908 | ||
|
|
c91291c315 | ||
|
|
a2a5a1f8e4 | ||
|
|
7651f709ad | ||
|
|
a565077348 | ||
|
|
6cf99e7d3a | ||
|
|
f730a82005 | ||
|
|
5449607c1d | ||
|
|
c62415abfd | ||
|
|
dcbea3057c | ||
|
|
91642d16c8 | ||
|
|
2f2773149d | ||
|
|
adaba03f50 | ||
|
|
58a5e09540 | ||
|
|
20dc906095 | ||
|
|
e2f41d3761 | ||
|
|
ab1372c7fc | ||
|
|
e305678cf4 | ||
|
|
a82df9bf2e | ||
|
|
986604f27c | ||
|
|
59324c7453 | ||
|
|
91613a5b37 | ||
|
|
5ca05fd2c0 | ||
|
|
4d4045cff4 | ||
|
|
1f209a42d8 | ||
|
|
bffbb362db | ||
|
|
435eed8818 | ||
|
|
f86656543a | ||
|
|
9c510c6dd1 | ||
|
|
f81ab3d1c0 | ||
|
|
d1585c28a9 | ||
|
|
9c314532c0 | ||
|
|
853bda5d86 | ||
|
|
d05e31f7f0 | ||
|
|
383354871d | ||
|
|
2086a217e0 | ||
|
|
34f3574746 | ||
|
|
1dfe0b957e | ||
|
|
17d14bc3b4 | ||
|
|
885032e436 | ||
|
|
ceee95aaf7 |
@@ -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,
|
||||
|
||||
@@ -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
|
||||
-------------------------------------------------------------------------------
|
||||
|
||||
@@ -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:
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
4
PKG-INFO
4
PKG-INFO
@@ -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
|
||||
|
||||
21
README.mkd
21
README.mkd
@@ -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
|
||||
|
||||
19
SABnzbd.py
19
SABnzbd.py
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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>
|
||||
<!--#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/>
|
||||
|
||||
|
||||
@@ -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> |
|
||||
|
||||
@@ -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" >
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
</table>
|
||||
</div>
|
||||
<div class="padding alt">
|
||||
<h5 class="copyright">Copyright © 2008-2012 The SABnzbd Team <<span style="color: #0000ff;">team@sabnzbd.org</span>></h5>
|
||||
<h5 class="copyright">Copyright © 2008-2013 The SABnzbd Team <<span style="color: #0000ff;">team@sabnzbd.org</span>></h5>
|
||||
<p class="copyright"><small>$T('yourRights')</small></p>
|
||||
</div>
|
||||
<!--#if $news_items#-->
|
||||
|
||||
@@ -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">
|
||||
|
||||
@@ -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"> </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" />
|
||||
|
||||
@@ -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"> $T('Next scan at:') $rss_next</span>
|
||||
<span class="desc narrow">$T('explain-rss_rate')</span>
|
||||
</div>
|
||||
</fieldset>
|
||||
|
||||
@@ -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 -->
|
||||
|
||||
@@ -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">
|
||||
|
||||
@@ -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/">
|
||||
|
||||
@@ -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 <team@sabnzbd.org></small></p>
|
||||
<p><small>Copyright (C) 2008-2013, The SABnzbd Team <team@sabnzbd.org></small></p>
|
||||
<p><small>$T('yourRights')</small></p>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -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"> </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"> </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"> </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> </h3>
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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('—');
|
||||
$('#stats_speed').html('—');
|
||||
$('#time-left').attr('title','—'); // Tooltip on "time left"
|
||||
|
||||
@@ -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; }
|
||||
|
||||
@@ -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>
|
||||
<!--#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/>
|
||||
|
||||
@@ -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')">
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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"#-->
|
||||
@@ -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" />
|
||||
|
||||
@@ -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="‹ $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') »" /></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"#-->
|
||||
@@ -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))
|
||||
|
||||
BIN
osx/unrar/unrar
BIN
osx/unrar/unrar
Binary file not shown.
25
package.py
25
package.py
@@ -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) )
|
||||
|
||||
|
||||
@@ -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"
|
||||
|
||||
1345
po/main/SABnzbd.pot
1345
po/main/SABnzbd.pot
File diff suppressed because it is too large
Load Diff
1366
po/main/da.po
1366
po/main/da.po
File diff suppressed because it is too large
Load Diff
1362
po/main/de.po
1362
po/main/de.po
File diff suppressed because it is too large
Load Diff
1375
po/main/es.po
1375
po/main/es.po
File diff suppressed because it is too large
Load Diff
1369
po/main/fr.po
1369
po/main/fr.po
File diff suppressed because it is too large
Load Diff
1352
po/main/nb.po
1352
po/main/nb.po
File diff suppressed because it is too large
Load Diff
1372
po/main/nl.po
1372
po/main/nl.po
File diff suppressed because it is too large
Load Diff
1362
po/main/pl.px
1362
po/main/pl.px
File diff suppressed because it is too large
Load Diff
1372
po/main/pt_BR.po
1372
po/main/pt_BR.po
File diff suppressed because it is too large
Load Diff
1362
po/main/ro.px
1362
po/main/ro.px
File diff suppressed because it is too large
Load Diff
1374
po/main/sv.po
1374
po/main/sv.po
File diff suppressed because it is too large
Load Diff
@@ -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"
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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 """
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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]:
|
||||
|
||||
@@ -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')
|
||||
|
||||
|
||||
@@ -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):
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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':
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -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
|
||||
|
||||
@@ -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'] = '» %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'] = '» %s' % T('Step Four')
|
||||
info['number'] = 4
|
||||
info['num'] = '» %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()
|
||||
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user