Merge branch 'master' into develop

This commit is contained in:
JackDandy 2017-09-17 09:08:31 +01:00
commit 208c284e6b
3 changed files with 13 additions and 5 deletions

View file

@ -128,6 +128,12 @@
* Fix article link color on some page were changed blue * 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) ### 0.12.28 (2017-08-26 18:15:00 UTC)
* Change prevent indexer specific release name parts from fudging search logic * Change prevent indexer specific release name parts from fudging search logic

View file

@ -38,7 +38,7 @@ class NcoreProvider(generic.TorrentProvider):
'search': self.url_base + 'torrents.php?mire=%s&' + '&'.join([ 'search': self.url_base + 'torrents.php?mire=%s&' + '&'.join([
'miszerint=fid', 'hogyan=DESC', 'tipus=kivalasztottak_kozott', 'miszerint=fid', 'hogyan=DESC', 'tipus=kivalasztottak_kozott',
'kivalasztott_tipus=xvidser,dvdser,hdser', 'miben=name']), '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'] self.url = self.urls['config_provider_home_uri']
@ -59,7 +59,8 @@ class NcoreProvider(generic.TorrentProvider):
items = {'Cache': [], 'Season': [], 'Episode': [], 'Propers': []} 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 mode in search_params.keys():
for search_string in search_params[mode]: for search_string in search_params[mode]:
search_string = isinstance(search_string, unicode) and unidecode(search_string) or search_string 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: with BS4Parser(html, features=['html5lib', 'permissive']) as soup:
torrent_table = soup.find('div', class_=rc['list']) torrent_table = soup.find('div', class_=rc['list'])
torrent_rows = [] if not torrent_table else torrent_table.find_all('div', class_='box_torrent') 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): if not len(torrent_rows):
raise generic.HaltParseException raise generic.HaltParseException
@ -90,7 +92,7 @@ class NcoreProvider(generic.TorrentProvider):
anchor = tr.find('a', href=rc['info']) anchor = tr.find('a', href=rc['info'])
title = (anchor.get('title') or anchor.get_text()).strip() 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): except (AttributeError, TypeError, ValueError):
continue continue

View file

@ -760,10 +760,10 @@ def search_providers(show, episodes, manual_search=False, torrent_only=False, tr
try: try:
hdr = re.findall('(\w+(\d+):)', td[0:6])[0] hdr = re.findall('(\w+(\d+):)', td[0:6])[0]
x, v = len(hdr[0]), int(hdr[1]) x, v = len(hdr[0]), int(hdr[1])
for item in range(0, 12): while x < len(td):
y = x + v y = x + v
name = 'name' == td[x: y] 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]) x, v = y + len(w[0]), int(w[1])
if name: if name:
name = td[x: x + v] name = td[x: x + v]