Merge pull request #720 from JackDandy/feature/ChangeProvSignatures

Change logged in and a fail-over signature.
This commit is contained in:
JackDandy 2016-06-21 02:42:48 +01:00 committed by GitHub
commit ec34d067ef
5 changed files with 17 additions and 5 deletions

View file

@ -922,7 +922,6 @@ class TorrentProvider(object, GenericProvider):
if self.password not in post_params.values():
post_params['password'] = self.password
response = helpers.getURL(url, post_data=post_params, session=self.session, timeout=timeout)
if response:
if logged_in(response):

View file

@ -44,10 +44,14 @@ class IPTorrentsProvider(generic.TorrentProvider):
def _authorised(self, **kwargs):
return super(IPTorrentsProvider, self)._authorised(
logged_in=(lambda x=None: (None is x or 'RSS Link' in x) and self.has_all_cookies() and
logged_in=(lambda x='': ('RSS Link' in x) and self.has_all_cookies() and
self.session.cookies['uid'] in self.digest and self.session.cookies['pass'] in self.digest),
failed_msg=(lambda x=None: u'Invalid cookie details for %s. Check settings'))
@staticmethod
def _has_signature(data=None):
return generic.TorrentProvider._has_signature(data) or (data and re.search(r'(?i)<title[^<]+?ipt', data))
def _search_provider(self, search_params, **kwargs):
results = []

View file

@ -49,7 +49,7 @@ class KATProvider(generic.TorrentProvider):
@staticmethod
def _has_signature(data=None):
return data and (re.search(r'(?sim)(<title>KAT)', data[15:1024:]) or 'kastatic' in data)
return data and (re.search(r'(?sim)(<title>KAT)', data[15:1024:]) or 'kastat' in data)
def _find_season_quality(self, title, torrent_link, ep_number):
""" Return the modified title of a Season Torrent with the quality found inspecting torrent file list """

View file

@ -45,10 +45,15 @@ class TorrentDayProvider(generic.TorrentProvider):
def _authorised(self, **kwargs):
return super(TorrentDayProvider, self)._authorised(
logged_in=(lambda x=None: (None is x or 'RSS URL' in x) and self.has_all_cookies() and
logged_in=(lambda x='': ('RSS URL' in x) and self.has_all_cookies() and
self.session.cookies['uid'] in self.digest and self.session.cookies['pass'] in self.digest),
failed_msg=(lambda x=None: u'Invalid cookie details for %s. Check settings'))
@staticmethod
def _has_signature(data=None):
return generic.TorrentProvider._has_signature(data) or \
(data and re.search(r'(?i)<title[^<]+?(td|torrentday)', data))
def _search_provider(self, search_params, **kwargs):
results = []

View file

@ -43,10 +43,14 @@ class TorrentingProvider(generic.TorrentProvider):
def _authorised(self, **kwargs):
return super(TorrentingProvider, self)._authorised(
logged_in=(lambda x=None: (None is x or 'RSS link' in x) and self.has_all_cookies() and
logged_in=(lambda x='': ('RSS link' in x) and self.has_all_cookies() and
self.session.cookies['uid'] in self.digest and self.session.cookies['pass'] in self.digest),
failed_msg=(lambda x=None: u'Invalid cookie details for %s. Check settings'))
@staticmethod
def _has_signature(data=None):
return generic.TorrentProvider._has_signature(data) or (data and re.search(r'(?i)<title[^<]+?Torrenting', data))
def _search_provider(self, search_params, **kwargs):
results = []