Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # -*- coding: utf-8 -*-
- # ------------------------------------------------------------
- # streamondemand.- XBMC Plugin
- # Canal para itafilmtv
- # http://blog.tvalacarta.info/plugin-xbmc/streamondemand.
- # By Costaplus
- # ------------------------------------------------------------
- import re
- import sys
- import urlparse
- import urllib2
- import xbmc
- from core import config
- from core import logger
- from core import scrapertools
- from core.item import Item
- from servers import servertools
- __channel__ = "animeforge"
- __category__ = "F"
- __type__ = "generic"
- __title__ = "animeforge.org"
- __language__ = "IT"
- DEBUG = True #config.get_setting("debug")
- host = "http://www.animeforce.org/"
- hostlista = host + "lista-anime/"
- def isGeneric():
- return True
- #-----------------------------------------------------------------
- def mainlist(item):
- log("animeforge","mainlist")
- itemlist =[]
- itemlist.append(Item(channel=__channel__,action="lista_anime",title="[COLOR azure]Lista Serie[/COLOR]" ,url=hostlista,thumbnail=AnimeThumbnail,fanart=AnimeFanart))
- itemlist.append(Item(channel=__channel__,action="lista_generi" ,title="[COLOR azure]Categorie[/COLOR]",url=hostlista+"ListaGeneri.php" ,thumbnail=CategoriaThumbnail,fanart=CategoriaFanart))
- itemlist.append(Item(channel=__channel__,action="search" ,title="[COLOR orange]Cerca...[/COLOR]",url="http://www.leserie.tv/index.php?do=search",thumbnail=CercaThumbnail,fanart=CercaFanart))
- return itemlist
- #=================================================================
- #-----------------------------------------------------------------
- def lista_anime(item):
- log("lista_anime", "lista_anime")
- itemlist = []
- patron = '<li><strong.*?href="(.*?)">(.*?)</a></strong></li>'
- for scrapedurl,scrapedtitle in scrapedAll(item.url, patron):
- scrapedtitle=elimina_superfluo(scrapedtitle)
- log("lista_anime"," scrapedurl:" + scrapedurl + " scrapedtitle:" + scrapedtitle)
- itemlist.append(Item(channel=__channel__, action="episodi", title=scrapedtitle, url=scrapedurl,thumbnail="", fulltitle=scrapedtitle, show=scrapedtitle,fanart=""))
- return itemlist
- #=================================================================
- #-----------------------------------------------------------------
- def episodi(item):
- log("episodi", "episodi")
- itemlist =[]
- single='<i>.*?</i>'
- patron= '<td style="text-align: left;"><strong>(.*?)</strong></td>\s*.*?href="(.*?)"'
- for scrapedtitle,scrapedurl in scrapedAll(item.url,patron):
- log("episodi", "scrapedurl: " + scrapedurl)
- #if DEBUG: logger.info("scrapedurl: " + scrapedurl + " scrapedtitle:" + scrapedtitle)
- scrapedtitle = scrapertools.htmlclean(scrapedtitle)
- itemlist.append(Item(channel=__channel__, action="player", title=scrapedtitle, url=scrapedurl,thumbnail=item.thumbnail, fulltitle=scrapedtitle, show=scrapedtitle,fanart=item.thumbnail))
- return itemlist
- #=================================================================
- #-----------------------------------------------------------------
- def player(item):
- itemlist =[]
- xbmc.log(item.url)
- #patron='<a href="(.*?)">Streaming Alternativo.*?</a>'
- patron='<source.*?src="(.*?)".*?>'
- for scrapedurl in scrapedAll(item.url, patron):
- log("player","url Video:"+scrapedurl)
- itemlist.append(Item(channel=__channel__, action="play", title=item.title, url=host + scrapedurl, thumbnail=item.thumbnail,plot=item.plot,fanart=item.fanart, folder=False))
- itemlist.append(Item(channel=__channel__, action="play", title=item.title, url=host + "dsOLD16.php?file ="+ scrapedurl, thumbnail=item.thumbnail,plot=item.plot, fanart=item.fanart, folder=False))
- return itemlist
- #=================================================================
- #=================================================================
- # Funzioni di servizio
- #-----------------------------------------------------------------
- def scrapedAll(url="",patron=""):
- matches = []
- data = scrapertools.cache_page(url)
- if DEBUG: logger.info("data:"+data)
- xbmc.log("data:" + data)
- MyPatron = patron
- matches = re.compile(MyPatron, re.DOTALL).findall(data)
- scrapertools.printMatches(matches)
- return matches
- #=================================================================
- #-----------------------------------------------------------------
- def scrapedAllPost(url="",Post="",patron=""):
- matches = []
- data = scrapertools.cache_page(url,post=Post)
- if DEBUG: logger.info("data:"+data)
- xbmc.log("data:" + data)
- MyPatron = patron
- matches = re.compile(MyPatron, re.DOTALL).findall(data)
- scrapertools.printMatches(matches)
- return matches
- #=================================================================
- #-----------------------------------------------------------------
- def scrapedSingle(url="",single="",patron=""):
- matches =[]
- data = scrapertools.cache_page(url)
- elemento = scrapertools.find_single_match(data, single)
- xbmc.log("trovato:" + elemento)
- matches = re.compile(patron, re.DOTALL).findall(elemento)
- scrapertools.printMatches(matches)
- return matches
- #=================================================================
- #-----------------------------------------------------------------
- def log(funzione="",stringa="",canale=__channel__):
- if DEBUG:logger.info("[" + canale + "].[" + funzione + "] " + stringa)
- xbmc.log("[" + canale + "].[" + funzione + "] " + stringa)
- #=================================================================
- def elimina_superfluo(titolo):
- titolo=scrapertools.decodeHtmlentities(titolo)
- titolo=titolo.lower()
- titolo = titolo.split("sub")
- return titolo[0]
- #-----------------------------------------------------------------
- def HomePage(item):
- xbmc.executebuiltin("ReplaceWindow(10024,plugin://plugin.video.streamondemand)")
- #=================================================================
- #=================================================================
- # riferimenti di servizio
- #-----------------------------------------------------------------
- AnimeThumbnail="http://img15.deviantart.net/f81c/i/2011/173/7/6/cursed_candies_anime_poster_by_careko-d3jnzg9.jpg"
- AnimeFanart="https://i.ytimg.com/vi/IAlbvyBdYdY/maxresdefault.jpg"
- CategoriaThumbnail="http://static.europosters.cz/image/750/poster/street-fighter-anime-i4817.jpg"
- CategoriaFanart="https://i.ytimg.com/vi/IAlbvyBdYdY/maxresdefault.jpg"
- CercaThumbnail="http://dc467.4shared.com/img/fEbJqOum/s7/13feaf0c8c0/Search"
- CercaFanart="https://i.ytimg.com/vi/IAlbvyBdYdY/maxresdefault.jpg"
- HomeTxt = "[COLOR yellow]Torna Home[/COLOR]"
- AvantiTxt="[COLOR orange]Successivo>>[/COLOR]"
- AvantiImg="http://2.bp.blogspot.com/-fE9tzwmjaeQ/UcM2apxDtjI/AAAAAAAAeeg/WKSGM2TADLM/s1600/pager+old.png"
Advertisement
Add Comment
Please, Sign In to add comment