new filmontv

This commit is contained in:
cttynul
2019-06-10 19:05:07 +02:00
committed by GitHub
parent 52cd18e33b
commit 3e582c07eb
+30 -52
View File
@@ -6,7 +6,7 @@
import re import re
import urllib import urllib
from channelselector import get_thumb from channelselector import get_thumb
from core import httptools, scrapertools, tmdb, support from core import httptools, scrapertools, support, tmdb
from core.item import Item from core.item import Item
from platformcode import logger, config from platformcode import logger, config
@@ -23,20 +23,34 @@ def mainlist(item):
#Item(channel="search", action='discover_list', title=config.get_localized_string(70312), #Item(channel="search", action='discover_list', title=config.get_localized_string(70312),
# search_type='list', list_type='tv/on_the_air', thumbnail=get_thumb("on_the_air.png")), # search_type='list', list_type='tv/on_the_air', thumbnail=get_thumb("on_the_air.png")),
Item(channel=item.channel, Item(channel=item.channel,
title="[B]Oggi in TV[/B] - Tutti i Canali", title="Tutti i Canali",
action="primafila", action="now_on_tv",
url="%s/film-in-tv/", url="%s/film-in-tv/" % host,
thumbnail=item.thumbnail), thumbnail=item.thumbnail),
Item(channel=item.channel, Item(channel=item.channel,
title="[B]Primafila[/B]", title="P",
action="primafila", action="now_on_tv",
url="%s/film-in-tv/oggi/sky-primafila/", url="%s/film-in-tv/oggi/premium/" % host,
thumbnail=item.thumbnail), thumbnail=item.thumbnail),
Item(channel=item.channel, Item(channel=item.channel,
title="[Oggi in TV] Notte", title="S Intrattenimento",
action="tvoggi", action="now_on_tv",
url="%s/filmtv/oggi/notte/" % host, url="%s/film-in-tv/oggi/sky-intrattenimento/" % host,
thumbnail=item.thumbnail),
Item(channel=item.channel,
title="S Cinema",
action="now_on_tv",
url="%s/film-in-tv/oggi/sky-cinema/" % host,
thumbnail=item.thumbnail),
Item(channel=item.channel,
title="S Documentari",
action="now_on_tv",
url="%s/film-in-tv/oggi/sky-doc-e-lifestyle/" % host,
thumbnail=item.thumbnail),
Item(channel=item.channel,
title="Primafila",
action="primafila",
url="%s/film-in-tv/oggi/sky-primafila/" % host,
thumbnail=item.thumbnail)] thumbnail=item.thumbnail)]
return itemlist return itemlist
@@ -47,10 +61,10 @@ def now_on_tv(item):
# Carica la pagina # Carica la pagina
data = httptools.downloadpage(item.url).data data = httptools.downloadpage(item.url).data
#patron = r'spanTitleMovie">([A-Za-z À-ÖØ-öø-ÿ]*)[a-z \n<>\/="_\-:0-9;A-Z.]*GenresMovie">([A-Za-z À-ÖØ-öø-ÿ\/]*)[a-z \n<>\/="_\-:0-9;A-Z.%]*src="([a-zA-Z:\/\.0-9?=]*)' #patron = r'spanTitleMovie">([A-Za-z À-ÖØ-öø-ÿ\-\']*)[a-z \n<>\/="_\-:0-9;A-Z.]*GenresMovie">([\-\'A-Za-z À-ÖØ-öø-ÿ\/]*)[a-z \n<>\/="_\-:0-9;A-Z.%]*src="([a-zA-Z:\/\.0-9?]*)[a-z \n<>\/="_\-:0-9;A-Z.%\-\']*Year">([A-Z 0-9a-z]*)'
patron = r'spanTitleMovie">([A-Za-z À-ÖØ-öø-ÿ\-\']*)[a-z \n<>\/="_\-:0-9;A-Z.]*GenresMovie">([\-\'A-Za-z À-ÖØ-öø-ÿ\/]*)[a-z \n<>\/="_\-:0-9;A-Z.%]*src="([a-zA-Z:\/\.0-9?]*)[a-z \n<>\/="_\-:0-9;A-Z.%\-\']*Year">([A-Z 0-9a-z]*)' patron = r'view_logo" alt="([a-zA-Z 0-9]*)"[a-z \n<>\/="_\-:0-9;A-Z.?!\'\&]*spanTitleMovie">([A-Za-z À-ÖØ-öø-ÿ\-\']*)[a-z \n<>\/="_\-:0-9;A-Z.]*GenresMovie">([\-\'A-Za-z À-ÖØ-öø-ÿ\/]*)[a-z \n<>\/="_\-:0-9;A-Z.%]*src="([a-zA-Z:\/\.0-9?]*)[a-z \n<>\/="_\-:0-9;A-Z.%\-\']*Year">([A-Z 0-9a-z]*)'
matches = re.compile(patron, re.DOTALL).findall(data) matches = re.compile(patron, re.DOTALL).findall(data)
for scrapedtitle, scrapedgender, scrapedthumbnail, scrapedyear in matches: for scrapedchannel, scrapedtitle, scrapedgender, scrapedthumbnail, scrapedyear in matches:
# for scrapedthumbnail, scrapedtitle, scrapedtv in matches: # for scrapedthumbnail, scrapedtitle, scrapedtv in matches:
scrapedurl = "" scrapedurl = ""
scrapedtitle = scrapertools.decodeHtmlentities(scrapedtitle).strip() scrapedtitle = scrapertools.decodeHtmlentities(scrapedtitle).strip()
@@ -60,8 +74,8 @@ def now_on_tv(item):
Item(channel=item.channel, Item(channel=item.channel,
action="do_search", action="do_search",
extra=urllib.quote_plus(scrapedtitle) + '{}' + 'movie', extra=urllib.quote_plus(scrapedtitle) + '{}' + 'movie',
title=scrapedtitle, title="[B]" + scrapedtitle + "[/B] - " + scrapedchannel,
fulltitle=scrapedtitle, fulltitle="[B]" + scrapedtitle + "[/B] - " + scrapedchannel,
url=scrapedurl, url=scrapedurl,
thumbnail=scrapedthumbnail.replace("?width=240", "?width=480"), thumbnail=scrapedthumbnail.replace("?width=240", "?width=480"),
contentTitle=scrapedtitle, contentTitle=scrapedtitle,
@@ -105,42 +119,6 @@ def primafila(item):
return itemlist return itemlist
def tvoggi(item):
logger.info("filmontv tvoggi")
itemlist = []
# Carica la pagina
data = httptools.downloadpage(item.url).data
# Estrae i contenuti
patron = r'<div class="col-xs-5 box-immagine">[^<]+<img src="([^"]+)[^<]+<[^<]+<[^<]+<[^<]+<[^<]+<.*?titolo">(.*?)<[^<]+<[^<]+<[^<]+<[^>]+><br />(.*?)<[^<]+</div>[^<]+<[^<]+<[^<]+<[^>]+>[^<]+<[^<]+<[^<]+<[^>]+><[^<]+<[^>]+>:\s*([^<]+)[^<]+<[^<]+[^<]+<[^<]+[^<]+<[^<]+[^<]+[^>]+>:\s*([^<]+)'
# patron = r'<div class="col-xs-5 box-immagine">[^<]+<img src="([^"]+)[^<]+<[^<]+<[^<]+<[^<]+<[^<]+<.*?titolo">(.*?)<[^<]+<[^<]+<[^<]+<[^>]+><br />(.*?)<[^<]+</div>'
matches = re.compile(patron, re.DOTALL).findall(data)
for scrapedthumbnail, scrapedtitle, scrapedtv, scrapedgender, scrapedyear in matches:
# for scrapedthumbnail, scrapedtitle, scrapedtv in matches:
scrapedurl = ""
scrapedtitle = scrapertools.decodeHtmlentities(scrapedtitle).strip()
infoLabels = {}
infoLabels["year"] = scrapedyear
itemlist.append(
Item(channel=item.channel,
action="do_search",
extra=urllib.quote_plus(scrapedtitle) + '{}' + 'movie',
title=scrapedtitle + "[COLOR yellow] " + scrapedtv + "[/COLOR]",
fulltitle=scrapedtitle,
url=scrapedurl,
thumbnail=scrapedthumbnail,
contentTitle=scrapedtitle,
contentType='movie',
infoLabels=infoLabels,
folder=True))
tmdb.set_infoLabels_itemlist(itemlist, seekTmdb=True)
return itemlist
def do_search(item): def do_search(item):
from specials import search from specials import search
return search.do_search(item) return search.do_search(item)