Merge remote-tracking branch 'origin/master'

This commit is contained in:
marco
2020-02-22 14:18:42 +01:00
4 changed files with 70 additions and 68 deletions

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<addon id="plugin.video.kod" name="Kodi on Demand BETA" version="0.7.2" provider-name="KOD Team">
<addon id="plugin.video.kod" name="Kodi on Demand BETA" version="0.8" provider-name="KOD Team">
<requires>
<import addon="xbmc.python" version="2.1.0"/>
<import addon="script.module.libtorrent" optional="true"/>
@@ -20,12 +20,11 @@
<screenshot>resources/media/themes/ss/2.png</screenshot>
<screenshot>resources/media/themes/ss/3.png</screenshot>
</assets>
<news>- - aggiunto raiplay
- agigunto d.s.d.a (ex documentaristreamingda)
- svariati fix ai canali (eurostreaming, streamtime, piratestreaming, altadefinizioneclick)
- la videoteca ora può essere messa nelle unità di rete
- aggiunto server upstream
- altri piccoli fix vari</news>
<news>- tanti miglioramenti "sotto il cofano", supporto iniziale al futuro kodi 19
- Nuova modalità di visualizzazione per episodio successivo
- fixato wstream tramite l'aggiunta della finestra per risolvere il reCaptcha
- aggiunta sezione "segnala un problema" in Aiuto
- altri fix e migliorie varie a canali e server</news>
<description lang="it">Naviga velocemente sul web e guarda i contenuti presenti</description>
<disclaimer>[COLOR red]The owners and submitters to this addon do not host or distribute any of the content displayed by these addons nor do they have any affiliation with the content providers.[/COLOR]
[COLOR yellow]Kodi © is a registered trademark of the XBMC Foundation. We are not connected to or in any other way affiliated with Kodi, Team Kodi, or the XBMC Foundation. Furthermore, any software, addons, or products offered by us will receive no support in official Kodi channels, including the Kodi forums and various social networks.[/COLOR]</disclaimer>

View File

