Commit 59a4bc38 authored by echel0n's avatar echel0n
Browse files

Merge branch 'release/9.1.45'

parents 4af84d36 b0b92016
# Changelog
- * b77506b - 2017-10-17: Release v9.1.44
- * 828a89c - 2017-10-18: Release v9.1.45
- * 71563bd - 2017-10-18: Fixed source url for login page logo
- * d41ddae - 2017-10-18: Fixed source url for login page logo
- * ccdac84 - 2017-10-18: Fixed issue #69 - Torrent snatched but not added to qBittorrent
- * 44b2225 - 2017-10-18: Refactored qBittorent
- * 59f9fbc - 2017-10-17: Release v9.1.44
- * 08fdbad - 2017-10-17: Fixed issue with log_dir attrib missing
- * 25f71bf - 2017-10-17: Release v9.1.43
- * e62bc4e - 2017-10-17: Fixed TemplateLookupException issues
......
......@@ -329,7 +329,7 @@ class GenericClient(object):
r_code = self._add_torrent_file(result)
if not r_code:
sickrage.srCore.srLogger.error(self.name + ': Unable to send Torrent')
sickrage.srCore.srLogger.warning(self.name + ': Unable to send Torrent')
return False
if not self._set_torrent_pause(result):
......
......@@ -18,8 +18,6 @@
from __future__ import unicode_literals
from requests.auth import HTTPDigestAuth
import sickrage
from sickrage.clients import GenericClient
......@@ -29,48 +27,85 @@ class qbittorrentAPI(GenericClient):
super(qbittorrentAPI, self).__init__('qbittorrent', host, username, password)
self.url = self.host
def _get_auth(self):
@property
def api(self):
"""Get API version."""
try:
self.response = sickrage.srCore.srWebSession.get(self.host,
auth=HTTPDigestAuth(self.username, self.password),
verify=bool(sickrage.srCore.srConfig.TORRENT_VERIFY_CERT))
self.auth = self.response.text
self.url = '{}version/api'.format(self.host)
version = int(sickrage.srCore.srWebSession.get(self.url,
verify=sickrage.srCore.srConfig.TORRENT_VERIFY_CERT).content)
except Exception:
return None
version = 1
return self.auth if self.response.ok else None
return version
def _add_torrent_uri(self, result):
def _get_auth(self):
if self.api > 1:
self.url = '{host}login'.format(host=self.host)
data = {
'username': self.username,
'password': self.password,
}
try:
self.response = sickrage.srCore.srWebSession.post(self.url, data=data)
except Exception:
return None
else:
try:
self.response = sickrage.srCore.srWebSession.get(self.host,
verify=sickrage.srCore.srConfig.TORRENT_VERIFY_CERT)
self.auth = self.response.content
except Exception:
return None
sickrage.srCore.srWebSession.cookies = self.response.cookies
self.auth = self.response.content
return self.auth if not self.response.status_code == 404 else None
def _set_torrent_label(self, result):
label = sickrage.srCore.srConfig.TORRENT_LABEL
if result.show.is_anime:
label = sickrage.srCore.srConfig.TORRENT_LABEL_ANIME
if self.api > 6 and label:
label_key = 'Category' if self.api >= 10 else 'Label'
self.url = '{}command/set{}'.format(self.host, label_key)
data = {
'hashes': result.hash.lower(),
label_key.lower(): label.replace(' ', '_'),
}
return self._request(method='post', data=data, cookies=sickrage.srCore.srWebSession.cookies)
return True
self.url = self.host + 'command/download'
def _add_torrent_uri(self, result):
self.url = '{}command/download'.format(self.host)
data = {'urls': result.url}
return self._request(method='post', data=data)
return self._request(method='post', data=data, cookies=sickrage.srCore.srWebSession.cookies)
def _add_torrent_file(self, result):
self.url = self.host + 'command/upload'
files = {'torrents': (result.name + '.torrent', result.content)}
return self._request(method='post', files=files)
self.url = '{}command/upload'.format(self.host)
files = {'torrents': ('{}.torrent'.format(result.name), result.content)}
return self._request(method='post', files=files, cookies=sickrage.srCore.srWebSession.cookies)
def _set_torrent_priority(self, result):
self.url = self.host + 'command/decreasePrio '
if result.priority == 1:
self.url = self.host + 'command/increasePrio'
self.url = '{}command/{}Prio'.format(self.host, 'increase' if result.priority == 1 else 'decrease')
data = {'hashes': result.hash}
return self._request(method='post', data=data)
return self._request(method='post', data=data, cookies=sickrage.srCore.srWebSession.cookies)
def _set_torrent_pause(self, result):
self.url = self.host + 'command/resume'
if sickrage.srCore.srConfig.TORRENT_PAUSED:
self.url = self.host + 'command/pause'
self.url = '{}command/{}'.format(self.host, 'pause' if sickrage.srCore.srConfig.TORRENT_PAUSED else 'resume')
data = {'hash': result.hash}
return self._request(method='post', data=data)
return self._request(method='post', data=data, cookies=sickrage.srCore.srWebSession.cookies)
def remove_torrent(self, info_hash):
self.url = '{}command/deletePerm'.format(self.host)
data = {
'hashes': info_hash.lower(),
}
return self._request(method='post', data=data, cookies=sickrage.srCore.srWebSession.cookies)
api = qbittorrentAPI()
......@@ -885,7 +885,7 @@
<div class="row field-pair" id="torrent_label_anime_option">
<div class="col-lg-3 col-md-4 col-sm-5 col-xs-12">
<label class="component-title">${_('Add label to torrent')}</label>
<label class="component-title">${_('Add anime label to torrent')}</label>
</div>
<div class="col-lg-9 col-md-8 col-sm-7 col-xs-12 component-desc">
<div class="input-group input350">
......
......@@ -6,7 +6,7 @@
<form action="" method="post">
<div class="row">
<div class="col-md-12" align="center">
<img src="../static/images/login.png" />
<img src="${srWebRoot}/images/login.png" />
</div>
</div>
<div class="row">
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -2,8 +2,8 @@ msgid ""
msgstr ""
"Project-Id-Version: sickragetv\n"
"Report-Msgid-Bugs-To: [email protected]\n"
"POT-Creation-Date: 2017-10-17 23:36-0400\n"
"PO-Revision-Date: 2017-10-17 23:36-0400\n"
"POT-Creation-Date: 2017-10-18 11:16-0400\n"
"PO-Revision-Date: 2017-10-18 11:17-0400\n"
"Last-Translator: echel0n <[email protected]>\n"
"Language-Team: Arabic\n"
"MIME-Version: 1.0\n"
......@@ -1309,7 +1309,7 @@ msgstr "دير ريال ذاكرة التخزين المؤقت:"
#: sickrage/core/webserver/views/config/index.mako:78
msgid "SR Log File:"
msgstr ""
msgstr "ملف سجل ريال:"
#: sickrage/core/webserver/views/config/index.mako:87
msgid "SR Arguments:"
......@@ -4027,7 +4027,6 @@ msgid "Client password"
msgstr "كلمة مرور العميل"
#: sickrage/core/webserver/views/config/search.mako:870
#: sickrage/core/webserver/views/config/search.mako:888
msgid "Add label to torrent"
msgstr "إضافة تسمية إلى سيل"
......@@ -4036,6 +4035,10 @@ msgstr "إضافة تسمية إلى سيل"
msgid "blank spaces are not allowed"
msgstr "غير مسموح بالفراغات"
#: sickrage/core/webserver/views/config/search.mako:888
msgid "Add anime label to torrent"
msgstr ""
#: sickrage/core/webserver/views/config/search.mako:906
msgid "Downloaded files location"
msgstr "موقع الملفات التي تم تنزيلها"
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -2,8 +2,8 @@ msgid ""
msgstr ""
"Project-Id-Version: sickragetv\n"
"Report-Msgid-Bugs-To: [email protected]\n"
"POT-Creation-Date: 2017-10-17 23:36-0400\n"
"PO-Revision-Date: 2017-10-17 23:36-0400\n"
"POT-Creation-Date: 2017-10-18 11:16-0400\n"
"PO-Revision-Date: 2017-10-18 11:17-0400\n"
"Last-Translator: echel0n <[email protected]>\n"
"Language-Team: Catalan\n"
"MIME-Version: 1.0\n"
......@@ -1309,7 +1309,7 @@ msgstr "Dir SR memòria cau:"
#: sickrage/core/webserver/views/config/index.mako:78
msgid "SR Log File:"
msgstr ""
msgstr "Fitxer de registre SR:"
#: sickrage/core/webserver/views/config/index.mako:87
msgid "SR Arguments:"
......@@ -4027,7 +4027,6 @@ msgid "Client password"
msgstr "Contrasenya de client"
#: sickrage/core/webserver/views/config/search.mako:870
#: sickrage/core/webserver/views/config/search.mako:888
msgid "Add label to torrent"
msgstr "Afegir etiqueta a torrent"
......@@ -4036,6 +4035,10 @@ msgstr "Afegir etiqueta a torrent"
msgid "blank spaces are not allowed"
msgstr "no es permeten els espais en blanc"
#: sickrage/core/webserver/views/config/search.mako:888
msgid "Add anime label to torrent"
msgstr ""
#: sickrage/core/webserver/views/config/search.mako:906
msgid "Downloaded files location"
msgstr "Ubicació arxius descarregats"
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -2,8 +2,8 @@ msgid ""
msgstr ""
"Project-Id-Version: sickragetv\n"
"Report-Msgid-Bugs-To: [email protected]\n"
"POT-Creation-Date: 2017-10-17 23:36-0400\n"
"PO-Revision-Date: 2017-10-17 23:36-0400\n"
"POT-Creation-Date: 2017-10-18 11:16-0400\n"
"PO-Revision-Date: 2017-10-18 11:17-0400\n"
"Last-Translator: echel0n <[email protected]>\n"
"Language-Team: Czech\n"
"MIME-Version: 1.0\n"
......@@ -1309,7 +1309,7 @@ msgstr "SR Cache adresář:"
#: sickrage/core/webserver/views/config/index.mako:78
msgid "SR Log File:"
msgstr ""
msgstr "Soubor protokolu SR:"
#: sickrage/core/webserver/views/config/index.mako:87
msgid "SR Arguments:"
......@@ -4027,7 +4027,6 @@ msgid "Client password"
msgstr "Heslo klienta"
#: sickrage/core/webserver/views/config/search.mako:870
#: sickrage/core/webserver/views/config/search.mako:888
msgid "Add label to torrent"
msgstr "Přidat popisek k torrentu"
......@@ -4036,6 +4035,10 @@ msgstr "Přidat popisek k torrentu"
msgid "blank spaces are not allowed"
msgstr "mezery nejsou povoleny"
#: sickrage/core/webserver/views/config/search.mako:888
msgid "Add anime label to torrent"
msgstr ""
#: sickrage/core/webserver/views/config/search.mako:906
msgid "Downloaded files location"
msgstr "Umístění stažených souborů"
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -2,8 +2,8 @@ msgid ""
msgstr ""
"Project-Id-Version: sickragetv\n"
"Report-Msgid-Bugs-To: [email protected]\n"
"POT-Creation-Date: 2017-10-17 23:36-0400\n"
"PO-Revision-Date: 2017-10-17 23:36-0400\n"
"POT-Creation-Date: 2017-10-18 11:16-0400\n"
"PO-Revision-Date: 2017-10-18 11:17-0400\n"
"Last-Translator: echel0n <[email protected]>\n"
"Language-Team: Danish\n"
"MIME-Version: 1.0\n"
......@@ -1309,7 +1309,7 @@ msgstr "SR Cache Dir:"
#: sickrage/core/webserver/views/config/index.mako:78
msgid "SR Log File:"
msgstr ""
msgstr "SR logfilen:"
#: sickrage/core/webserver/views/config/index.mako:87
msgid "SR Arguments:"
......@@ -4027,7 +4027,6 @@ msgid "Client password"
msgstr "Klient password"
#: sickrage/core/webserver/views/config/search.mako:870
#: sickrage/core/webserver/views/config/search.mako:888
msgid "Add label to torrent"
msgstr "Føje etiketter til torrent"
......@@ -4036,6 +4035,10 @@ msgstr "Føje etiketter til torrent"
msgid "blank spaces are not allowed"
msgstr "blanktegn er ikke tilladt"
#: sickrage/core/webserver/views/config/search.mako:888
msgid "Add anime label to torrent"
msgstr ""
#: sickrage/core/webserver/views/config/search.mako:906
msgid "Downloaded files location"
msgstr "Downloadede filer placering"
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -2,8 +2,8 @@ msgid ""
msgstr ""
"Project-Id-Version: sickragetv\n"
"Report-Msgid-Bugs-To: [email protected]\n"
"POT-Creation-Date: 2017-10-17 23:36-0400\n"
"PO-Revision-Date: 2017-10-17 23:36-0400\n"
"POT-Creation-Date: 2017-10-18 11:16-0400\n"
"PO-Revision-Date: 2017-10-18 11:17-0400\n"
"Last-Translator: echel0n <[email protected]>\n"
"Language-Team: German\n"
"MIME-Version: 1.0\n"
......@@ -1309,7 +1309,7 @@ msgstr "SR-Cache R:"
#: sickrage/core/webserver/views/config/index.mako:78
msgid "SR Log File:"
msgstr ""
msgstr "SR-Log-Datei:"
#: sickrage/core/webserver/views/config/index.mako:87
msgid "SR Arguments:"
......@@ -4027,7 +4027,6 @@ msgid "Client password"
msgstr "Kunden-Kennwort"
#: sickrage/core/webserver/views/config/search.mako:870
#: sickrage/core/webserver/views/config/search.mako:888
msgid "Add label to torrent"
msgstr "Torrent Bezeichnung hinzufügen"
......@@ -4036,6 +4035,10 @@ msgstr "Torrent Bezeichnung hinzufügen"
msgid "blank spaces are not allowed"
msgstr "Leerzeichen sind nicht erlaubt"
#: sickrage/core/webserver/views/config/search.mako:888
msgid "Add anime label to torrent"
msgstr ""
#: sickrage/core/webserver/views/config/search.mako:906
msgid "Downloaded files location"
msgstr "Speicherort der heruntergeladenen Dateien"
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment