diff --git a/data/interfaces/default/config.html b/data/interfaces/default/config.html
index 841df0d1..02f40718 100644
--- a/data/interfaces/default/config.html
+++ b/data/interfaces/default/config.html
@@ -649,6 +649,10 @@
+
+
+
+
diff --git a/headphones/config.py b/headphones/config.py
index 57af4c16..98b23785 100644
--- a/headphones/config.py
+++ b/headphones/config.py
@@ -248,6 +248,7 @@ _CONFIG_DEFINITIONS = {
'RUTRACKER_PASSWORD': (str, 'Rutracker', ''),
'RUTRACKER_RATIO': (str, 'Rutracker', ''),
'RUTRACKER_USER': (str, 'Rutracker', ''),
+ 'RUTRACKER_COOKIE': (str, 'Rutracker', ''),
'SAB_APIKEY': (str, 'SABnzbd', ''),
'SAB_CATEGORY': (str, 'SABnzbd', ''),
'SAB_HOST': (str, 'SABnzbd', ''),
diff --git a/headphones/rutracker.py b/headphones/rutracker.py
index 658d490e..7d18ca1e 100644
--- a/headphones/rutracker.py
+++ b/headphones/rutracker.py
@@ -49,7 +49,11 @@ class Rutracker(object):
# try again
if not self.has_bb_session_cookie(r):
time.sleep(10)
- r = self.session.post(loginpage, data=post_params, timeout=self.timeout, allow_redirects=False)
+ if headphones.CONFIG.RUTRACKER_COOKIE:
+ logger.info("Attempting to log in using predefined cookie...")
+ r = self.session.post(loginpage, data=post_params, timeout=self.timeout, allow_redirects=False, cookies={'bb_session': headphones.CONFIG.RUTRACKER_COOKIE})
+ else:
+ r = self.session.post(loginpage, data=post_params, timeout=self.timeout, allow_redirects=False)
if self.has_bb_session_cookie(r):
self.loggedin = True
logger.info("Successfully logged in to rutracker")
diff --git a/headphones/webserve.py b/headphones/webserve.py
index 2b0f2699..ee353fe2 100644
--- a/headphones/webserve.py
+++ b/headphones/webserve.py
@@ -1240,6 +1240,7 @@ class WebInterface(object):
"rutracker_user": headphones.CONFIG.RUTRACKER_USER,
"rutracker_password": headphones.CONFIG.RUTRACKER_PASSWORD,
"rutracker_ratio": headphones.CONFIG.RUTRACKER_RATIO,
+ "rutracker_cookie": headphones.CONFIG.RUTRACKER_COOKIE,
"use_apollo": checked(headphones.CONFIG.APOLLO),
"apollo_username": headphones.CONFIG.APOLLO_USERNAME,
"apollo_password": headphones.CONFIG.APOLLO_PASSWORD,