Commit 4e4a780b authored by echel0n's avatar echel0n

Stabilizing master branch

Version bumped 6.0.45
parent 07e336e8
# SR Travis-CI Files #
######################
/.travis.yml
/.travis
.travis.yml
.travis
# SR Markdown Files #
######################
/contributing.md
/README.md
/README.txt
contributing.md
readme.md
# SR User Related #
######################
/*.db*
/*.ini
/cache/
/Logs/
/data/
/restore/
/backup*/
/autoProcessTV.cfg
/server.crt
/server.key
*.db*
*.ini
autoProcessTV.cfg
server.crt
server.key
cache
Logs
data
restore
backup*
# SR Test Related #
######################
/tests/*.db*
/tests/*.ini
/tests/show name/
/tests/Logs/
/tests/cache/
/tests/data/
/tests/restore/
/tests/backup*/
/tests/server.crt
/tests/server.key
# Compiled source #
######################
......@@ -56,9 +46,9 @@ Session.vim
*.ipr
.settings/*
.pypirc
/dist
/build
/sickrage.egg-info
dist
build
sickrage.egg-info
# OS generated files #
######################
......
......@@ -23,12 +23,13 @@ It watches for new episodes of your favorite shows, and when they are posted it
- Real SSL certificate validation
- Supports Anime shows
#### Dependencies
To run SickRage from source you will need Python 2.7.10
#### Installation
$ pip install sickrage
$ sickrage
#### Important
Before using this with your existing database (sickrage.db) please make a backup copy of it and delete any other
database files such as cache.db and failed.db if present.
Before using this with your existing database (sickrage.db or sickbeard.db) please make a backup copy of it and delete
any other database files such as cache.db and failed.db if present.
We HIGHLY recommend starting out with no database files at all to make this a fresh start but the choice is at your own
risk.
\ No newline at end of file
......@@ -20,6 +20,6 @@
from __future__ import print_function, unicode_literals
from __init__ import main
if __name__ == '__main__':
main()
import sickrage
sickrage.main()
......@@ -20,6 +20,6 @@
from __future__ import print_function, unicode_literals
from __init__ import main
if __name__ == '__main__':
main()
\ No newline at end of file
import sickrage
sickrage.main()
### Questions about SickRage?
To get your questions answered, please ask on the [SickRage Forum](http://sickrage.tv/), or [#sickrage](http://webchat.freenode.net/?channels=sickrage) IRC channel on irc.freenode.net
To get your questions answered, please ask on the [SickRage Forum](http://www.sickrage.tv/), or [#sickrage](http://webchat.freenode.net/?channels=sickrage) IRC channel on irc.freenode.net
# Contributing to SickRage
......@@ -11,7 +11,7 @@ To get your questions answered, please ask on the [SickRage Forum](http://sickra
## Getting Involved
There are a number of ways to get involved with the development of SickRage. Even if you've never contributed code to an Open Source project before, we're always looking for help identifying bugs, cleaning up code, writing documentation and testing.
There are a number of ways to get involved with the development of sickrage.srCore.CONFIG. Even if you've never contributed code to an Open Source project before, we're always looking for help identifying bugs, cleaning up code, writing documentation and testing.
The goal of this guide is to provide the best way to contribute to the official SickRage repository. Please read through the full guide detailing [How to Report Bugs](#how-to-report-bugs).
......@@ -19,7 +19,7 @@ The goal of this guide is to provide the best way to contribute to the official
### Forum and IRC
The SickRage development team frequently tracks posts on the [SickRage Forum](http://sickrage.tv/). If you have longer posts or questions please feel free to post them there. If you think you've found a bug please [file it in the bug tracker](#how-to-report-bugs).
The SickRage development team frequently tracks posts on the [SickRage Forum](http://www.sickrage.tv/). If you have longer posts or questions please feel free to post them there. If you think you've found a bug please [file it in the bug tracker](#how-to-report-bugs).
Additionally most of the SickRage development team can be found in the [#sickrage](http://webchat.freenode.net/?channels=sickrage) IRC channel on irc.freenode.net.
......@@ -30,7 +30,7 @@ Additionally most of the SickRage development team can be found in the [#sickrag
Many bugs reported are actually issues with the user mis-understanding of how something works (there are a bit of moving parts to an ideal setup) and most of the time can be fixed by just changing some settings to fit the users needs.
If you are new to SickRage, it is usually a much better idea to ask for help first in the [Using SickRage Forum](http://sickrage.tv) or the [SickRage IRC channel](http://webchat.freenode.net/?channels=sickrage). You will get much quicker support, and you will help avoid tying up the SickRage team with invalid bug reports.
If you are new to SickRage, it is usually a much better idea to ask for help first in the [Using SickRage Forum](http://www.sickrage.tv) or the [SickRage IRC channel](http://webchat.freenode.net/?channels=sickrage). You will get much quicker support, and you will help avoid tying up the SickRage team with invalid bug reports.
### Try the latest version of SickRage
......@@ -85,11 +85,11 @@ Please follow this process; it's the best way to get your work included in the p
```bash
# clone your fork of the repo into the current directory in terminal
git clone [email protected]:<your username>/SickRage.git
git clone [email protected]:<your username>/sickrage.srCore.CONFIG.git
# navigate to the newly cloned directory
cd SickRage
# assign the original repo to a remote called "upstream"
git remote add upstream https://github.com/SiCKRAGETV/SickRage.git
git remote add upstream https://github.com/SiCKRAGETV/sickrage.srCore.CONFIG.git
```
- If you cloned a while ago, get the latest changes from upstream:
......
#### !!! IMPORTANT MEMBER ALERT !!!
Currently there have been several reports of attempts to trick our members into switching to a new sickrage repo being told that the current one is no longer operational, DO NOT BE FOOLED this is a poor attempt by several EX-team members to decieve you into switching to their UNOFFICIAL CLONED SickRage application/site/repo.
Please note that if SiCKRAGE ever needed to move to a new site or change its address there is already code in place to do this automatically and securely by me, if you do manually change this information SiCKRAGE accepts no liability or consequences of anything afterwards.
If you receive any such attempts/requests please please email [email protected] promptly so that we can deal with it accordingly!
If you receive any such attempts/requests please please email www.[email protected] promptly so that we can deal with it accordingly!
SickRage [![Build Status](https://travis-ci.org/SiCKRAGETV/SickRage.svg?branch=master)](https://travis-ci.org/SiCKRAGETV/SickRage) [![Average time to resolve an issue](http://isitmaintained.com/badge/resolution/sickragetv/sickrage-issues.svg)](http://isitmaintained.com/project/sickragetv/sickrage-issues "Average time to resolve an issue") [![Percentage of issues still open](http://isitmaintained.com/badge/open/sickragetv/sickrage-issues.svg)](http://isitmaintained.com/project/sickragetv/sickrage-issues "Percentage of issues still open")
SickRage [![Build Status](https://travis-ci.org/SiCKRAGETV/sickrage.srCore.CONFIG.svg?branch=master)](https://travis-ci.org/SiCKRAGETV/SickRage) [![Average time to resolve an issue](http://isitmaintained.com/badge/resolution/sickragetv/sickrage-issues.svg)](http://isitmaintained.com/project/sickragetv/sickrage-issues "Average time to resolve an issue") [![Percentage of issues still open](http://isitmaintained.com/badge/open/sickragetv/sickrage-issues.svg)](http://isitmaintained.com/project/sickragetv/sickrage-issues "Percentage of issues still open")
=====
Automatic Video Library Manager for TV Shows. It watches for new episodes of your favorite shows, and when they are posted it does its magic.
......@@ -46,7 +46,7 @@ Automatic Video Library Manager for TV Shows. It watches for new episodes of you
##### [Wiki](https://github.com/SiCKRAGETV/SickRage/wiki)
#### Important
Before using this with your existing database (sickrage.db) please make a backup copy of it and delete any other database files such as cache.db and failed.db if present<br/>
Before using this with your existing database (sickrage.srCore.CONFIG.db) please make a backup copy of it and delete any other database files such as cache.db and failed.db if present<br/>
We HIGHLY recommend starting out with no database files at all to make this a fresh start but the choice is at your own risk
#### Supported providers
......
......@@ -48,5 +48,5 @@ setup(
"console_scripts": [
"sickrage=sickrage:main",
]
},
}, requires=['configobj']
)
This diff is collapsed.
......@@ -24,15 +24,17 @@ import os.path
import sys
# Try importing Python 2 modules using new names
import sickrage
try:
import ConfigParser as configparser
import urllib2
from urllib import urlencode
# On error import Python 3 modules
except ImportError:
import configparser
# noinspection PyUnresolvedReferences
import urllib.request as urllib2
# noinspection PyUnresolvedReferences,PyUnresolvedReferences
from urllib.parse import urlencode
# workaround for broken urllib2 in python 2.6.5: wrong credentials lead to an infinite recursion
......@@ -78,22 +80,22 @@ def processEpisode(dir_to_process, org_NZB_name=None, status=None):
print ("Loading config from " + config_filename + "\n")
with open(config_filename, "r") as fp:
config.readfp(fp)
sickrage.srCore.CONFIG.readfp(fp)
# Replace default values with config_file values
host = config.get("SiCKRAGE", "host")
port = config.get("SiCKRAGE", "port")
username = config.get("SiCKRAGE", "username")
password = config.get("SiCKRAGE", "password")
host = sickrage.srCore.CONFIG.get("SiCKRAGE", "host")
port = sickrage.srCore.CONFIG.get("SiCKRAGE", "port")
username = sickrage.srCore.CONFIG.get("SiCKRAGE", "username")
password = sickrage.srCore.CONFIG.get("SiCKRAGE", "password")
try:
ssl = int(config.get("SiCKRAGE", "ssl"))
ssl = int(sickrage.srCore.CONFIG.get("SiCKRAGE", "ssl"))
except (configparser.NoOptionError, ValueError):
pass
try:
web_root = config.get("SiCKRAGE", "web_root")
web_root = sickrage.srCore.CONFIG.get("SiCKRAGE", "web_root")
if not web_root.startswith("/"):
web_root = "/" + web_root
......
......@@ -26,6 +26,8 @@ import os
import sys
import time
import sickrage
sickragePath = os.path.split(os.path.split(sys.argv[0])[0])[0]
sys.path.append(sickragePath)
configFilename = os.path.join(sickragePath, "config.ini")
......@@ -36,7 +38,7 @@ config = ConfigParser.ConfigParser()
try:
fp = open(configFilename, "r")
config.readfp(fp)
sickrage.srCore.CONFIG.readfp(fp)
fp.close()
except IOError, e:
print "Could not find/read SiCKRAGE config.ini: " + str(e)
......@@ -48,7 +50,7 @@ scriptlogger = logging.getLogger('mediaToSiCKRAGE')
formatter = logging.Formatter('%(asctime)s %(levelname)-8s MEDIATOSICKRAGE :: %(message)s', '%b-%d %H:%M:%S')
# Get the log dir setting from SB config
logdirsetting = config.get("General", "log_dir") if config.get("General", "log_dir") else 'Logs'
logdirsetting = sickrage.srCore.CONFIG.get("General", "log_dir") if sickrage.srCore.CONFIG.get("General", "log_dir") else 'Logs'
# put the log dir inside the SiCKRAGE dir, unless an absolute path
logdir = os.path.normpath(os.path.join(sickragePath, logdirsetting))
logfile = os.path.join(logdir, 'SiCKRAGE.log')
......@@ -147,23 +149,23 @@ def blackhole():
def main():
scriptlogger.info('Starting external PostProcess script ' + __file__)
host = config.get("General", "web_host")
port = config.get("General", "web_port")
username = config.get("General", "web_username")
password = config.get("General", "web_password")
host = sickrage.srCore.CONFIG.get("General", "web_host")
port = sickrage.srCore.CONFIG.get("General", "web_port")
username = sickrage.srCore.CONFIG.get("General", "web_username")
password = sickrage.srCore.CONFIG.get("General", "web_password")
try:
ssl = int(config.get("General", "enable_https"))
ssl = int(sickrage.srCore.CONFIG.get("General", "enable_https"))
except (ConfigParser.NoOptionError, ValueError):
ssl = 0
try:
web_root = config.get("General", "web_root")
web_root = sickrage.srCore.CONFIG.get("General", "web_root")
except ConfigParser.NoOptionError:
web_root = ""
tv_dir = config.get("General", "tv_download_dir")
use_torrents = int(config.get("General", "use_torrents"))
torrent_method = config.get("General", "torrent_method")
tv_dir = sickrage.srCore.CONFIG.get("General", "tv_download_dir")
use_torrents = int(sickrage.srCore.CONFIG.get("General", "use_torrents"))
torrent_method = sickrage.srCore.CONFIG.get("General", "torrent_method")
if not use_torrents:
scriptlogger.error('Enable Use Torrent on SiCKRAGE to use this Script. Aborting!')
......
......@@ -145,10 +145,10 @@ class GenericClient(object):
def __init__(self, name, host=None, username=None, password=None):
self.name = name
self.username = sickrage.TORRENT_USERNAME if username is None else username
self.password = sickrage.TORRENT_PASSWORD if password is None else password
self.host = sickrage.TORRENT_HOST if host is None else host
self.rpcurl = sickrage.TORRENT_RPCURL
self.username = sickrage.srCore.CONFIG.TORRENT_USERNAME if username is None else username
self.password = sickrage.srCore.CONFIG.TORRENT_PASSWORD if password is None else password
self.host = sickrage.srCore.CONFIG.TORRENT_HOST if host is None else host
self.rpcurl = sickrage.srCore.CONFIG.TORRENT_RPCURL
self.url = None
self.response = None
......@@ -163,41 +163,41 @@ class GenericClient(object):
self.last_time = time.time()
self._get_auth()
sickrage.LOGGER.debug(
sickrage.srCore.LOGGER.debug(
self.name + ': Requested a ' + method.upper() + ' connection to url ' + self.url +
' with Params: ' + str(params) + ' Data: ' + str(data)[0:99] + ('...' if len(str(data)) > 200 else ''))
if not self.auth:
sickrage.LOGGER.warning(self.name + ': Authentication Failed')
sickrage.srCore.LOGGER.warning(self.name + ': Authentication Failed')
return False
try:
self.response = self.session.__getattribute__(method)(self.url, params=params, data=data, files=files,
timeout=120, verify=False)
except requests.exceptions.ConnectionError as e:
sickrage.LOGGER.error(self.name + ': Unable to connect ' + str(e))
sickrage.srCore.LOGGER.error(self.name + ': Unable to connect ' + str(e))
return False
except (requests.exceptions.MissingSchema, requests.exceptions.InvalidURL):
sickrage.LOGGER.error(self.name + ': Invalid Host')
sickrage.srCore.LOGGER.error(self.name + ': Invalid Host')
return False
except requests.exceptions.HTTPError as e:
sickrage.LOGGER.error(self.name + ': Invalid HTTP Request ' + str(e))
sickrage.srCore.LOGGER.error(self.name + ': Invalid HTTP Request ' + str(e))
return False
except requests.exceptions.Timeout as e:
sickrage.LOGGER.warning(self.name + ': Connection Timeout ' + str(e))
sickrage.srCore.LOGGER.warning(self.name + ': Connection Timeout ' + str(e))
return False
except Exception as e:
sickrage.LOGGER.error(self.name + ': Unknown exception raised when send torrent to ' + self.name + ': ' + str(e))
sickrage.srCore.LOGGER.error(self.name + ': Unknown exception raised when send torrent to ' + self.name + ': ' + str(e))
return False
if self.response.status_code == 401:
sickrage.LOGGER.error(self.name + u': Invalid Username or Password, check your config')
sickrage.srCore.LOGGER.error(self.name + u': Invalid Username or Password, check your config')
return False
if self.response.status_code in http_error_code.keys():
sickrage.LOGGER.debug(self.name + ': ' + http_error_code[self.response.status_code])
sickrage.srCore.LOGGER.debug(self.name + ': ' + http_error_code[self.response.status_code])
return False
sickrage.LOGGER.debug(self.name + ': Response to ' + method.upper() + ' request is ' + self.response.text)
sickrage.srCore.LOGGER.debug(self.name + ': Response to ' + method.upper() + ' request is ' + self.response.text)
return True
......@@ -271,19 +271,19 @@ class GenericClient(object):
result.hash = b16encode(b32decode(result.hash)).lower()
else:
if not result.content:
sickrage.LOGGER.error('Torrent without content')
sickrage.srCore.LOGGER.error('Torrent without content')
raise Exception('Torrent without content')
try:
torrent_bdecode = bdecode(result.content)
except BTFailure:
sickrage.LOGGER.error('Unable to bdecode torrent')
sickrage.LOGGER.debug('Torrent bencoded data: %r' % result.content)
sickrage.srCore.LOGGER.error('Unable to bdecode torrent')
sickrage.srCore.LOGGER.debug('Torrent bencoded data: %r' % result.content)
raise
try:
info = torrent_bdecode[b"info"]
except Exception:
sickrage.LOGGER.error('Unable to find info field in torrent')
sickrage.srCore.LOGGER.error('Unable to find info field in torrent')
raise
result.hash = sha1(bencode(info)).hexdigest()
......@@ -293,10 +293,10 @@ class GenericClient(object):
r_code = False
sickrage.LOGGER.debug('Calling ' + self.name + ' Client')
sickrage.srCore.LOGGER.debug('Calling ' + self.name + ' Client')
if not self._get_auth():
sickrage.LOGGER.error(self.name + ': Authentication Failed')
sickrage.srCore.LOGGER.error(self.name + ': Authentication Failed')
return r_code
try:
......@@ -312,30 +312,30 @@ class GenericClient(object):
r_code = self._add_torrent_file(result)
if not r_code:
sickrage.LOGGER.error(self.name + ': Unable to send Torrent: Return code undefined')
sickrage.srCore.LOGGER.error(self.name + ': Unable to send Torrent: Return code undefined')
return False
if not self._set_torrent_pause(result):
sickrage.LOGGER.error(self.name + ': Unable to set the pause for Torrent')
sickrage.srCore.LOGGER.error(self.name + ': Unable to set the pause for Torrent')
if not self._set_torrent_label(result):
sickrage.LOGGER.error(self.name + ': Unable to set the label for Torrent')
sickrage.srCore.LOGGER.error(self.name + ': Unable to set the label for Torrent')
if not self._set_torrent_ratio(result):
sickrage.LOGGER.error(self.name + ': Unable to set the ratio for Torrent')
sickrage.srCore.LOGGER.error(self.name + ': Unable to set the ratio for Torrent')
if not self._set_torrent_seed_time(result):
sickrage.LOGGER.error(self.name + ': Unable to set the seed time for Torrent')
sickrage.srCore.LOGGER.error(self.name + ': Unable to set the seed time for Torrent')
if not self._set_torrent_path(result):
sickrage.LOGGER.error(self.name + ': Unable to set the path for Torrent')
sickrage.srCore.LOGGER.error(self.name + ': Unable to set the path for Torrent')
if result.priority != 0 and not self._set_torrent_priority(result):
sickrage.LOGGER.error(self.name + ': Unable to set priority for Torrent')
sickrage.srCore.LOGGER.error(self.name + ': Unable to set priority for Torrent')
except Exception as e:
sickrage.LOGGER.error(self.name + ': Failed Sending Torrent')
sickrage.LOGGER.debug(self.name + ': Exception raised when sending torrent: ' + str(result) + '. Error: ' + str(e))
sickrage.srCore.LOGGER.error(self.name + ': Failed Sending Torrent')
sickrage.srCore.LOGGER.debug(self.name + ': Exception raised when sending torrent: ' + str(result) + '. Error: ' + str(e))
return r_code
return r_code
......
......@@ -24,7 +24,7 @@ import json
from base64 import b64encode
import sickrage
from sickrage.clients import GenericClient
from clients import GenericClient
class DelugeAPI(GenericClient):
......@@ -42,7 +42,7 @@ class DelugeAPI(GenericClient):
try:
self.response = self.session.post(self.url, data=post_data.encode('utf-8'),
verify=sickrage.TORRENT_VERIFY_CERT)
verify=sickrage.srCore.CONFIG.TORRENT_VERIFY_CERT)
except Exception:
return None
......@@ -54,7 +54,7 @@ class DelugeAPI(GenericClient):
try:
self.response = self.session.post(self.url, data=post_data.encode('utf-8'),
verify=sickrage.TORRENT_VERIFY_CERT)
verify=sickrage.srCore.CONFIG.TORRENT_VERIFY_CERT)
except Exception:
return None
......@@ -66,13 +66,13 @@ class DelugeAPI(GenericClient):
"id": 11})
try:
self.response = self.session.post(self.url, data=post_data.encode('utf-8'),
verify=sickrage.TORRENT_VERIFY_CERT)
verify=sickrage.srCore.CONFIG.TORRENT_VERIFY_CERT)
except Exception:
return None
hosts = self.response.json()['result']
if len(hosts) == 0:
sickrage.LOGGER.error(self.name + ': WebUI does not contain daemons')
sickrage.srCore.LOGGER.error(self.name + ': WebUI does not contain daemons')
return None
post_data = json.dumps({"method": "web.connect",
......@@ -81,7 +81,7 @@ class DelugeAPI(GenericClient):
try:
self.response = self.session.post(self.url, data=post_data.encode('utf-8'),
verify=sickrage.TORRENT_VERIFY_CERT)
verify=sickrage.srCore.CONFIG.TORRENT_VERIFY_CERT)
except Exception:
return None
......@@ -91,13 +91,13 @@ class DelugeAPI(GenericClient):
try:
self.response = self.session.post(self.url, data=post_data.encode('utf-8'),
verify=sickrage.TORRENT_VERIFY_CERT)
verify=sickrage.srCore.CONFIG.TORRENT_VERIFY_CERT)
except Exception:
return None
connected = self.response.json()['result']
if not connected:
sickrage.LOGGER.error(self.name + ': WebUI could not connect to daemon')
sickrage.srCore.LOGGER.error(self.name + ': WebUI could not connect to daemon')
return None
return self.auth
......@@ -128,11 +128,11 @@ class DelugeAPI(GenericClient):
def _set_torrent_label(self, result):
label = sickrage.TORRENT_LABEL
label = sickrage.srCore.CONFIG.TORRENT_LABEL
if result.show.is_anime:
label = sickrage.TORRENT_LABEL_ANIME
label = sickrage.srCore.CONFIG.TORRENT_LABEL_ANIME
if ' ' in label:
sickrage.LOGGER.error(self.name + ': Invalid label. Label must not contain a space')
sickrage.srCore.LOGGER.error(self.name + ': Invalid label. Label must not contain a space')
return False
if label:
......@@ -146,13 +146,13 @@ class DelugeAPI(GenericClient):
if labels is not None:
if label not in labels:
sickrage.LOGGER.debug(self.name + ': ' + label + " label does not exist in Deluge we must add it")
sickrage.srCore.LOGGER.debug(self.name + ': ' + label + " label does not exist in Deluge we must add it")
post_data = json.dumps({"method": 'label.add',
"params": [label],
"id": 4})
self._request(method='post', data=post_data)
sickrage.LOGGER.debug(self.name + ': ' + label + " label added to Deluge")
sickrage.srCore.LOGGER.debug(self.name + ': ' + label + " label added to Deluge")
# add label to torrent
post_data = json.dumps({"method": 'label.set_torrent',
......@@ -160,9 +160,9 @@ class DelugeAPI(GenericClient):
"id": 5})
self._request(method='post', data=post_data)
sickrage.LOGGER.debug(self.name + ': ' + label + " label added to torrent")
sickrage.srCore.LOGGER.debug(self.name + ': ' + label + " label added to torrent")
else:
sickrage.LOGGER.debug(self.name + ': ' + "label plugin not detected")
sickrage.srCore.LOGGER.debug(self.name + ': ' + "label plugin not detected")
return False
return not self.response.json()['error']
......@@ -192,7 +192,7 @@ class DelugeAPI(GenericClient):
def _set_torrent_path(self, result):
if sickrage.TORRENT_PATH:
if sickrage.srCore.CONFIG.TORRENT_PATH:
post_data = json.dumps({"method": "core.set_torrent_move_completed",
"params": [result.hash, True],
"id": 7})
......@@ -200,7 +200,7 @@ class DelugeAPI(GenericClient):
self._request(method='post', data=post_data)
post_data = json.dumps({"method": "core.set_torrent_move_completed_path",
"params": [result.hash, sickrage.TORRENT_PATH],
"params": [result.hash, sickrage.srCore.CONFIG.TORRENT_PATH],
"id": 8})
self._request(method='post', data=post_data)
......@@ -211,7 +211,7 @@ class DelugeAPI(GenericClient):
def _set_torrent_pause(self, result):
if sickrage.TORRENT_PAUSED:
if sickrage.srCore.CONFIG.TORRENT_PAUSED:
post_data = json.dumps({"method": "core.pause_torrent",
"params": [[result.hash]],
"id": 9})
......
......@@ -23,8 +23,8 @@ from __future__ import unicode_literals
from base64 import b64encode
import sickrage
from sickrage.clients import GenericClient
from sickrage.clients.synchronousdeluge.client import DelugeClient
from clients import GenericClient
from clients.synchronousdeluge.client import DelugeClient
class DelugeDAPI(GenericClient):
......@@ -53,7 +53,7 @@ class DelugeDAPI(GenericClient):
# label = sickrage.TORRENT_LABEL_ANIME
options = {
'add_paused': sickrage.TORRENT_PAUSED
'add_paused': sickrage.srCore.CONFIG.TORRENT_PAUSED
}
remote_torrent = self.drpc.add_torrent_magnet(result.url, options, result.hash)
......@@ -75,7 +75,7 @@ class DelugeDAPI(GenericClient):
return None
options = {
'add_paused': sickrage.TORRENT_PAUSED
'add_paused': sickrage.srCore.CONFIG.TORRENT_PAUSED
}
remote_torrent = self.drpc.add_torrent_file(result.name + '.torrent', result.content, options, result.hash)
......@@ -89,11 +89,11 @@ class DelugeDAPI(GenericClient):
def _set_torrent_label(self, result):
label = sickrage.TORRENT_LABEL
label = sickrage.srCore.CONFIG.TORRENT_LABEL
if result.show.is_anime:
label = sickrage.TORRENT_LABEL_ANIME
label = sickrage.srCore.CONFIG.TORRENT_LABEL_ANIME
if ' ' in label:
sickrage.LOGGER.error(self.name + ': Invalid label. Label must not contain a space')
sickrage.srCore.LOGGER.error(self.name + ': Invalid label. Label must not contain a space')
return False
if label:
......@@ -113,14 +113,14 @@ class DelugeDAPI(GenericClient):