This commit is contained in:
Alhaziel
2019-10-14 17:03:11 +02:00
parent a1e3eb2181
commit 7bc350d8ab
+5 -4
View File
@@ -20,9 +20,10 @@ def findhost():
global host, headers global host, headers
permUrl = httptools.downloadpage('https://www.cb01.uno/', follow_redirects=False).headers permUrl = httptools.downloadpage('https://www.cb01.uno/', follow_redirects=False).headers
support.log('HOST= ',permUrl) support.log('HOST= ',permUrl)
host = permUrl['location'].replace('https://www.google.it/search?q=site:', '') host = permUrl['location'].replace('https://www.google.it/search?q=site:', '').replace('https://www.google.it/search?&q=', '')
support.log('HOST ',host, ' ', host[:4])
if host[:4] != 'http': if host[:4] != 'http':
host = 'https://'+permUrl['location'].replace('https://www.google.it/search?q=site:', '') host = 'https://' + host
support.log('HOST= ',host) support.log('HOST= ',host)
headers = [['Referer', host]] headers = [['Referer', host]]
@@ -112,7 +113,7 @@ def newest(categoria):
item = Item() item = Item()
item.contentType = 'movie' item.contentType = 'movie'
item.url = host + '/lista-film-ultimi-100-film-aggiunti/' item.url = host + '/lista-film-ultimi-100-film-aggiunti/'
return support.scrape(item, r'<a href="([^"]+)">([^<([]+)(?:\[([A-Z]+)\])?\s\(([0-9]{4})\)<\/a>', return support.scrape(item, r'<a href=(?:")?([^">]+)(?:")?>([^<([]+)(?:\[B/N\])?\s*(?:\[(Sub-ITA|SUB-ITA)\])?\s*(?:\[([^\[]+)\])?\s*\(([0-9]{4})\)<\/a>',
['url', 'title', 'quality', 'year'], ['url', 'title', 'quality', 'year'],
patron_block=r'Ultimi 100 film aggiunti:.*?<\/td>') patron_block=r'Ultimi 100 film aggiunti:.*?<\/td>')
@@ -133,7 +134,7 @@ def last(item):
if item.contentType == 'tvshow': if item.contentType == 'tvshow':
matches = support.match(item, r'<a href="([^">]+)".*?>([^(:(|[)]+)([^<]+)<\/a>', '<article class="sequex-post-content.*?</article>', headers)[0] matches = support.match(item, r'<a href="([^">]+)".*?>([^(:(|[)]+)([^<]+)<\/a>', '<article class="sequex-post-content.*?</article>', headers)[0]
else: else:
matches = support.match(item, r'<a href="([^"]+)".*?>([^(:(|[)]+)([^<]+)<\/a>', r'<strong>Ultimi 100 film Aggiornati:<\/a><\/strong>(.*?)<td>', headers)[0] matches = support.match(item, r'<a href=([^>]+)>([^(:(|[)]+)([^<]+)<\/a>', r'<strong>Ultimi 100 film Aggiornati:<\/a><\/strong>(.*?)<td>', headers)[0]
for i, (url, title, info) in enumerate(matches): for i, (url, title, info) in enumerate(matches):
if (page - 1) * PERPAGE > i - count: continue if (page - 1) * PERPAGE > i - count: continue