diff --git a/CHANGES.md b/CHANGES.md index 5caf1dfd..bae629d1 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -16,6 +16,8 @@ * Fix provider SCC stop snatching releases for episodes already completed * Fix provider SCC handle null server responses * Change provider SCC remove 1 of 3 requests per search to save 30% time +* Change provider IPT only decode unicode search strings +* Change provider IPT login process to use General Config/Advanced/Proxy host setting * Remove useless webproxies from provider TPB as they fail for one reason or another * Change provider TPB to use mediaExtensions from common instead of hard-coded private list * Add new tld variants to provider TPB diff --git a/sickbeard/providers/iptorrents.py b/sickbeard/providers/iptorrents.py index 15b1866d..bb956c24 100644 --- a/sickbeard/providers/iptorrents.py +++ b/sickbeard/providers/iptorrents.py @@ -23,7 +23,7 @@ import datetime import sickbeard import generic from sickbeard.common import Quality -from sickbeard import logger,tvcache,db,classes,helpers,show_name_helpers +from sickbeard import logger, tvcache, db, classes, helpers, show_name_helpers from sickbeard.exceptions import ex, AuthException from lib import requests from lib.requests import exceptions @@ -36,8 +36,7 @@ from sickbeard.show_name_helpers import allPossibleShowNames class IPTorrentsProvider(generic.TorrentProvider): urls = {'base_url': 'https://iptorrents.eu', 'login': 'https://iptorrents.eu/torrents/', - 'search': 'https://iptorrents.eu/t?%s%s&q=%s&qf=ti#torrents', - } + 'search': 'https://iptorrents.eu/t?%s%s&q=%s&qf=ti#torrents'} def __init__(self): generic.TorrentProvider.__init__(self, 'IPTorrents', True, False) @@ -56,28 +55,22 @@ class IPTorrentsProvider(generic.TorrentProvider): def _checkAuth(self): - if not self.username or not self.password: - raise AuthException("Your authentication credentials for " + self.name + " are missing, check your config.") + if not (self.username and self.password): + raise AuthException('Your authentication credentials for ' + self.name + ' are missing, check your config.') return True def _doLogin(self): - login_params = {'username': self.username, - 'password': self.password, - 'login': 'submit', - } + if any(self.session.cookies.values()): + return True - try: - response = self.session.post(self.urls['login'], data=login_params, timeout=30, verify=False) - except (requests.exceptions.ConnectionError, requests.exceptions.HTTPError) as e: - logger.log(u'Unable to connect to ' + self.name + ' provider: ' + ex(e), logger.ERROR) - return False + login_params = {'username': self.username, 'password': self.password, 'login': 'submit'} - if re.search('tries left', response.text) \ - or re.search('