KoD 0.5
KoD 0.5 -riscritti molti canali per cambiamenti nella struttura stessa di kod -altre robe carine
This commit is contained in:
+46
-24
@@ -1,8 +1,8 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
import re
|
||||
|
||||
import urlparse
|
||||
import base64
|
||||
|
||||
from core import channeltools
|
||||
from core import httptools
|
||||
@@ -13,7 +13,7 @@ from platformcode import config, logger
|
||||
|
||||
__channel__ = "xms"
|
||||
|
||||
host = 'https://xtheatre.org'
|
||||
host = 'https://xtheatre.org/'
|
||||
host1 = 'https://www.cam4.com/'
|
||||
try:
|
||||
__modo_grafico__ = config.get_setting('modo_grafico', __channel__)
|
||||
@@ -45,20 +45,20 @@ def mainlist(item):
|
||||
logger.info()
|
||||
itemlist = []
|
||||
|
||||
itemlist.append(Item(channel=__channel__, title="Últimas", url=host + '/?filtre=date&cat=0',
|
||||
itemlist.append(Item(channel=__channel__, title="Últimas", url=host + '?filtre=date&cat=0',
|
||||
action="peliculas", viewmode="movie_with_plot", viewcontent='movies',
|
||||
thumbnail=thumbnail % '1'))
|
||||
|
||||
itemlist.append(Item(channel=__channel__, title="Más Vistas", url=host + '/?display=extract&filtre=views',
|
||||
itemlist.append(Item(channel=__channel__, title="Más Vistas", url=host + '?display=extract&filtre=views',
|
||||
action="peliculas", viewmode="movie_with_plot", viewcontent='movies',
|
||||
thumbnail=thumbnail % '2'))
|
||||
|
||||
itemlist.append(Item(channel=__channel__, title="Mejor Valoradas", url=host + '/?display=extract&filtre=rate',
|
||||
itemlist.append(Item(channel=__channel__, title="Mejor Valoradas", url=host + '?display=extract&filtre=rate',
|
||||
action="peliculas", viewmode="movie_with_plot", viewcontent='movies',
|
||||
thumbnail=thumbnail % '3'))
|
||||
|
||||
itemlist.append(Item(channel=__channel__, title="Categorías", action="categorias",
|
||||
url=host + '/categories/', viewmode="movie_with_plot", viewcontent='movies',
|
||||
url=host + 'categories/', viewmode="movie_with_plot", viewcontent='movies',
|
||||
thumbnail=thumbnail % '4'))
|
||||
|
||||
itemlist.append(Item(channel=__channel__, title="WebCam", action="webcamenu",
|
||||
@@ -99,7 +99,7 @@ def peliculas(item):
|
||||
for scrapedthumbnail, scrapedurl, scrapedtitle, plot in matches:
|
||||
plot = scrapertools.decodeHtmlentities(plot)
|
||||
|
||||
itemlist.append(item.clone(channel=__channel__, action="findvideos", title=scrapedtitle.capitalize(),
|
||||
itemlist.append(item.clone(channel=__channel__, action="play", title=scrapedtitle.capitalize(),
|
||||
url=scrapedurl, thumbnail=scrapedthumbnail, infoLabels={"plot": plot},
|
||||
fanart=scrapedthumbnail,viewmode="movie_with_plot",
|
||||
folder=True, contentTitle=scrapedtitle))
|
||||
@@ -150,10 +150,10 @@ def categorias(item):
|
||||
itemlist = []
|
||||
data = httptools.downloadpage(item.url).data
|
||||
data = re.sub(r"\n|\r|\t| |<br>", "", data)
|
||||
patron = 'data-lazy-src="([^"]+)".*?' # img
|
||||
patron += '</noscript><a href="([^"]+)".*?' # url
|
||||
patron += '<span>([^<]+)</span></a>.*?' # title
|
||||
patron += '<span class="nb_cat border-radius-5">([^<]+)</span>' # num_vids
|
||||
patron = 'data-lazy-src="([^"]+)".*?'
|
||||
patron += '<a href="([^"]+)".*?'
|
||||
patron += '<span>([^<]+)</span></a>.*?'
|
||||
patron += '<span class="nb_cat border-radius-5">([^<]+)</span>'
|
||||
matches = re.compile(patron, re.DOTALL).findall(data)
|
||||
|
||||
for scrapedthumbnail, scrapedurl, scrapedtitle, vids in matches:
|
||||
@@ -196,7 +196,7 @@ def sub_search(item):
|
||||
|
||||
for scrapedthumbnail, scrapedtitle, scrapedurl, plot in matches:
|
||||
itemlist.append(item.clone(title=scrapedtitle, url=scrapedurl, plot=plot, fanart=scrapedthumbnail,
|
||||
action="findvideos", thumbnail=scrapedthumbnail))
|
||||
action="play", thumbnail=scrapedthumbnail))
|
||||
|
||||
paginacion = scrapertools.find_single_match(
|
||||
data, "<a href='([^']+)' class=\"inactive\">\d+</a>")
|
||||
@@ -208,17 +208,39 @@ def sub_search(item):
|
||||
return itemlist
|
||||
|
||||
|
||||
def findvideos(item):
|
||||
def play(item):
|
||||
itemlist = []
|
||||
data = httptools.downloadpage(item.url).data
|
||||
data = re.sub(r"\n|\r|\t|amp;|\s{2}| ", "", data)
|
||||
patron = '<iframe src="[^"]+".*?<iframe src="([^"]+)" scrolling="no" frameborder="0"'
|
||||
matches = scrapertools.find_multiple_matches(data, patron)
|
||||
|
||||
for url in matches:
|
||||
server = servertools.get_server_from_url(url)
|
||||
title = "Ver en: [COLOR yellow](%s)[/COLOR]" % server.title()
|
||||
|
||||
itemlist.append(item.clone(action='play', title=title, server=server, url=url))
|
||||
|
||||
if "playlist.m3u8" in item.url:
|
||||
url = item.url
|
||||
else:
|
||||
data = httptools.downloadpage(item.url).data
|
||||
data = re.sub(r"\n|\r|\t|amp;|\s{2}| ", "", data)
|
||||
patron = 'src="([^"]+)" allowfullscreen="true">'
|
||||
matches = scrapertools.find_multiple_matches(data, patron)
|
||||
for url in matches:
|
||||
if "strdef" in url:
|
||||
url = decode_url(url)
|
||||
if "strdef" in url:
|
||||
url = httptools.downloadpage(url).url
|
||||
itemlist.append(item.clone(action="play", title= "%s", url=url))
|
||||
itemlist = servertools.get_servers_itemlist(itemlist, lambda i: i.title % i.server.capitalize())
|
||||
return itemlist
|
||||
|
||||
|
||||
def decode_url(txt):
|
||||
logger.info()
|
||||
itemlist = []
|
||||
data = httptools.downloadpage(txt).data
|
||||
data = re.sub(r"\n|\r|\t| |<br>", "", data)
|
||||
rep = True
|
||||
while rep == True:
|
||||
b64_data = scrapertools.find_single_match(data, '\(dhYas638H\("([^"]+)"\)')
|
||||
if b64_data:
|
||||
b64_url = base64.b64decode(b64_data + "=")
|
||||
b64_url = base64.b64decode(b64_url + "==")
|
||||
data = b64_url
|
||||
else:
|
||||
rep = False
|
||||
url = scrapertools.find_single_match(b64_url, '<iframe src="([^"]+)"')
|
||||
logger.debug (url)
|
||||
return url
|
||||
Reference in New Issue
Block a user