'
- return support.scrape(item, patron, list_groups, patronNext=patron_next, action="seasons")
+ itemlist = support.scrape(item, patron, list_groups, patronNext=patron_next, action="episodios")
+
+ if itemlist[-1].action != "peliculas":
+ itemlist.pop()
+
+ return itemlist
def search(item, texto):
@@ -117,42 +117,44 @@ def menu(item):
return support.scrape(item, patron, ["url", "title"], action="peliculas")
-def seasons(item):
+def episodios(item):
support.log()
patron = r''
- itemlist = support.scrape(item, patron, ["title", "url"], action="episodios")
+ data = httptools.downloadpage(item.url).data
+ matches = re.compile(patron, re.S).findall(data)
if item.args:
- s = item.args["season"]
- s = (int(s) - 1)
- lastitem = itemlist[s]
- lastitem.args = {"episode": item.args["episode"]}
+ s = (int(item.args["season"]))
+ try:
+ matches = [matches[s]]
+ except:
+ matches = [matches[(s - 1)]]
- return episodios(lastitem)
+ itemlist = []
- return itemlist[:-1]
+ for season, block in matches:
+ patron = r'
\s+
(.*?)'
+ if item.args:
+ ep = int(item.args["episode"])
+ patron = r'\s+
\s(Episodio ' + str(ep) + r') .*?'
+ episodes = re.compile(patron, re.MULTILINE).findall(block)
+ for scrapedurl, scrapedtitle in episodes:
+ fixedtitle = scrapertools.get_season_and_episode(season + " " + scrapedtitle)
+ eptitle = re.sub(r"Episodio\s+\d+", "", scrapedtitle).strip()
+ itemlist.append(
+ Item(channel=item.channel,
+ action="episodios",
+ contentType=item.contentType,
+ title="[B]" + fixedtitle + " " + eptitle + "[/B]",
+ fulltitle=fixedtitle + " " + eptitle,
+ show=fixedtitle + " " + eptitle,
+ url=scrapedurl,
+ extra=item.extra,
+ ))
-
-def episodios(item):
- support.log()
- season = item.parentTitle
-
- patron = r'\s+
(.*?)'
- if item.args:
- ep = int(item.args["episode"])
- patron = r'\s+
\s(Episodio ' + str(ep) + r') .*?'
-
- itemlist = support.scrape(item, patron, ["url", "title"], data=item.url)
-
- if item.args:
- itemlist = itemlist[:-1]
-
- for it in itemlist:
- if it.action == "findvideos":
- season_n = scrapertools.find_single_match(season, r'Stagione\s+(\d+)')
- ep_n = scrapertools.find_single_match(it.title, r'Episodio\s+(\d+)')
- it.title = season_n + "x" + str(ep_n).zfill(2) + re.sub(r"Episodio\s+" + ep_n, "", it.title)
+ if not item.args:
+ support.videolibrary(itemlist, item)
return itemlist
diff --git a/plugin.video.alfa/channels/support.py b/plugin.video.alfa/channels/support.py
index 7f7a0922..90a323e8 100644
--- a/plugin.video.alfa/channels/support.py
+++ b/plugin.video.alfa/channels/support.py
@@ -397,8 +397,7 @@ def videolibrary(itemlist, item, typography=''):
url=item.url,
action=action,
extra=extra,
- contentTitle=item.fulltitle,
- parentTitle=item.title))
+ contentTitle=item.fulltitle))
def nextPage(itemlist, item, data, patron, function_level=1):
diff --git a/plugin.video.alfa/core/scrapertools.py b/plugin.video.alfa/core/scrapertools.py
index 8a45645f..5d0be133 100755
--- a/plugin.video.alfa/core/scrapertools.py
+++ b/plugin.video.alfa/core/scrapertools.py
@@ -367,7 +367,7 @@ def get_season_and_episode(title):
filename = ""
patrons = ["(\d+)\s*[x-]\s*(\d+)", "(\d+)\s*×\s*(\d+)", "(?:s|t)(\d+)e(\d+)",
- "(?:season|temp\w*)\s*(\d+)\s*(?:capitulo|epi|episode\w*)\s*(\d+)"]
+ "(?:season|temp|stagione\w*)\s*(\d+)\s*(?:capitulo|epi|episode|episodio\w*)\s*(\d+)"]
for patron in patrons:
try: