Compare commits
221 Commits
Author | SHA1 | Date |
---|---|---|
|
1df2943d05 | 11 years ago |
|
543eeae124 | 11 years ago |
|
8ed2f7a175 | 11 years ago |
|
074c78ce31 | 11 years ago |
|
01b93ce8eb | 11 years ago |
|
ff42913359 | 11 years ago |
|
9b3dcb0bda | 11 years ago |
|
a9cfff0ce3 | 11 years ago |
|
ca4db6b428 | 11 years ago |
|
f986f649d2 | 11 years ago |
|
48b47535b6 | 11 years ago |
|
194fbce7ae | 11 years ago |
|
17ae4d9974 | 11 years ago |
|
cdaf7ae973 | 11 years ago |
|
1390a17950 | 11 years ago |
|
852b0e3cc2 | 11 years ago |
|
d3715e0ab9 | 11 years ago |
|
8d28d8f000 | 11 years ago |
|
1a3dd15609 | 11 years ago |
|
ad58dde0e0 | 11 years ago |
|
da317d9054 | 11 years ago |
|
9e344114d6 | 11 years ago |
|
2cc73c8ad1 | 11 years ago |
|
efe473b4d7 | 11 years ago |
|
f9e02458e7 | 11 years ago |
|
07d8ceb284 | 11 years ago |
|
fc141b6cb6 | 11 years ago |
|
4b31bea0e3 | 11 years ago |
|
44b1b6ca2e | 11 years ago |
|
8da8b62446 | 11 years ago |
|
dc03414659 | 11 years ago |
|
be7222de8f | 11 years ago |
|
0f64495d25 | 11 years ago |
|
9f82347e72 | 11 years ago |
|
f22b26ba09 | 11 years ago |
|
f9081afe80 | 11 years ago |
|
4904ff4bd9 | 11 years ago |
|
8c2eda4e4b | 11 years ago |
|
5591127a0e | 11 years ago |
|
823ec4fad8 | 11 years ago |
|
661dc33912 | 11 years ago |
|
28370c826a | 11 years ago |
|
12086a247f | 11 years ago |
|
f53c25ccc5 | 11 years ago |
|
04d31bd807 | 11 years ago |
|
433711bdc6 | 11 years ago |
|
376428d12d | 11 years ago |
|
8969b7c87e | 11 years ago |
|
92bc48c241 | 11 years ago |
|
d85708c5f5 | 11 years ago |
|
fa4eaf3e42 | 11 years ago |
|
8b788551bb | 11 years ago |
|
db58025e96 | 11 years ago |
|
9ec397d6a0 | 11 years ago |
|
dc3fe36d8a | 11 years ago |
|
d809b13936 | 11 years ago |
|
c1607c6bf2 | 11 years ago |
|
0ff3c5978c | 11 years ago |
|
c1d283f299 | 11 years ago |
|
04637c2c74 | 11 years ago |
|
3a3eeba429 | 11 years ago |
|
1404175ac8 | 11 years ago |
|
081010d50b | 11 years ago |
|
1591954472 | 11 years ago |
|
c2a2b61e15 | 11 years ago |
|
4b6c469831 | 11 years ago |
|
2d10f879da | 11 years ago |
|
c2043c6b83 | 11 years ago |
|
b3a637d29c | 11 years ago |
|
67395f0c19 | 11 years ago |
|
55f0eccb88 | 11 years ago |
|
e293a669d2 | 11 years ago |
|
26b79513c6 | 11 years ago |
|
fa1ef47341 | 11 years ago |
|
746be02899 | 11 years ago |
|
9a4fdd4582 | 11 years ago |
|
c76f01b54b | 11 years ago |
|
0849039bb4 | 11 years ago |
|
a79d1173de | 11 years ago |
|
2eeb6cd9c5 | 11 years ago |
|
7571f146fa | 11 years ago |
|
6753ed031d | 11 years ago |
|
f4dd7d0df4 | 11 years ago |
|
e5e9b37bf8 | 11 years ago |
|
460841ae36 | 11 years ago |
|
565d8bec8a | 11 years ago |
|
4bf057b0a9 | 11 years ago |
|
081da0a0fc | 11 years ago |
|
7fe125fd7e | 11 years ago |
|
9669580ea7 | 11 years ago |
|
27cc3f9be5 | 11 years ago |
|
57084ab6d1 | 11 years ago |
|
56d0e2957b | 11 years ago |
|
08ffaedaca | 11 years ago |
|
3c3d6dbb4b | 11 years ago |
|
a66ffc61fd | 11 years ago |
|
7e04cb019d | 11 years ago |
|
802c9cfab6 | 11 years ago |
|
987a64d3a4 | 11 years ago |
|
ea90e9e153 | 11 years ago |
|
ace1ef5498 | 11 years ago |
|
d2926dcbac | 11 years ago |
|
5d4f8c2459 | 11 years ago |
|
e2790cbaa9 | 11 years ago |
|
1441eea5ae | 11 years ago |
|
db4ecfc59c | 11 years ago |
|
4a69dea144 | 11 years ago |
|
3f790a5048 | 11 years ago |
|
470c1fc13e | 11 years ago |
|
6faeb578a7 | 11 years ago |
|
44383deb33 | 11 years ago |
|
80fccd92ec | 11 years ago |
|
666e115032 | 11 years ago |
|
048c36c107 | 11 years ago |
|
de86ba7496 | 11 years ago |
|
a58d070aaf | 11 years ago |
|
30ed8a2d30 | 11 years ago |
|
c503e3078f | 11 years ago |
|
3d74d879a9 | 11 years ago |
|
ae0268eb3c | 11 years ago |
|
d6eb1ffbe0 | 11 years ago |
|
d88b3a76a5 | 11 years ago |
|
a6a68b9b67 | 11 years ago |
|
182bce40a7 | 11 years ago |
|
5072f55d6e | 11 years ago |
|
dc2d4ffb85 | 11 years ago |
|
22f2e0881e | 11 years ago |
|
614510c00b | 11 years ago |
|
ee32bb5419 | 11 years ago |
|
99eb16b504 | 11 years ago |
|
2da71a9fa2 | 11 years ago |
|
9cc9e0eaea | 11 years ago |
|
2d92069a3c | 11 years ago |
|
a0cfc19682 | 11 years ago |
|
d87cd33523 | 11 years ago |
|
63186c671b | 11 years ago |
|
3d3d8f1535 | 11 years ago |
|
a90754149b | 11 years ago |
|
ad6a896e46 | 11 years ago |
|
f4e0559894 | 11 years ago |
|
e517b67faf | 11 years ago |
|
bbb2b27157 | 11 years ago |
|
0b1f9dfe14 | 11 years ago |
|
e7bd7ae0d3 | 11 years ago |
|
8a4579d2ec | 12 years ago |
|
0adf5ef93d | 11 years ago |
|
fdacbeaa4d | 11 years ago |
|
f5ecf3df05 | 11 years ago |
|
eae644d8f6 | 11 years ago |
|
406f18d6bb | 11 years ago |
|
bf04f950c3 | 11 years ago |
|
e90ff0eeb7 | 11 years ago |
|
35381555a9 | 12 years ago |
|
4bf956f4ff | 12 years ago |
|
ddfe8653f4 | 12 years ago |
|
0066b9f11e | 12 years ago |
|
c897b2252d | 12 years ago |
|
2aadcd032d | 12 years ago |
|
23e9bf112e | 12 years ago |
|
9b577df408 | 12 years ago |
|
e6d75b45ae | 12 years ago |
|
f68de5df4c | 12 years ago |
|
8bda8efa2f | 12 years ago |
|
62792f859b | 12 years ago |
|
79fa42f90f | 12 years ago |
|
acb3ed2c77 | 12 years ago |
|
50f411fb0b | 12 years ago |
|
38c13bc4f0 | 12 years ago |
|
7a7bf0f4e4 | 12 years ago |
|
4d1b02fa64 | 12 years ago |
|
612e68b5e6 | 12 years ago |
|
9645f947b8 | 12 years ago |
|
c211969a81 | 12 years ago |
|
86916cdf90 | 12 years ago |
|
fa3e0f941b | 12 years ago |
|
32c524c18d | 12 years ago |
|
7ba1a4c20f | 12 years ago |
|
3b3759e81e | 12 years ago |
|
ba3aaab3dc | 12 years ago |
|
30ec3c430d | 12 years ago |
|
dac568fc35 | 12 years ago |
|
1ee00e12ce | 12 years ago |
|
15ae1ae5fd | 12 years ago |
|
14f39a21e3 | 12 years ago |
|
97ea4ee2eb | 12 years ago |
|
c68fa9f0c5 | 12 years ago |
|
06576baf5c | 12 years ago |
|
7b5fcbe0af | 12 years ago |
|
003ee07dee | 12 years ago |
|
654b5e9a24 | 12 years ago |
|
1b05bc9ed2 | 12 years ago |
|
dc328c545b | 12 years ago |
|
823816ddc4 | 12 years ago |
|
8979598f23 | 12 years ago |
|
f26bf9b21f | 12 years ago |
|
5d3a0cc593 | 12 years ago |
|
21d445b7a6 | 12 years ago |
|
9c0df30d34 | 12 years ago |
|
bc9be3f92b | 12 years ago |
|
2dc5c329c9 | 12 years ago |
|
67817978f4 | 12 years ago |
|
e2ab8c6ce4 | 12 years ago |
|
f33a952536 | 12 years ago |
|
cc582b5321 | 12 years ago |
|
bdc526c91b | 12 years ago |
|
52039c29b4 | 12 years ago |
|
1dc4175f82 | 12 years ago |
|
92f70fc177 | 12 years ago |
|
fd573208bd | 12 years ago |
|
ca9f10c12f | 12 years ago |
|
49a72d0902 | 12 years ago |
|
6aafe3c531 | 12 years ago |
|
9e84696f96 | 12 years ago |
|
120c133d7a | 12 years ago |
|
cf9713a4b0 | 12 years ago |
|
d12e9889e7 | 12 years ago |
|
711a546989 | 12 years ago |
|
7f78e6fac1 | 12 years ago |
|
72533eefa4 | 12 years ago |
|
d9643d9ea8 | 12 years ago |
|
2de71bb96c | 12 years ago |
112 changed files with 19325 additions and 10445 deletions
@ -0,0 +1,18 @@ |
|||
FROM ubuntu:14.04 |
|||
|
|||
MAINTAINER Johannes 'fish' Ziemke <docker@freigeist.org> @discordianfish |
|||
|
|||
RUN echo deb http://archive.ubuntu.com/ubuntu/ trusty multiverse >> \ |
|||
/etc/apt/sources.list |
|||
RUN apt-get -qy update && apt-get -qy install python python-cheetah unrar \ |
|||
unzip python-yenc par2 |
|||
|
|||
RUN useradd sabnzbd -d /sab -m && chown -R sabnzbd:sabnzbd /sab |
|||
VOLUME /sab |
|||
ADD . /sabnzbd |
|||
|
|||
EXPOSE 8080 |
|||
USER sabnzbd |
|||
ENV HOME /sab |
|||
|
|||
ENTRYPOINT [ "python", "/sabnzbd/SABnzbd.py", "-s", "0.0.0.0:8080" ] |
File diff suppressed because one or more lines are too long
After Width: | Height: | Size: 319 B |
After Width: | Height: | Size: 286 B |
After Width: | Height: | Size: 347 B |
After Width: | Height: | Size: 341 B |
After Width: | Height: | Size: 752 B |
@ -0,0 +1,98 @@ |
|||
.rateit { |
|||
display: -moz-inline-box; |
|||
display: inline-block; |
|||
position: relative; |
|||
-webkit-user-select: none; |
|||
-khtml-user-select: none; |
|||
-moz-user-select: none; |
|||
-o-user-select: none; |
|||
-ms-user-select: none; |
|||
user-select: none; |
|||
-webkit-touch-callout: none; |
|||
} |
|||
|
|||
.rateit .rateit-range |
|||
{ |
|||
position: relative; |
|||
display: -moz-inline-box; |
|||
display: inline-block; |
|||
background: url(star.gif); |
|||
height: 16px; |
|||
outline: none; |
|||
} |
|||
|
|||
.rateit .rateit-range * { |
|||
display:block; |
|||
} |
|||
|
|||
/* for IE 6 */ |
|||
* html .rateit, * html .rateit .rateit-range |
|||
{ |
|||
display: inline; |
|||
} |
|||
|
|||
/* for IE 7 */ |
|||
* + html .rateit, * + html .rateit .rateit-range |
|||
{ |
|||
display: inline; |
|||
} |
|||
|
|||
.rateit .rateit-hover, .rateit .rateit-selected |
|||
{ |
|||
position: absolute; |
|||
left: 0px; |
|||
} |
|||
|
|||
.rateit .rateit-hover-rtl, .rateit .rateit-selected-rtl |
|||
{ |
|||
left: auto; |
|||
right: 0px; |
|||
} |
|||
|
|||
.rateit .rateit-hover |
|||
{ |
|||
background: url(star.gif) left -32px; |
|||
} |
|||
|
|||
.rateit .rateit-hover-rtl |
|||
{ |
|||
background-position: right -32px; |
|||
} |
|||
|
|||
.rateit .rateit-selected |
|||
{ |
|||
background: url(star.gif) left -48px; |
|||
} |
|||
|
|||
.rateit .rateit-selected-rtl |
|||
{ |
|||
background-position: right -48px; |
|||
} |
|||
|
|||
.rateit .rateit-preset |
|||
{ |
|||
background: url(star.gif) left -16px; |
|||
} |
|||
|
|||
.rateit .rateit-preset-rtl |
|||
{ |
|||
background: url(star.gif) left -16px; |
|||
} |
|||
|
|||
.rateit button.rateit-reset |
|||
{ |
|||
background: url(delete.gif) 0 0; |
|||
width: 16px; |
|||
height: 16px; |
|||
display: -moz-inline-box; |
|||
display: inline-block; |
|||
float: left; |
|||
outline: none; |
|||
border:none; |
|||
padding: 0; |
|||
} |
|||
|
|||
.rateit button.rateit-reset:hover, .rateit button.rateit-reset:focus |
|||
{ |
|||
background-position: 0 -16px; |
|||
} |
After Width: | Height: | Size: 2.4 KiB |
@ -0,0 +1,34 @@ |
|||
<!--#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,34 +1,38 @@ |
|||
<!--#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> |
|||
<form action="./four" method="post" autocomplete="off"> |
|||
<div class="indented bigger"> |
|||
<h3>Indexer</h3> |
|||
<div>$T('explain-rating_enable')</div> |
|||
<div>$T('wizard-create-account')<a href="https://www.oznzb.com/register" target="_blank">https://www.oznzb.com/register</a>.</div> |
|||
<br class="clear" /> |
|||
<input type="checkbox" name="rating_enable" id="rating_enable" value="1" <!--#if $rating_enable == 1 then 'checked="checked"' else ''#-->> <label for="rating_enable">$T('opt-rating_enable')</label><br /> |
|||
<br class="clear" /> |
|||
<div> |
|||
<label class="label">$T('opt-rating_api_key')</label><input type="text" size="35" value="$rating_api_key" name="rating_api_key" id="rating_api_key"> |
|||
<div class="tips">$T('tip-rating_api_key')</div> |
|||
</div> |
|||
<br class="clear" /> |
|||
</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> |
|||
<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> |
|||
</table> |
|||
</div> |
|||
|
|||
<!--#include $webdir + "/inc_bottom.tmpl"#--> |
|||
</form> |
|||
<!--#include $webdir + "/inc_bottom.tmpl"#--> |
|||
|
@ -0,0 +1,30 @@ |
|||
The Backport of OrderedDict() is coming from ActiveState's Python recipe website. |
|||
It has been written by Raymond Hettinger. |
|||
|
|||
|
|||
Home of the module: |
|||
http://code.activestate.com/recipes/576693-ordered-dictionary-for-py24/ |
|||
|
|||
It is covered by the MIT License. |
|||
=================== |
|||
(c) 2009 Raymond Hettinger |
|||
|
|||
Permission is hereby granted, free of charge, to any person obtaining |
|||
a copy of this software and associated documentation files (the |
|||
"Software"), to deal in the Software without restriction, including |
|||
without limitation the rights to use, copy, modify, merge, publish, |
|||
distribute, sublicense, and/or sell copies of the Software, and to |
|||
permit persons to whom the Software is furnished to do so, subject to |
|||
the following conditions: |
|||
|
|||
The above copyright notice and this permission notice shall be |
|||
included in all copies or substantial portions of the Software. |
|||
|
|||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, |
|||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF |
|||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND |
|||
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE |
|||
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION |
|||
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION |
|||
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
|||
|
@ -0,0 +1,3 @@ |
|||
pystone.py and msgfmt.py have been copied from the Python sourcecode. |
|||
They are covered by the same license as Python itself, |
|||
that license is contained in the file "License_Python.txt". |
Binary file not shown.
Binary file not shown.
@ -0,0 +1,212 @@ |
|||
# Finnish translation for sabnzbd |
|||
# Copyright (c) 2011 Rosetta Contributors and Canonical Ltd 2011 |
|||
# This file is distributed under the same license as the sabnzbd package. |
|||
# FIRST AUTHOR <EMAIL@ADDRESS>, 2011. |
|||
# |
|||
msgid "" |
|||
msgstr "" |
|||
"Project-Id-Version: sabnzbd\n" |
|||
"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n" |
|||
"POT-Creation-Date: 2013-12-10 20:31+0000\n" |
|||
"PO-Revision-Date: 2013-02-19 15:28+0000\n" |
|||
"Last-Translator: Matti Ylönen <Unknown>\n" |
|||
"Language-Team: Finnish <fi@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: 2013-12-11 06:16+0000\n" |
|||
"X-Generator: Launchpad (build 16869)\n" |
|||
|
|||
#: email/email.tmpl:1 |
|||
msgid "" |
|||
"##\n" |
|||
"## Default 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 has <!--#if $status then \"completed\" else \"failed\" #--> " |
|||
"job $name\n" |
|||
"X-priority: 5\n" |
|||
"X-MS-priority: 5\n" |
|||
"## After this comes the body, the empty line is required!\n" |
|||
"\n" |
|||
"Hi,\n" |
|||
"<!--#if $status #-->\n" |
|||
"SABnzbd has downloaded \"$name\" <!--#if $msgid==\"\" then \"\" else " |
|||
"\"(newzbin #\" + $msgid + \")\"#-->\n" |
|||
"<!--#else#-->\n" |
|||
"SABnzbd has failed to download \"$name\" <!--#if $msgid==\"\" then \"\" else " |
|||
"\"(newzbin #\" + $msgid + \")\"#-->\n" |
|||
"<!--#end if#-->\n" |
|||
"Finished at $end_time\n" |
|||
"Downloaded $size\n" |
|||
"\n" |
|||
"Results of the job:\n" |
|||
"<!--#for $stage in $stages #-->\n" |
|||
"Stage $stage <!--#slurp#-->\n" |
|||
"<!--#for $result in $stages[$stage]#-->\n" |
|||
" $result <!--#slurp#-->\n" |
|||
"<!--#end for#-->\n" |
|||
"<!--#end for#-->\n" |
|||
"<!--#if $script!=\"\" #-->\n" |
|||
"Output from user script \"$script\" (Exit code = $script_ret):\n" |
|||
"$script_output\n" |
|||
"<!--#end if#-->\n" |
|||
"<!--#if $status #-->\n" |
|||
"Enjoy!\n" |
|||
"<!--#else#-->\n" |
|||
"Sorry!\n" |
|||
"<!--#end if#-->\n" |
|||
msgstr "" |
|||
"##\n" |
|||
"## Oletus sähköpostipohja SABnzbd:lle\n" |
|||
"## Tämä on Cheetah pohja\n" |
|||
"## Dokumentaatio: http://sabnzbd.wikidot.com/email-templates\n" |
|||
"##\n" |
|||
"## Rivinvaihdot ja välilyönnit ovat merkitseviä!\n" |
|||
"##\n" |
|||
"## Nämä ovat otsaketiedot. Rivien ensimmäisiä sanoja ei saa vaihtaa!\n" |
|||
"To: $to\n" |
|||
"From: $from\n" |
|||
"Date: $date\n" |
|||
"Subject: SABnzbd on <!--#if $status then \"valmistunut\" else " |
|||
"\"epäonnistunut\" #--> työssä $name\n" |
|||
"X-priority: 5\n" |
|||
"X-MS-priority: 5\n" |
|||
"## Tämän jälkeen tulee viestin runko, ensimmäinen rivinvaihto on " |
|||
"pakollinen!\n" |
|||
"\n" |
|||
"Hei,\n" |
|||
"<!--#if $status #-->\n" |
|||
"SABnzbd on ladannut \"$name\" <!--#if $msgid==\"\" then \"\" else \"(newzbin " |
|||
"#\" + $msgid + \")\"#-->\n" |
|||
"<!--#else#-->\n" |
|||
"SABnzbd on epäonnistunut \"$name\" <!--#if $msgid==\"\" then \"\" else " |
|||
"\"(newzbin #\" + $msgid + \")\"#--> latauksessa\n" |
|||
"<!--#end if#-->\n" |
|||
"Valmistui $end_time\n" |
|||
"Ladattu $size\n" |
|||
"\n" |
|||
"Työn lopputulos:\n" |
|||
"<!--#for $stage in $stages #-->\n" |
|||
"Tila $stage <!--#slurp#-->\n" |
|||
"<!--#for $result in $stages[$stage]#-->\n" |
|||
" $result <!--#slurp#-->\n" |
|||
"<!--#end for#-->\n" |
|||
"<!--#end for#-->\n" |
|||
"<!--#if $script!=\"\" #-->\n" |
|||
"Käyttäjän skriptin tuloste \"$script\" (Exit code = $script_ret):\n" |
|||
"$script_output\n" |
|||
"<!--#end if#-->\n" |
|||
"<!--#if $status #-->\n" |
|||
"Nauti!\n" |
|||
"<!--#else#-->\n" |
|||
"Pahoittelut!\n" |
|||
"<!--#end if#-->\n" |
|||
|
|||
#: email/rss.tmpl:1 |
|||
msgid "" |
|||
"##\n" |
|||
"## RSS 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 has added $amount jobs to the queue\n" |
|||
"X-priority: 5\n" |
|||
"X-MS-priority: 5\n" |
|||
"## After this comes the body, the empty line is required!\n" |
|||
"\n" |
|||
"Hi,\n" |
|||
"\n" |
|||
"SABnzbd has added $amount job(s) to the queue.\n" |
|||
"They are from RSS feed \"$feed\".\n" |
|||
"<!--#for $job in $jobs#-->\n" |
|||
" $job <!--#slurp#-->\n" |
|||
"<!--#end for#-->\n" |
|||
"\n" |
|||
"Bye\n" |
|||
msgstr "" |
|||
"##\n" |
|||
"## RSS sähköpostipohja SABnzbd:lle\n" |
|||
"## Tämä on Cheetah pohja\n" |
|||
"## Dokumentaatio: http://sabnzbd.wikidot.com/email-templates\n" |
|||
"##\n" |
|||
"## Rivinvaihdot ja välilyönnit ovat merkitseviä!\n" |
|||
"##\n" |
|||
"## Nämä ovat otsaketiedot. Rivien ensimmäisiä sanoja ei saa vaihtaa!\n" |
|||
"To: $to\n" |
|||
"From: $from\n" |
|||
"Date: $date\n" |
|||
"Subject: SABnzbd on lisännyt $amount työtä jonoon\n" |
|||
"X-priority: 5\n" |
|||
"X-MS-priority: 5\n" |
|||
"## Tämän jälkeen tulee viestin runko, ensimmäinen rivinvaihto on " |
|||
"pakollinen!\n" |
|||
"\n" |
|||
"Hei,\n" |
|||
"\n" |
|||
"SABnzbd on lisännyt $amount työtä jonoon.\n" |
|||
"Ne ovat RSS syötteestä \"$feed\".\n" |
|||
"<!--#for $job in $jobs#-->\n" |
|||
" $job <!--#slurp#-->\n" |
|||
"<!--#end for#-->\n" |
|||
"\n" |
|||
"Heippa\n" |
|||
|
|||
#: email/badfetch.tmpl:1 |
|||
msgid "" |
|||
"##\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 failed to fetch an NZB\n" |
|||
"X-priority: 5\n" |
|||
"X-MS-priority: 5\n" |
|||
"## After this comes the body, the empty line is required!\n" |
|||
"\n" |
|||
"Hi,\n" |
|||
"\n" |
|||
"SABnzbd has failed to retrieve the NZB from $url.\n" |
|||
"The error message was: $msg\n" |
|||
"\n" |
|||
"Bye\n" |
|||
msgstr "" |
|||
"##\n" |
|||
"## Virheellisen URL-noudon sähköpostin pohja SABnzbd ohjelmalle\n" |
|||
"## Tämä on Cheetah pohja\n" |
|||
"## Dokumentaatio: http://sabnzbd.wikidot.com/email-templates\n" |
|||
"##\n" |
|||
"## Rivinvaihdot ja välilyönnit ovat merkitseviä!\n" |
|||
"##\n" |
|||
"## Tässä on sähköpostin otsikkotiedot\n" |
|||
"To: $to\n" |
|||
"From: $from\n" |
|||
"Date: $date\n" |
|||
"Subject: SABnzbd ei voinut hakea NZB tiedostoa\n" |
|||
"X-priority: 5\n" |
|||
"X-MS-priority: 5\n" |
|||
"## Tämän jälkeen tulee viestin sisältö, tyhjä rivi on pakollinen!\n" |
|||
"\n" |
|||
"Hei,\n" |
|||
"\n" |
|||
"SABnzbd ei voinut hakea NZB tiedostoa osoitteesta $url.\n" |
|||
"Virheviesti: $msg\n" |
File diff suppressed because it is too large
File diff suppressed because it is too large
File diff suppressed because it is too large
File diff suppressed because it is too large
File diff suppressed because it is too large
File diff suppressed because it is too large
File diff suppressed because it is too large
File diff suppressed because it is too large
File diff suppressed because it is too large
File diff suppressed because it is too large
File diff suppressed because it is too large
File diff suppressed because it is too large
@ -0,0 +1,116 @@ |
|||
# Finnish translation for sabnzbd |
|||
# Copyright (c) 2011 Rosetta Contributors and Canonical Ltd 2011 |
|||
# This file is distributed under the same license as the sabnzbd package. |
|||
# FIRST AUTHOR <EMAIL@ADDRESS>, 2011. |
|||
# |
|||
msgid "" |
|||
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: 2013-02-19 15:24+0000\n" |
|||
"Last-Translator: Matti Ylönen <Unknown>\n" |
|||
"Language-Team: Finnish <fi@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: 2013-02-20 05:14+0000\n" |
|||
"X-Generator: Launchpad (build 16491)\n" |
|||
|
|||
#: NSIS_Installer.nsi:425 |
|||
msgid "Go to the SABnzbd Wiki" |
|||
msgstr "Siirry SABnzbd wikiin" |
|||
|
|||
#: NSIS_Installer.nsi:427 |
|||
msgid "Show Release Notes" |
|||
msgstr "Näytä julkaisutiedot" |
|||
|
|||
#: NSIS_Installer.nsi:429 |
|||
msgid "Support the project, Donate!" |
|||
msgstr "Tue projektia, lahjoita!" |
|||
|
|||
#: NSIS_Installer.nsi:431 |
|||
msgid "Please close \"SABnzbd.exe\" first" |
|||
msgstr "Ole hyvä ja sulje \"SABnzbd.exe\" ensin" |
|||
|
|||
#: NSIS_Installer.nsi:433 |
|||
msgid "" |
|||
" >>>> WARNING <<<<\\r\\n\\r\\nPlease, first check the " |
|||
"release notes or go to http://wiki.sabnzbd.org/introducing-0-7-0 !" |
|||
msgstr "" |
|||
" >>>> VAROITUS <<<<\\r\\n\\r\\nOle hyvä ja tarkista " |
|||
"julkaisutiedot tai käy osoitteessa http://wiki.sabnzbd.org/introducing-0-7-0 " |
|||
"!" |
|||
|
|||
#: NSIS_Installer.nsi:435 |
|||
msgid "This will uninstall SABnzbd from your system" |
|||
msgstr "Tämä poistaa SABnzbd:n tietokoneestasi" |
|||
|
|||
#: NSIS_Installer.nsi:437 |
|||
msgid "Run at startup" |
|||
msgstr "Suorita käynnistyksen yhteydessä" |
|||
|
|||
#: NSIS_Installer.nsi:439 |
|||
msgid "Desktop Icon" |
|||
msgstr "Työpöydän kuvake" |
|||
|
|||
#: NSIS_Installer.nsi:441 |
|||
msgid "NZB File association" |
|||
msgstr "NZB tiedostosidos" |
|||
|
|||
#: NSIS_Installer.nsi:443 |
|||
msgid "Delete Program" |
|||
msgstr "Poista sovellus" |
|||
|
|||
#: NSIS_Installer.nsi:445 |
|||
msgid "Delete Settings" |
|||
msgstr "Poista asetukset" |
|||
|
|||
#: 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 "" |
|||
"Tämä järjestelmä vaatii, että Microsoft runtime kirjasto VC90 täytyy asentaa " |
|||
"ensin. Haluatko asentaa sen nyt?" |
|||
|
|||
#: NSIS_Installer.nsi:449 |
|||
msgid "Downloading Microsoft runtime installer..." |
|||
msgstr "Ladataan Microsoft runtime asennusta..." |
|||
|
|||
#: NSIS_Installer.nsi:451 |
|||
msgid "Download error, retry?" |
|||
msgstr "Latausvirhe, yritä uudelleen?" |
|||
|
|||
#: NSIS_Installer.nsi:453 |
|||
msgid "Cannot install without runtime library, retry?" |
|||
msgstr "Ei voida asentaa ilman runtime kirjastoa, yritä uudelleen?" |
|||
|
|||
#: NSIS_Installer.nsi:455 |
|||
msgid "" |
|||
"You cannot overwrite an existing installation. \\n\\nClick `OK` to remove " |
|||
"the previous version or `Cancel` to cancel this upgrade." |
|||
msgstr "" |
|||
"Et voi asentaa tätä vanhan asennuksen päälle. \\n\\nPaina `OK` poistaaksesi " |
|||
"edellisen version tai paina `Peruuta` peruuttaaksesi tämän päivityksen." |
|||
|
|||
#: NSIS_Installer.nsi:457 |
|||
msgid "Your settings and data will be preserved." |
|||
msgstr "Asetuksiasi ja tietojasi ei poisteta." |
|||
|
|||
#~ msgid "" |
|||
#~ " >>>> WARNING <<<<\\r\\n\\r\\nPlease, first check the " |
|||
#~ "release notes or go to http://wiki.sabnzbd.org/introducing-0-6-0 !" |
|||
#~ msgstr "" |
|||
#~ " >>>> VAROITUS <<<<\\r\\n\\r\\nOle hyvä ja tarkista " |
|||
#~ "julkaisutiedot tai mene osoitteeseen http://wiki.sabnzbd.org/introducing-0-6-" |
|||
#~ "0 !" |
|||
|
|||
#~ msgid "Start SABnzbd (hidden)" |
|||
#~ msgstr "Aloita SABnzbd (piilotettuna)" |
|||
|
|||
#~ msgid "Delete Cache" |
|||
#~ msgstr "Poista välimuisti" |
|||
|
|||
#~ msgid "Delete Logs" |
|||
#~ msgstr "Poista lokit" |
@ -0,0 +1,285 @@ |
|||
#!/usr/bin/python -OO |
|||
# Copyright 2008-2012 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 |
|||
# as published by the Free Software Foundation; either version 2 |
|||
# of the License, or (at your option) any later version. |
|||
# |
|||
# This program is distributed in the hope that it will be useful, |
|||
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
# GNU General Public License for more details. |
|||
# |
|||
# You should have received a copy of the GNU General Public License |
|||
# along with this program; if not, write to the Free Software |
|||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
|||
|
|||
""" |
|||
sabnzbd.rating - Rating support functions |
|||
""" |
|||
|
|||
import httplib |
|||
import urllib |
|||
import time |
|||
import logging |
|||
import copy |
|||
import socket |
|||
try: |
|||
socket.ssl |
|||
_HAVE_SSL = True |
|||
except: |
|||
_HAVE_SSL = False |
|||
from threading import * |
|||
|
|||
import sabnzbd |
|||
from sabnzbd.decorators import synchronized |
|||
from sabnzbd.misc import OrderedSetQueue |
|||
import sabnzbd.cfg as cfg |
|||
|
|||
RATING_URL = "/releaseRatings/releaseRatings.php" |
|||
RATING_LOCK = RLock() |
|||
|
|||
_g_warnings = 0 |
|||
def _warn(msg): |
|||
global _g_warnings |
|||
_g_warnings += 1 |
|||
if _g_warnings < 3: |
|||
logging.warning(msg) |
|||
|
|||
def _reset_warn(): |
|||
global _g_warnings |
|||
_g_warnings = 0 |
|||
|
|||
class NzbRating(object): |
|||
def __init__(self): |
|||
self.avg_video = 0 |
|||
self.avg_video_cnt = 0 |
|||
self.avg_audio = 0 |
|||
self.avg_audio_cnt = 0 |
|||
self.avg_vote_up = 0 |
|||
self.avg_vote_down = 0 |
|||
self.user_video = None |
|||
self.user_audio = None |
|||
self.user_vote = None |
|||
self.user_flag = {} |
|||
self.auto_flag = {} |
|||
self.changed = 0 |
|||
|
|||
class NzbRatingV2(NzbRating): |
|||
def __init__(self): |
|||
super(NzbRatingV2, self).__init__() |
|||
self.avg_spam_cnt = 0 |
|||
self.avg_spam_confirm = False |
|||
self.avg_encrypted_cnt = 0 |
|||
self.avg_encrypted_confirm = False |
|||
|
|||
def to_v2(self, rating): |
|||
self.__dict__.update(rating.__dict__) |
|||
return self |
|||
|
|||
class Rating(Thread): |
|||
VERSION = 2 |
|||
|
|||
VOTE_UP = 1 |
|||
VOTE_DOWN = 2 |
|||
|
|||
FLAG_OK = 0 |
|||
FLAG_SPAM = 1 |
|||
FLAG_ENCRYPTED = 2 |
|||
FLAG_EXPIRED = 3 |
|||
FLAG_OTHER = 4 |
|||
FLAG_COMMENT = 5 |
|||
|
|||
CHANGED_USER_VIDEO = 0x01 |
|||
CHANGED_USER_AUDIO = 0x02 |
|||
CHANGED_USER_VOTE = 0x04 |
|||
CHANGED_USER_FLAG = 0x08 |
|||
CHANGED_AUTO_FLAG = 0x10 |
|||
|
|||
do = None |
|||
|
|||
def __init__(self): |
|||
Rating.do = self |
|||
self.shutdown = False |
|||
self.queue = OrderedSetQueue() |
|||
try: |
|||
(self.version, self.ratings, self.nzo_indexer_map) = sabnzbd.load_admin("Rating.sab") |
|||
if self.version == 1: |
|||
ratings = {} |
|||
for k, v in self.ratings.iteritems(): |
|||
ratings[k] = NzbRatingV2().to_v2(v) |
|||
self.ratings = ratings |
|||
self.version = 2 |
|||
if (self.version != Rating.VERSION): |
|||
raise Exception() |
|||
except: |
|||
self.version = Rating.VERSION |
|||
self.ratings = {} |
|||
self.nzo_indexer_map = {} |
|||
Thread.__init__(self) |
|||
if not _HAVE_SSL: |
|||
logging.warning('Ratings server requires secure connection') |
|||
self.stop() |
|||
|
|||
def stop(self): |
|||
self.shutdown = True |
|||
self.queue.put(None) # Unblock queue |
|||
|
|||
def run(self): |
|||
self.shutdown = False |
|||
while not self.shutdown: |
|||
time.sleep(1) |
|||
if not cfg.rating_enable(): continue |
|||
indexer_id = self.queue.get() |
|||
try: |
|||
if indexer_id and not self._send_rating(indexer_id): |
|||
for i in range(0, 60): |
|||
if self.shutdown: break |
|||
time.sleep(1) |
|||
self.queue.put(indexer_id) |
|||
except: |
|||
pass |
|||
logging.debug('Stopping ratings') |
|||
|
|||
@synchronized(RATING_LOCK) |
|||
def save(self): |
|||
if self.ratings and self.nzo_indexer_map: |
|||
sabnzbd.save_admin((self.version, self.ratings, self.nzo_indexer_map), "Rating.sab") |
|||
|
|||
# The same file may be uploaded multiple times creating a new nzo_id each time |
|||
@synchronized(RATING_LOCK) |
|||
def add_rating(self, indexer_id, nzo_id, host, fields): |
|||
if indexer_id and nzo_id and (len(fields) == 10): |
|||
logging.debug('Add rating (%s, %s: %s, %s, %s, %s)', indexer_id, nzo_id, fields['video'], fields['audio'], fields['voteup'], fields['votedown']) |
|||
try: |
|||
rating = self.ratings.get(indexer_id, NzbRatingV2()) |
|||
if fields['video'] and fields['videocnt']: |
|||
rating.avg_video = int(float(fields['video'])) |
|||
rating.avg_video_cnt = int(float(fields['videocnt'])) |
|||
if fields['audio'] and fields['audiocnt']: |
|||
rating.avg_audio = int(float(fields['audio'])) |
|||
rating.avg_audio_cnt = int(float(fields['audiocnt'])) |
|||
if fields['voteup']: rating.avg_vote_up = int(float(fields['voteup'])) |
|||
if fields['votedown']: rating.avg_vote_down = int(float(fields['votedown'])) |
|||
if fields['spam']: rating.avg_spam_cnt = int(float(fields['spam'])) |
|||
if fields['confirmed-spam']: rating.avg_spam_confirm = (fields['confirmed-spam'].lower() == 'yes') |
|||
if fields['passworded']: rating.avg_encrypted_cnt = int(float(fields['passworded'])) |
|||
if fields['confirmed-passworded']: rating.avg_encrypted_confirm = (fields['confirmed-passworded'].lower() == 'yes') |
|||
rating.host = host[0] if host and isinstance(host, list) else host |
|||
self.ratings[indexer_id] = rating |
|||
self.nzo_indexer_map[nzo_id] = indexer_id |
|||
except: |
|||
pass |
|||
|
|||
@synchronized(RATING_LOCK) |
|||
def update_user_rating(self, nzo_id, video, audio, vote, flag, flag_detail = None): |
|||
logging.debug('Updating user rating (%s: %s, %s, %s, %s)', nzo_id, video, audio, vote, flag) |
|||
if nzo_id not in self.nzo_indexer_map: |
|||
logging.warning('indexer id (%s) not found for ratings file', nzo_id) |
|||
return |
|||
indexer_id = self.nzo_indexer_map[nzo_id] |
|||
rating = self.ratings[indexer_id] |
|||
if video: |
|||
rating.user_video = int(video) |
|||
rating.avg_video = int((rating.avg_video_cnt * rating.avg_video + rating.user_video) / (rating.avg_video_cnt + 1)) |
|||
rating.changed = rating.changed | Rating.CHANGED_USER_VIDEO |
|||
if audio: |
|||
rating.user_audio = int(audio) |
|||
rating.avg_audio = int((rating.avg_audio_cnt * rating.avg_audio + rating.user_audio) / (rating.avg_audio_cnt + 1)) |
|||
rating.changed = rating.changed | Rating.CHANGED_USER_AUDIO |
|||
if flag: |
|||
rating.user_flag = { 'val': int(flag), 'detail': flag_detail } |
|||
rating.changed = rating.changed | Rating.CHANGED_USER_FLAG |
|||
if vote and not rating.user_vote: |
|||
rating.user_vote = int(vote) |
|||
rating.changed = rating.changed | Rating.CHANGED_USER_VOTE |
|||
if rating.user_vote == Rating.VOTE_UP: |
|||
rating.avg_vote_up += 1 |
|||
else: |
|||
rating.avg_vote_down += 1 |
|||
self.queue.put(indexer_id) |
|||
|
|||
@synchronized(RATING_LOCK) |
|||
def update_auto_flag(self, nzo_id, flag, flag_detail = None): |
|||
if not flag or not cfg.rating_enable() or not cfg.rating_feedback() or (nzo_id not in self.nzo_indexer_map): |
|||
return |
|||
logging.debug('Updating auto flag (%s: %s)', nzo_id, flag) |
|||
indexer_id = self.nzo_indexer_map[nzo_id] |
|||
rating = self.ratings[indexer_id] |
|||
rating.auto_flag = { 'val': int(flag), 'detail': flag_detail } |
|||
rating.changed = rating.changed | Rating.CHANGED_AUTO_FLAG |
|||
self.queue.put(indexer_id) |
|||
|
|||
@synchronized(RATING_LOCK) |
|||
def get_rating_by_nzo(self, nzo_id): |
|||
if nzo_id not in self.nzo_indexer_map: |
|||
return None |
|||
return copy.copy(self.ratings[self.nzo_indexer_map[nzo_id]]) |
|||
|
|||
@synchronized(RATING_LOCK) |
|||
def _get_rating_by_indexer(self, indexer_id): |
|||
return copy.copy(self.ratings[indexer_id]) |
|||
|
|||
def _flag_request(self, val, flag_detail, auto): |
|||
if val == Rating.FLAG_SPAM: |
|||
return {'m': 'rs', 'auto': auto} |
|||
if val == Rating.FLAG_ENCRYPTED: |
|||
return {'m': 'rp', 'auto': auto} |
|||
if val == Rating.FLAG_EXPIRED: |
|||
expired_host = flag_detail if flag_detail and len(flag_detail) > 0 else 'Other' |
|||
return {'m': 'rpr', 'pr': expired_host, 'auto': auto} |
|||
if (val == Rating.FLAG_OTHER) and flag_detail and len(flag_detail) > 0: |
|||
return {'m': 'o', 'r': flag_detail} |
|||
if (val == Rating.FLAG_COMMENT) and flag_detail and len(flag_detail) > 0: |
|||
return {'m': 'rc', 'r': flag_detail} |
|||
|
|||
def _send_rating(self, indexer_id): |
|||
logging.debug('Updating indexer rating (%s)', indexer_id) |
|||
|
|||
api_key = cfg.rating_api_key() |
|||
rating_host = cfg.rating_host() |
|||
if not api_key: |
|||
return True |
|||
|
|||
requests = [] |
|||
_headers = {'User-agent' : 'SABnzbd+/%s' % sabnzbd.version.__version__, 'Content-type': 'application/x-www-form-urlencoded'} |
|||
rating = self._get_rating_by_indexer(indexer_id) # Requesting info here ensures always have latest information even on retry |
|||
if hasattr(rating, 'host') and rating.host: |
|||
rating_host = rating.host |
|||
if not rating_host: |
|||
return True |
|||
if rating.changed & Rating.CHANGED_USER_VIDEO: |
|||
requests.append({'m': 'r', 'r': 'videoQuality', 'rn': rating.user_video}) |
|||
if rating.changed & Rating.CHANGED_USER_AUDIO: |
|||
requests.append({'m': 'r', 'r': 'audioQuality', 'rn': rating.user_audio}) |
|||
if rating.changed & Rating.CHANGED_USER_VOTE: |
|||
up_down = 'up' if rating.user_vote == Rating.VOTE_UP else 'down' |
|||
requests.append({'m': 'v', 'v': up_down, 'r': 'overall'}) |
|||
if rating.changed & Rating.CHANGED_USER_FLAG: |
|||
requests.append(self._flag_request(rating.user_flag.get('val'), rating.user_flag.get('detail'), 0)) |
|||
if rating.changed & Rating.CHANGED_AUTO_FLAG: |
|||
requests.append(self._flag_request(rating.auto_flag.get('val'), rating.auto_flag.get('detail'), 1)) |
|||
|
|||
try: |
|||
conn = httplib.HTTPSConnection(rating_host) |
|||
for request in filter(lambda r: r is not None, requests): |
|||
request['apikey'] = api_key |
|||
request['i'] = indexer_id |
|||
conn.request('POST', RATING_URL, urllib.urlencode(request), headers = _headers) |
|||
|
|||
response = conn.getresponse() |
|||
response.read() |
|||
if response.status == httplib.UNAUTHORIZED: |
|||
_warn('Ratings server unauthorized user') |
|||
return False |
|||
elif response.status != httplib.OK: |
|||
_warn('Ratings server failed to process request (%s, %s)' % (response.status, response.reason)) |
|||
return False |
|||
|
|||
self.ratings[indexer_id].changed = self.ratings[indexer_id].changed & ~rating.changed |
|||
_reset_warn() |
|||
return True |
|||
except: |
|||
_warn('Problem accessing ratings server: %s' % rating_host) |
|||
return False |
Some files were not shown because too many files changed in this diff
Loading…
Reference in new issue