\s*
\s*
[^"]+)"'
+ patronNext = r''
+ action = 'episodios'
+ else:
+ pagination = ''
+ patronBlock = r''
+ patron = r']+>(?P.*?)(?: [Oo][Aa][Vv])?(?:\s*(?P[Ss][Uu][Bb].[Ii][Tt][Aa])[^<]+)?'
+ action = 'episodios'
+ return locals()
- epnumber = ""
- if 'episodio' in eptype.lower():
- epnumber = scrapertools.find_single_match(title.lower(), r'episodio?\s*(\d+)')
- eptype += ":? " + epnumber
-
- extra = "
\s*| ]+>(?:[^>]+>|)%s(?:[^>]+>[^>]+>|[^<]*|[^>]+>)" % eptype
- itm.title = support.color(title, 'azure').strip()
- itm.action = "findvideos"
- itm.url = url
- itm.fulltitle = cleantitle
- itm.extra = extra
- itm.show = re.sub(r'Episodio\s*', '', title)
- itm.thumbnail = item.thumbnail
-
- tmdb.set_infoLabels_itemlist(itemlist, seekTmdb=True)
+@support.scrape
+def episodios(item):
+ anime = True
+ patron = r' | \s*.*?(?P[^<]+)\s* | \s*]+>\s*]+>\s* ]+>'
+ return locals()
- return itemlist
-# ================================================================================================================
-
-# ----------------------------------------------------------------------------------------------------------------
-def lista_anime(item, nextpage=True, show_lang=True):
- logger.info()
+def findvideos(item):
+ support.log(item)
itemlist = []
- data = httptools.downloadpage(item.url).data
- blocco = scrapertools.find_single_match(data, r' |
', )[0][0]
- for scrapedurl, scrapedtitle in matches:
- scrapedtitle = scrapertools.decodeHtmlentities(scrapedtitle)
- scrapedtitle = re.sub(r'\s+', ' ', scrapedtitle)
- # Pulizia titolo
- scrapedtitle = scrapedtitle.replace("Streaming", "").replace("&", "")
- scrapedtitle = scrapedtitle.replace("Download", "")
- lang = scrapertools.find_single_match(scrapedtitle, r"([Ss][Uu][Bb]\s*[Ii][Tt][Aa])")
- scrapedtitle = scrapedtitle.replace("Sub Ita", "").strip()
- eptype = scrapertools.find_single_match(scrapedtitle, "((?:Episodio?|OAV))")
- cleantitle = re.sub(r'%s\s*\d*\s*(?:\(\d+\)|)' % eptype, '', scrapedtitle)
+ urls = support.match(item.url, r'(episodio\d*.php.*)')[0]
+ for url in urls:
+ url = host + '/' + url
+ headers['Referer'] = url
+ data = support.match(item, headers=headers, url=url)[1]
+ cookies = ""
+ matches = support.re.compile('(.%s.*?)\n' % host.replace("http://", "").replace("www.", ""), re.DOTALL).findall(config.get_cookie_data())
+ for cookie in matches:
+ cookies += cookie.split('\t')[5] + "=" + cookie.split('\t')[6] + ";"
-
- cleantitle = cleantitle.replace(lang, "").strip()
-
- itemlist.append(
- Item(channel=item.channel,
- action="episodi",
- contentType="tvshow" if 'oav' not in scrapedtitle.lower() else "movie",
- title=scrapedtitle.replace(lang, "(%s)" % support.color(lang, "red") if show_lang else "").strip(),
- fulltitle=cleantitle,
- url=scrapedurl,
- show=cleantitle,
- folder=True))
-
- tmdb.set_infoLabels_itemlist(itemlist, seekTmdb=True)
-
- if nextpage:
- patronvideos = r'
'
- matches = re.compile(patronvideos, re.DOTALL).findall(data)
+ headers['Cookie'] = cookies[:-1]
- if len(matches) > 0:
- scrapedurl = matches[0]
- itemlist.append(
- Item(channel=item.channel,
- action="lista_anime",
- title="[COLOR lightgreen]" + config.get_localized_string(30992) + "[/COLOR]",
- url=scrapedurl,
- thumbnail="http://2.bp.blogspot.com/-fE9tzwmjaeQ/UcM2apxDtjI/AAAAAAAAeeg/WKSGM2TADLM/s1600/pager+old.png",
- folder=True))
-
- return itemlist
-
-# ================================================================================================================
-
-# ----------------------------------------------------------------------------------------------------------------
-def lista_anime_completa(item):
- logger.info()
- itemlist = []
-
- p = 1
- if '{}' in item.url:
- item.url, p = item.url.split('{}')
- p = int(p)
-
- data = httptools.downloadpage(item.url).data
- blocco = scrapertools.find_single_match(data, r'
')
- patron = r'
]+>([^<]+)'
- matches = re.compile(patron, re.DOTALL).findall(blocco)
-
- for i, (scrapedurl, scrapedtitle) in enumerate(matches):
- if (p - 1) * PERPAGE > i: continue
- if i >= p * PERPAGE: break
-
- scrapedtitle = scrapertools.decodeHtmlentities(scrapedtitle.strip())
- cleantitle = scrapedtitle.replace("Sub Ita Streaming", "").replace("Ita Streaming", "")
-
+ url = support.match(data, r'
]+>')[0][0] + '|' + urllib.urlencode(headers)
itemlist.append(
Item(channel=item.channel,
- action="episodi",
- contentType="tvshow" if 'oav' not in scrapedtitle.lower() else "movie",
- title=support.color(scrapedtitle, 'azure'),
- fulltitle=cleantitle,
- show=cleantitle,
- url=scrapedurl,
- folder=True))
-
- tmdb.set_infoLabels_itemlist(itemlist, seekTmdb=True)
-
- if len(matches) >= p * PERPAGE:
- scrapedurl = item.url + '{}' + str(p + 1)
- itemlist.append(
- Item(channel=item.channel,
- extra=item.extra,
- action="lista_anime_completa",
- title="[COLOR lightgreen]" + config.get_localized_string(30992) + "[/COLOR]",
- url=scrapedurl,
- thumbnail="http://2.bp.blogspot.com/-fE9tzwmjaeQ/UcM2apxDtjI/AAAAAAAAeeg/WKSGM2TADLM/s1600/pager+old.png",
- folder=True))
-
- return itemlist
-
-# ================================================================================================================
-
-# ----------------------------------------------------------------------------------------------------------------
-def episodi(item):
- logger.info()
- itemlist = []
-
- data = httptools.downloadpage(item.url).data
-
- patron = '\s*.*?(.*?).*?\s* | \s*\s*]+>\s*\s*\s* | '
- matches = re.compile(patron, re.DOTALL).findall(data)
-
- for scrapedtitle, scrapedurl, scrapedimg in matches:
- if 'nodownload' in scrapedimg or 'nostreaming' in scrapedimg:
- continue
- if 'vvvvid' in scrapedurl.lower():
- itemlist.append(Item(title='I Video VVVVID Non sono supportati'))
- continue
-
- scrapedtitle = scrapertools.decodeHtmlentities(scrapedtitle)
- scrapedtitle = re.sub(r'<[^>]*?>', '', scrapedtitle)
- scrapedtitle = '[COLOR azure][B]' + scrapedtitle + '[/B][/COLOR]'
- itemlist.append(
- Item(channel=item.channel,
- action="findvideos",
- contentType="episode",
- title=scrapedtitle,
- url=urlparse.urljoin(host, scrapedurl),
- fulltitle=item.title,
- show=scrapedtitle,
- plot=item.plot,
- fanart=item.thumbnail,
- thumbnail=item.thumbnail))
-
- # Comandi di servizio
- if config.get_videolibrary_support() and len(itemlist) != 0:
- itemlist.append(
- Item(channel=item.channel,
- title="[COLOR lightblue]%s[/COLOR]" % config.get_localized_string(30161),
- url=item.url,
- action="add_serie_to_library",
- extra="episodios",
+ action="play",
+ title='diretto',
+ quality='',
+ url=url,
+ server='directo',
+ fulltitle=item.fulltitle,
show=item.show))
- return itemlist
-
-# ================================================================================================================
-
-# ----------------------------------------------------------------------------------------------------------------
-def findvideos(item):
- logger.info()
- itemlist = []
-
- headers = {'Upgrade-Insecure-Requests': '1',
- 'User-Agent': 'Mozilla/5.0 (Windows NT 6.1; rv:52.0) Gecko/20100101 Firefox/52.0'}
-
- if item.extra:
- data = httptools.downloadpage(item.url, headers=headers).data
- blocco = scrapertools.find_single_match(data, r'%s(.*?)' % item.extra)
- item.url = scrapertools.find_single_match(blocco, r']+>')
-
- patron = r'http:\/\/link[^a]+animesubita[^o]+org\/[^\/]+\/.*?(episodio\d*)[^p]+php(\?.*)'
- for phpfile, scrapedurl in re.findall(patron, item.url, re.DOTALL):
- url = "%s/%s.php%s" % (host, phpfile, scrapedurl)
- headers['Referer'] = url
- data = httptools.downloadpage(url, headers=headers).data
- # ------------------------------------------------
- cookies = ""
- matches = re.compile('(.%s.*?)\n' % host.replace("http://", "").replace("www.", ""), re.DOTALL).findall(config.get_cookie_data())
- for cookie in matches:
- name = cookie.split('\t')[5]
- value = cookie.split('\t')[6]
- cookies += name + "=" + value + ";"
- headers['Cookie'] = cookies[:-1]
- # ------------------------------------------------
- scrapedurl = scrapertools.find_single_match(data, r']+>')
- url = scrapedurl + '|' + urllib.urlencode(headers)
- itemlist.append(
- Item(channel=item.channel,
- action="play",
- text_color="azure",
- title="[%s] %s" % (support.color("Diretto", "orange"), item.title),
- fulltitle=item.fulltitle,
- url=url,
- thumbnail=item.thumbnail,
- fanart=item.thumbnail,
- plot=item.plot))
-
- return itemlist
+ return support.server(item,url,itemlist)
diff --git a/core/support.py b/core/support.py
index 63f1c394..941e84da 100644
--- a/core/support.py
+++ b/core/support.py
@@ -731,9 +731,9 @@ def videolibrary(itemlist, item, typography='', function_level=1, function=''):
# Simply add this function to add video library support
# Function_level is useful if the function is called by another function.
# If the call is direct, leave it blank
- log(item)
+ log()
- if item.contentType != 'episode':
+ if item.contentType == 'movie':
action = 'add_pelicula_to_library'
extra = 'findvideos'
contentType = 'movie'
@@ -742,8 +742,7 @@ def videolibrary(itemlist, item, typography='', function_level=1, function=''):
extra = 'episodios'
contentType = 'tvshow'
- log('FUNCTION = ',function)
-
+ function = function if function else inspect.stack()[function_level][3]
if not typography: typography = 'color kod bold'
@@ -751,8 +750,8 @@ def videolibrary(itemlist, item, typography='', function_level=1, function=''):
contentSerieName=item.contentSerieName if item.contentSerieName else ''
contentTitle=item.contentTitle if item.contentTitle else ''
- if (inspect.stack()[function_level][3] == 'findvideos' and contentType == 'movie' \
- or inspect.stack()[function_level][3] != 'findvideos' and contentType != 'movie'):
+ if (function == 'findvideos' and contentType == 'movie') \
+ or (function == 'episodios' and contentType != 'movie'):
if config.get_videolibrary_support() and len(itemlist) > 0:
itemlist.append(
Item(channel=item.channel,
diff --git a/resources/media/channels/banner/animesubita.png b/resources/media/channels/banner/animesubita.png
new file mode 100644
index 00000000..b62bf2bf
Binary files /dev/null and b/resources/media/channels/banner/animesubita.png differ
diff --git a/resources/media/channels/thumb/animesubita.png b/resources/media/channels/thumb/animesubita.png
new file mode 100644
index 00000000..63115262
Binary files /dev/null and b/resources/media/channels/thumb/animesubita.png differ