altadefinizione: channel refactored
This commit is contained in:
+21
-38
@@ -21,11 +21,11 @@ headers = [['Referer', host]]
|
|||||||
|
|
||||||
@support.menu
|
@support.menu
|
||||||
def mainlist(item):
|
def mainlist(item):
|
||||||
menu = [('Film',['/category/film/', 'peliculas', 'list', 'undefined']),
|
menu = [('Film',['/category/film/', 'peliculas', '', 'movie']),
|
||||||
('Film al cinema {submenu}',['/category/ora-al-cinema/', 'peliculas', '', 'undefined']),
|
('Film al cinema {submenu}',['/category/ora-al-cinema/', 'peliculas', '', 'movie']),
|
||||||
('Generi',['', 'genres', '', 'undefined']),
|
('Generi',['', 'genres', '', 'undefined']),
|
||||||
('Saghe',['', 'genres', 'saghe', 'undefined']),
|
('Saghe',['', 'genres', 'saghe', 'undefined']),
|
||||||
('Serie TV',['/category/serie-tv/', 'peliculas', 'list', 'tvshow']),
|
('Serie TV',['/category/serie-tv/', 'peliculas', '', 'tvshow']),
|
||||||
#('Aggiornamenti Serie TV', ['/aggiornamenti-serie-tv/', 'peliculas']) da fixare
|
#('Aggiornamenti Serie TV', ['/aggiornamenti-serie-tv/', 'peliculas']) da fixare
|
||||||
]
|
]
|
||||||
search = ''
|
search = ''
|
||||||
@@ -68,55 +68,38 @@ def search(item, text):
|
|||||||
logger.error("search except: %s" % line)
|
logger.error("search except: %s" % line)
|
||||||
return []
|
return []
|
||||||
|
|
||||||
|
@support.scrape
|
||||||
def peliculas(item):
|
def peliculas(item):
|
||||||
data = httptools.downloadpage(item.url).data
|
if not item.args == 'search': # pagination not works
|
||||||
|
if not item.nextpage:
|
||||||
|
item.page = 1
|
||||||
|
else:
|
||||||
|
item.page = item.nextpage
|
||||||
|
|
||||||
if not item.nextpage:
|
|
||||||
item.page = 1
|
|
||||||
else:
|
|
||||||
item.page = item.nextpage
|
|
||||||
|
|
||||||
itemlist = []
|
|
||||||
for it in support.match(data, patron=[r'<article class=\"elementor-post.*?(<img .*?src=\"(?P<thumb>[^\"]+).*?)?<h1 class=\"elementor-post__title\".*?<a href=\"(?P<url>[^\"]+)\" >\s*(?P<title>[^<]+?)\s*(\((?P<lang>Sub-[a-zA-Z]+)*\))?\s*(\[(?P<quality>[A-Z]*)\])?\s*(\((?P<year>[0-9]{4})\))?\s+<']).matches:
|
|
||||||
infoLabels = dict()
|
|
||||||
infoLabels['fanart'] = it[1]
|
|
||||||
infoLabels['title'] = support.cleantitle(it[3])
|
|
||||||
infoLabels['mediatype'] = 'undefined'
|
|
||||||
infoLabels['year'] = it[9]
|
|
||||||
itemlist.append(item.clone(contentType = 'undefined',
|
|
||||||
action='check',
|
|
||||||
thumbnail = item.thumbnail,
|
|
||||||
fulltitle = support.cleantitle(it[3]),
|
|
||||||
title = support.format_longtitle(support.cleantitle(it[3]), quality = it[7], lang = it[5]),
|
|
||||||
url = it[2],
|
|
||||||
infoLabels = infoLabels)
|
|
||||||
)
|
|
||||||
|
|
||||||
tmdb.set_infoLabels_itemlist(itemlist, seekTmdb=True)
|
|
||||||
support.check_trakt(itemlist)
|
|
||||||
|
|
||||||
if not item.args == 'search' and not len(itemlist) < 10: # pagination not works
|
|
||||||
if not item.parent_url:
|
if not item.parent_url:
|
||||||
item.parent_url = item.url
|
item.parent_url = item.url
|
||||||
|
|
||||||
item.nextpage = item.page + 1
|
item.nextpage = item.page + 1
|
||||||
item.url = "{}/page/{}".format(item.parent_url, item.nextpage)
|
nextPageUrl = "{}/page/{}".format(item.parent_url, item.nextpage)
|
||||||
|
resp = httptools.downloadpage(nextPageUrl, only_headers = True)
|
||||||
resp = httptools.downloadpage(item.url, only_headers = True)
|
if (resp.code > 399): # no more elements
|
||||||
if (resp.code < 399): # no more elements
|
nextPageUrl = ''
|
||||||
support.nextPage(itemlist = itemlist, item = item, next_page=item.url)
|
else:
|
||||||
|
action = 'check'
|
||||||
|
|
||||||
return itemlist
|
patron= r'<article class=\"elementor-post.*?(<img .*?src=\"(?P<thumb>[^\"]+).*?)?<h1 class=\"elementor-post__title\".*?<a href=\"(?P<url>[^\"]+)\" >\s*(?P<title>[^<]+?)\s*(\((?P<lang>Sub-[a-zA-Z]+)*\))?\s*(\[(?P<quality>[A-Z]*)\])?\s*(\((?P<year>[0-9]{4})\))?\s+<'
|
||||||
|
|
||||||
|
return locals()
|
||||||
|
|
||||||
def episodios(item):
|
def episodios(item):
|
||||||
item.quality = ''
|
item.quality = ''
|
||||||
data = item.data
|
data = item.data if item.data else httptools.downloadpage(item.url).data
|
||||||
itemlist = []
|
itemlist = []
|
||||||
|
|
||||||
for it in support.match(data, patron=[r'div class=\"single-season.*?(?P<id>season_[0-9]+).*?>Stagione:\s(?P<season>[0-9]+).*?(\s-\s(?P<lang>[a-zA-z]+?))?<']).matches:
|
for it in support.match(data, patron=[r'div class=\"single-season.*?(?P<id>season_[0-9]+).*?>Stagione:\s(?P<season>[0-9]+).*?(\s-\s(?P<lang>[a-zA-z]+?))?<']).matches:
|
||||||
block = support.match(data, patron = r'div id=\"'+ it[0] +'\".*?</div').match
|
block = support.match(data, patron = r'div id=\"'+ it[0] +'\".*?</div').match
|
||||||
for ep in support.match(block, patron=[r'<li><a href=\"(?P<url>[^\"]+).*?img\" src=\"(?P<thumb>[^\"]+).*?title\">(?P<episode>[0-9]+)\.\s+(?P<title>.*?)</span>']).matches:
|
for ep in support.match(block, patron=[r'<li><a href=\"(?P<url>[^\"]+).*?img\" src=\"(?P<thumb>[^\"]+).*?title\">(?P<episode>[0-9]+)\.\s+(?P<title>.*?)</span>']).matches:
|
||||||
itemlist.append(item.clone(contentType = 'tvshow',
|
itemlist.append(item.clone(contentType = 'episode',
|
||||||
action='findvideos',
|
action='findvideos',
|
||||||
thumb = ep[1],
|
thumb = ep[1],
|
||||||
title = support.format_longtitle(support.cleantitle(ep[3]), season = it[1], episode = ep[2], lang= it[3]),
|
title = support.format_longtitle(support.cleantitle(ep[3]), season = it[1], episode = ep[2], lang= it[3]),
|
||||||
@@ -125,7 +108,7 @@ def episodios(item):
|
|||||||
|
|
||||||
support.check_trakt(itemlist)
|
support.check_trakt(itemlist)
|
||||||
support.videolibrary(itemlist, item)
|
support.videolibrary(itemlist, item)
|
||||||
if (config.get_setting('downloadenabled')):
|
if (config.get_setting('downloadenabled')):
|
||||||
support.download(itemlist, item)
|
support.download(itemlist, item)
|
||||||
|
|
||||||
return itemlist
|
return itemlist
|
||||||
|
|||||||
+4
-3
@@ -550,6 +550,7 @@ def scrape(func):
|
|||||||
downloadEnabled = args.get('downloadEnabled', True)
|
downloadEnabled = args.get('downloadEnabled', True)
|
||||||
pag = item.page if item.page else 1 # pagination
|
pag = item.page if item.page else 1 # pagination
|
||||||
matches = []
|
matches = []
|
||||||
|
nextPageUrl = args.get('nextPageUrl', '')
|
||||||
|
|
||||||
for n in range(2):
|
for n in range(2):
|
||||||
logger.debug('PATRON= ', patron)
|
logger.debug('PATRON= ', patron)
|
||||||
@@ -614,7 +615,7 @@ def scrape(func):
|
|||||||
@scrape
|
@scrape
|
||||||
def newFunc():
|
def newFunc():
|
||||||
return nextArgs
|
return nextArgs
|
||||||
nextArgs['item'] = nextPage(itemlist, item, data, patronNext, function)
|
nextArgs['item'] = nextPage(itemlist, item, data, patronNext, function, nextPageUrl)
|
||||||
nextArgs['group'] = False
|
nextArgs['group'] = False
|
||||||
if nextArgs['item']:
|
if nextArgs['item']:
|
||||||
nextArgs['groupExplode'] = True
|
nextArgs['groupExplode'] = True
|
||||||
@@ -639,8 +640,8 @@ def scrape(func):
|
|||||||
tmdb.set_infoLabels_itemlist(itemlist, seekTmdb=True)
|
tmdb.set_infoLabels_itemlist(itemlist, seekTmdb=True)
|
||||||
|
|
||||||
if not group and not args.get('groupExplode') and ((pagination and len(matches) <= pag * pagination) or not pagination): # next page with pagination
|
if not group and not args.get('groupExplode') and ((pagination and len(matches) <= pag * pagination) or not pagination): # next page with pagination
|
||||||
if patronNext and inspect.currentframe().f_back.f_code.co_name not in ['newest'] and len(inspect.stack(0)) > 2 and inspect.stack(0)[2][3] not in ['get_channel_results']:
|
if (patronNext or nextPageUrl) and inspect.currentframe().f_back.f_code.co_name not in ['newest'] and len(inspect.stack(0)) > 2 and inspect.stack(0)[2][3] not in ['get_channel_results']:
|
||||||
nextPage(itemlist, item, data, patronNext, function)
|
nextPage(itemlist, item, data, patronNext, function, nextPageUrl)
|
||||||
|
|
||||||
# for it in itemlist:
|
# for it in itemlist:
|
||||||
# if it.contentEpisodeNumber and it.contentSeason:
|
# if it.contentEpisodeNumber and it.contentSeason:
|
||||||
|
|||||||
Reference in New Issue
Block a user