@@ -9,6 +9,7 @@ from core import scrapertools, httptools, servertools, tmdb, support
from core.item import Item
from lib import unshortenit
from platformcode import logger, config
from lib.concurrent import futures
def findhost():
@@ -175,28 +176,23 @@ def findvideos(item):
if item.contentType == "episode":
return findvid_serie(item)
def load_links(itemlist, re_txt, color, desc_txt, quality=""):
streaming = scrapertools.find_single_match(data, re_txt).replace('"', '')
support.log('STREAMING',streaming)
matches = support.match(streaming, patron = r'<td><a.*?href=([^ ]+) [^>]+>([^<]+)<').matches
for url, server in matches:
logger.debug("##### findvideos %s ## %s ## %s ##" % (desc_txt, url, server))
itemlist.append(
Item(channel=item.channel,
action="play",
title=server,
url=final_links(url),
server=server,
fulltitle=item.fulltitle,
thumbnail=item.thumbnail,
show=item.show,
quality=quality,
contentType=item.contentType,
folder=False))
def load_links(urls, re_txt, desc_txt, quality=""):
if re_txt:
streaming = scrapertools.find_single_match(data, re_txt).replace('"', '')
support.log('STREAMING',streaming)
matches = support.match(streaming, patron = r'<td><a.*?href=([^ ]+) [^>]+>[^<]+<').matches
with futures.ThreadPoolExecutor() as executor:
u = [executor.submit(final_links, match) for match in matches]
for res in futures.as_completed(u):
if res.result():
urls.append(res.result())
# for url in matches:
# # logger.debug("##### findvideos %s ## %s ## %s ##" % (desc_txt, url, server))
# urls.append(final_links(url))
support.log()
itemlist = []
itemlist = urls = []
# Carica la pagina
data = httptools.downloadpage(item.url).data
@@ -210,15 +206,15 @@ def findvideos(item):
QualityStr = scrapertools.decodeHtmlentities(match.group(1))
# Estrae i contenuti - Streaming
load_links(itemlist, '<strong>Streamin?g:</strong>(.*?)cbtable', "orange", "Streaming", "SD")
load_links(urls, '<strong>Streamin?g:</strong>(.*?)cbtable', "Streaming", "SD")
# Estrae i contenuti - Streaming HD
load_links(itemlist, '<strong>Streamin?g HD[^<]+</strong>(.*?)cbtable', "yellow", "Streaming HD", "HD")
load_links(urls, '<strong>Streamin?g HD[^<]+</strong>(.*?)cbtable', "Streaming HD", "HD")
# Estrae i contenuti - Streaming 3D
load_links(itemlist, '<strong>Streamin?g 3D[^<]+</strong>(.*?)cbtable', "pink", "Streaming 3D")
load_links(urls, '<strong>Streamin?g 3D[^<]+</strong>(.*?)cbtable', "Streaming 3D")
itemlist=support.server(item, itemlist=itemlist)
itemlist=support.server(item, urls)
if itemlist and QualityStr:
itemlist.insert(0,
Item(channel=item.channel,
@@ -236,30 +232,26 @@ def findvideos(item):
def findvid_serie(item):
def load_vid_series(html, item, itemlist, blktxt=''):
def load_vid_series(html, item, urls, blktxt=''):
# logger.info('HTML' + html)
# patron = r'<a href="([^"]+)"[^=]+="_blank"[^>]+>(?!<!--)(.*?)</a>'
# Estrae i contenuti
# matches = re.compile(patron, re.DOTALL).finditer(html)
matches = support.match(html, patron = r'<a href="([^"]+)"[^=]+="_blank"[^>]+>(?!<!--)(.*?)</a>').matches
for url, server in matches:
itemlist.append(
Item(channel=item.channel,
action="play",
title=server,
url=final_links(url),
server=server,
fulltitle=item.fulltitle,
show=item.show,
quality=blktxt,
contentType=item.contentType,
folder=False))
matches = support.match(html, patron = r'<a href="([^"]+)"[^=]+="_blank"[^>]+>(?!<!--).*?</a>').matches
with futures.ThreadPoolExecutor() as executor:
u = [executor.submit(final_links, match) for match in matches]
for res in futures.as_completed(u):
if res.result():
urls.append(res.result())
# for url, server in matches:
# urls.append(final_links(url))
support.log()
itemlist = []
lnkblk = []
lnkblkp = []
urls = []
data = item.url
@@ -268,12 +260,12 @@ def findvid_serie(item):
blktxt=""
for b in blk:
if b[0:3]=="a h" or b[0:4]=="<a h":
load_vid_series("<%s>"%b, item, itemlist, blktxt)
load_vid_series("<%s>"%b, item, urls, blktxt)
blktxt=""
elif len(b.strip())>1:
blktxt=b.strip()
return support.server(item, itemlist=itemlist)
return support.server(item, urls)
def final_links(url):

View File

@@ -110,6 +110,7 @@ def episodios(item):
def findvideos(item):
itemlist = []
support.log()
# support.dbg()
matches = support.match(item, patron=r'href="([^"]+)"', patronBlock=r'<div style="white-space: (.*?)<div id="main-content"')
@@ -118,27 +119,37 @@ def findvideos(item):
item.contentType = 'tvshow'
return episodios(item)
# matches.matches.sort()
support.log('VIDEO')
for url in matches.matches:
lang = url.split('/')[-2]
if 'ita' in lang.lower():
language = 'ITA'
if 'sub' in lang.lower():
language = 'Sub-' + language
quality = url.split('/')[-1]
if 'vvvvid' in matches.data:
itemlist.append(
support.Item(channel=item.channel,
action="play",
contentType=item.contentType,
title=language,
url=url,
contentLanguage = language,
quality = quality,
order = quality.replace('p','').zfill(4),
server='directo',
))
support.Item(channel=item.channel,
action="play",
contentType=item.contentType,
title='vvvid',
url=support.match(matches.data, patron=r'(http://www.vvvvid[^"]+)').match,
server='vvvvid',
))
else:
# matches.matches.sort()
support.log('VIDEO')
for url in matches.matches:
lang = url.split('/')[-2]
if 'ita' in lang.lower():
language = 'ITA'
if 'sub' in lang.lower():
language = 'Sub-' + language
quality = url.split('/')[-1]
itemlist.append(
support.Item(channel=item.channel,
action="play",
contentType=item.contentType,
title=language,
url=url,
contentLanguage = language,
quality = quality,
order = quality.replace('p','').zfill(4),
server='directo',
))
itemlist.sort(key=lambda x: (x.title, x.order), reverse=False)
return support.server(item, itemlist=itemlist)

View File

@@ -11,7 +11,7 @@ from core.support import dbg
def test_video_exists(page_url):
logger.info("(page_url='%s')" % page_url)
page_url = re.sub('akvideo.stream/(?:video/|video\\.php\\?file_code=)?(?:embed-)?([a-zA-Z0-9]+)','akvideo.stream/video/\\1',page_url)
# page_url = re.sub('akvideo.stream/(?:video/|video\\.php\\?file_code=)?(?:embed-)?([a-zA-Z0-9]+)','akvideo.stream/video/\\1',page_url)
global data
# dbg()
page = httptools.downloadpage(page_url)
@@ -28,7 +28,7 @@ def test_video_exists(page_url):
# ID, code = scrapertools.find_single_match(data, r"""input\D*id=(?:'|")([^'"]+)(?:'|").*?value='([a-z0-9]+)""")
# post = urllib.urlencode({ID: code})
logger.info('PAGE DATA' + data)
# logger.info('PAGE DATA' + data)
if "File Not Found" in data:
return False, config.get_localized_string(70449) % "Akvideo"
return True, ""