Merge branch 'master' of https://github.com/kodiondemand/addon
This commit is contained in:
@@ -45,12 +45,12 @@ def mainlist(item):
|
||||
|
||||
def categories(item):
|
||||
support.log(item)
|
||||
itemlist = support.scrape(item,'<li><a href="([^"]+)">(.*?)</a></li>',['url','title'],headers,'Altadefinizione01',patron_block='<ul class="kategori_list">(.*?)</ul>',action='peliculas',url_host=host)
|
||||
itemlist = support.scrape(item,'<li><a href="([^"]+)">(.*?)</a></li>',['url','title'],headers,'Altadefinizione01',patron_block='<ul class="kategori_list">(.*?)</ul>',action='peliculas')
|
||||
return support.thumb(itemlist)
|
||||
|
||||
def AZlist(item):
|
||||
support.log()
|
||||
return support.scrape(item,r'<a title="([^"]+)" href="([^"]+)"',['title','url'],headers,patron_block=r'<div class="movies-letter">(.*?)<\/div>',action='peliculas_list',url_host=host)
|
||||
return support.scrape(item,r'<a title="([^"]+)" href="([^"]+)"',['title','url'],headers,patron_block=r'<div class="movies-letter">(.*?)<\/div>',action='peliculas_list')
|
||||
|
||||
|
||||
def newest(categoria):
|
||||
|
||||
+25
-5
@@ -7,6 +7,7 @@ import urllib
|
||||
from lib import unshortenit
|
||||
from platformcode import logger, config
|
||||
from channelselector import thumb
|
||||
from channels import autoplay
|
||||
|
||||
|
||||
def hdpass_get_servers(item):
|
||||
@@ -86,7 +87,7 @@ def color(text, color):
|
||||
|
||||
|
||||
def scrape(item, patron = '', listGroups = [], headers="", blacklist="", data="", patron_block="",
|
||||
patronNext="", action="findvideos", url_host="", addVideolibrary = True):
|
||||
patronNext="", action="findvideos", addVideolibrary = True):
|
||||
# patron: the patron to use for scraping page, all capturing group must match with listGroups
|
||||
# listGroups: a list containing the scraping info obtained by your patron, in order
|
||||
# accepted values are: url, title, thumb, quality, year, plot, duration, genre, rating
|
||||
@@ -144,8 +145,8 @@ def scrape(item, patron = '', listGroups = [], headers="", blacklist="", data=""
|
||||
scraped = {}
|
||||
for kk in known_keys:
|
||||
val = match[listGroups.index(kk)] if kk in listGroups else ''
|
||||
if kk == "url":
|
||||
val = url_host + val
|
||||
if val and (kk == "url" or kk == 'thumb') and 'http' not in val:
|
||||
val = scrapertoolsV2.find_single_match(item.url, 'https?://[a-z0-9.-]+') + val
|
||||
scraped[kk] = val
|
||||
|
||||
title = scrapertoolsV2.decodeHtmlentities(scraped["title"]).strip()
|
||||
@@ -462,7 +463,9 @@ def nextPage(itemlist, item, data, patron, function_level=1):
|
||||
# If the call is direct, leave it blank
|
||||
|
||||
next_page = scrapertoolsV2.find_single_match(data, patron)
|
||||
log('NEXT= ',next_page)
|
||||
if 'http' not in next_page:
|
||||
next_page = scrapertoolsV2.find_single_match(item.url, 'https?://[a-z0-9.-]+') + next_page
|
||||
log('NEXT= ', next_page)
|
||||
|
||||
if next_page != "":
|
||||
itemlist.append(
|
||||
@@ -477,7 +480,10 @@ def nextPage(itemlist, item, data, patron, function_level=1):
|
||||
return itemlist
|
||||
|
||||
|
||||
def server(item, data='', headers=''):
|
||||
def server(item, data='', headers='', AutoPlay=True):
|
||||
|
||||
__comprueba_enlaces__ = config.get_setting('comprueba_enlaces', item.channel)
|
||||
__comprueba_enlaces_num__ = config.get_setting('comprueba_enlaces_num', item.channel)
|
||||
|
||||
if not data:
|
||||
data = httptools.downloadpage(item.url, headers=headers).data
|
||||
@@ -492,9 +498,23 @@ def server(item, data='', headers=''):
|
||||
videoitem.channel = item.channel
|
||||
videoitem.contentType = item.contentType
|
||||
|
||||
if __comprueba_enlaces__:
|
||||
itemlist = servertools.check_list_links(itemlist, __comprueba_enlaces_num__)
|
||||
|
||||
if AutoPlay == True:
|
||||
autoplay.start(itemlist, item)
|
||||
|
||||
return itemlist
|
||||
|
||||
|
||||
def aplay(item, itemlist, list_servers='', list_quality=''):
|
||||
if inspect.stack()[1][3] == 'mainlist':
|
||||
autoplay.init(item.channel, list_servers, list_quality)
|
||||
autoplay.show_option(item.channel, itemlist)
|
||||
else:
|
||||
autoplay.start(itemlist, item)
|
||||
|
||||
|
||||
def log(stringa1="", stringa2="", stringa3="", stringa4="", stringa5=""):
|
||||
# Function to simplify the log
|
||||
# Automatically returns File Name and Function Name
|
||||
|
||||
@@ -259,7 +259,8 @@ def episodios(item):
|
||||
scrapedtitle = scrapertools.decodeHtmlentities(scrapedtitle).replace("×", "x")
|
||||
scrapedtitle = scrapedtitle.replace("_", " ")
|
||||
scrapedtitle = scrapedtitle.replace(".mp4", "")
|
||||
puntata = scrapertools.find_single_match(scrapedtitle, '[0-9]+x[0-9]+')
|
||||
# puntata = scrapertools.find_single_match(scrapedtitle, '[0-9]+x[0-9]+')
|
||||
puntata = scrapedtitle
|
||||
for i in itemlist:
|
||||
if i.args == puntata: #è già stata aggiunta
|
||||
i.url += " " + scrapedurl
|
||||
|
||||
+2
-2
@@ -103,13 +103,13 @@ def findvideos(item):
|
||||
def generos(item):
|
||||
findhost()
|
||||
patron = '<a href="([^"#]+)">([a-zA-Z]+)'
|
||||
return support.scrape(item, patron, ['url', 'title'], patron_block='<a href="#">Genere</a><ul class="sub-menu">.*?</ul>', action='peliculas', url_host=host)
|
||||
return support.scrape(item, patron, ['url', 'title'], patron_block='<a href="#">Genere</a><ul class="sub-menu">.*?</ul>', action='peliculas')
|
||||
|
||||
|
||||
def year(item):
|
||||
findhost()
|
||||
patron = r'<a href="([^"#]+)">(\d+)'
|
||||
return support.scrape(item, patron, ['url', 'title'], patron_block='<a href="#">Anno</a><ul class="sub-menu">.*?</ul>', action='peliculas', url_host=host)
|
||||
return support.scrape(item, patron, ['url', 'title'], patron_block='<a href="#">Anno</a><ul class="sub-menu">.*?</ul>', action='peliculas')
|
||||
|
||||
|
||||
def play(item):
|
||||
|
||||
Reference in New Issue
Block a user