diff --git a/CHANGES.md b/CHANGES.md index b7912b54..12ab107a 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -128,6 +128,12 @@ * Fix article link color on some page were changed blue +### 0.12.29 (2017-09-17 09:00:00 UTC) + +* Fix provider nCore +* Change .torrent checker due to files created with qB 3.3.16 (affects nCore and NBL) + + ### 0.12.28 (2017-08-26 18:15:00 UTC) * Change prevent indexer specific release name parts from fudging search logic diff --git a/sickbeard/providers/ncore.py b/sickbeard/providers/ncore.py index 0316fce0..11226e95 100644 --- a/sickbeard/providers/ncore.py +++ b/sickbeard/providers/ncore.py @@ -38,7 +38,7 @@ class NcoreProvider(generic.TorrentProvider): 'search': self.url_base + 'torrents.php?mire=%s&' + '&'.join([ 'miszerint=fid', 'hogyan=DESC', 'tipus=kivalasztottak_kozott', 'kivalasztott_tipus=xvidser,dvdser,hdser', 'miben=name']), - 'get': self.url_base + '%s'} + 'get': self.url_base + '%s&key='} self.url = self.urls['config_provider_home_uri'] @@ -59,7 +59,8 @@ class NcoreProvider(generic.TorrentProvider): items = {'Cache': [], 'Season': [], 'Episode': [], 'Propers': []} - rc = dict((k, re.compile('(?i)' + v)) for (k, v) in {'list': '.*?torrent_all', 'info': 'details'}.iteritems()) + rc = dict((k, re.compile('(?i)' + v)) for (k, v) in { + 'list': '.*?torrent_all', 'info': 'details', 'key': 'key=([^"]+)">Torrent let'}.iteritems()) for mode in search_params.keys(): for search_string in search_params[mode]: search_string = isinstance(search_string, unicode) and unidecode(search_string) or search_string @@ -76,6 +77,7 @@ class NcoreProvider(generic.TorrentProvider): with BS4Parser(html, features=['html5lib', 'permissive']) as soup: torrent_table = soup.find('div', class_=rc['list']) torrent_rows = [] if not torrent_table else torrent_table.find_all('div', class_='box_torrent') + key = rc['key'].findall(html)[0] if not len(torrent_rows): raise generic.HaltParseException @@ -90,7 +92,7 @@ class NcoreProvider(generic.TorrentProvider): anchor = tr.find('a', href=rc['info']) title = (anchor.get('title') or anchor.get_text()).strip() - download_url = self._link(anchor.get('href').replace('details', 'download')) + download_url = self._link(anchor.get('href').replace('details', 'download')) + key except (AttributeError, TypeError, ValueError): continue diff --git a/sickbeard/search.py b/sickbeard/search.py index 21b60af6..f93870f2 100644 --- a/sickbeard/search.py +++ b/sickbeard/search.py @@ -760,10 +760,10 @@ def search_providers(show, episodes, manual_search=False, torrent_only=False, tr try: hdr = re.findall('(\w+(\d+):)', td[0:6])[0] x, v = len(hdr[0]), int(hdr[1]) - for item in range(0, 12): + while x < len(td): y = x + v name = 'name' == td[x: y] - w = re.findall('((?:i\d+e|d|l)?(\d+):)', td[y: y + 32])[0] + w = re.findall('((?:i-?\d+e|e+|d|l+)*(\d+):)', td[y: y + 32])[0] x, v = y + len(w[0]), int(w[1]) if name: name = td[x: x + v]