コード例 #1
0
ファイル: providersUtils.py プロジェクト: harddevelop/tvbox
def drawPastebinCom():
    param = urllib.quote_plus(str(XBMCUtils.getSettingFromContext(sys.argv[1], "pastebin_param")))
    logger.debug("extracted param to be searched: " + param)
    channels = Pastebin.searchLists(param=param)
    logger.debug("items obtained: " + str(len(channels)))
    level = 1
    for channel in channels:
        add_dir(channel["title"], channel["link"], level, "", "pastebincom", channel["link"])
コード例 #2
0
ファイル: addon.py プロジェクト: harddevelop/tvbox
def browse_channels(url,page): #BROWSES ALL PROVIDERS (it has been re-sorted)
	#static content
	add_dir("HDFull.tv", 'hdfulltv', 4, "http://hdfull.tv/templates/hdfull/images/logo.png", 'hdfulltv' , 0)
	add_dir("Youtube.com", 'youtube', 4, "https://upload.wikimedia.org/wikipedia/commons/thumb/e/ef/YouTube_logo_2015.svg/120px-YouTube_logo_2015.svg.png", 'youtube', 0)
	add_dir("TuneIn.com", 'tunein', 4,"https://lh5.googleusercontent.com/-NsniPTwZFkc/AAAAAAAAAAI/AAAAAAAAOLE/qtdbWIxlF5M/s0-c-k-no-ns/photo.jpg",'tunein', 0)
	enableYomvi = XBMCUtils.getSettingFromContext(int(sys.argv[1]), "enable_yomvi")
	if enableYomvi == "true":
		add_dir("Yomvi.es", 'yomvies', 4, "http://ver.movistarplus.es/img/logo-web-player-YOMVI.png", 'yomvies', 0)
	enableSplive = XBMCUtils.getSettingFromContext(int(sys.argv[1]), "enable_splive")
	if enableSplive=="true":
		add_dir("Spliveapp.com", 'splive', 4, "http://www.spliveapp.com/main/wp-content/uploads/footer_logo.png", 'splive' , 0)
	enableMobdro = XBMCUtils.getSettingFromContext(int(sys.argv[1]), "enable_mobdro")
	if enableMobdro=='true':
		add_dir("Mobdro.com", 'mobdro', 4, "https://www.mobdro.com/favicon.ico",'mobdro', 0)

	enablePlexus = XBMCUtils.getSettingFromContext(int(sys.argv[1]), "enable_plexus")
	if enablePlexus=="true":
		add_dir("Arenavision.in", 'arenavisionin', 4, "http://www.arenavision.in/sites/default/files/logo_av2015.png", 'arenavisionin' , 0)
		add_dir("Ace-tv.ru", 'acetvru', 4, "http://ace-tv.eu/logo.png", 'acetvru' , 0)

	enableNews = XBMCUtils.getSettingFromContext(int(sys.argv[1]), "enable_news")
	if enableNews=="true":
		add_dir("Bbc.co.uk",'bbccouk', 4, "", 'bbccouk', 'http://feeds.bbci.co.uk/news/rss.xml?edition=int')
		add_dir("Reuters.com", 'reuters', 4, "http://www.thewrap.com/wp-content/uploads/2013/10/Reuters-Logo.jpg", 'reuters', 0)
	add_dir("Streamgaroo.com", 'streamgaroo', 4, "http://www.streamgaroo.com/images/logo.png", 'streamgaroo', 0)
	add_dir("Tvshow.me", 'tvshowme', 4, "http://www.tvshow.me/wp-content/uploads/2016/09/Icon_.png", 'tvshowme', 0)
	#sports with event
	#add_dir("Sportstream365.com", 'sportstream365com', 4, "http://sportstream365.com/img/logo.png", 'sportstream365com' , 0)
	add_dir("Mamahd.com", 'mamahdcom', 4, "http://mamahd.com/images/logo.png", 'mamahdcom' , 0)
	#add_dir("Live9.co", 'live9', 4, "", 'live9' , 0)
	#world tv
	add_dir("Filmon.com", 'filmon', 4, "http://static.filmon.com/theme/img/filmon_small_logo.png", 'filmoncom', 0)
	#add_dir("Youtvgratis.com", 'youtvgratis', 4, "http://youtvgratis.com/themes/tutvplayer/img/logo.gif", 'youtvgratis', 0)
	#add_dir("Zoptv.com", 'zoptv', 4, "http://www.zoptv.com/images/logo.png", 'zoptv' , 0)

	add_dir("Cricfree.tv", 'cricfree', 4, "http://cricfree.tv/images/logosimg.png", 'cricfree' , 0)
	#add_dir("Sports4u.tv", 'sports4u', 4, "http://live.sports4u.tv/wp-content/uploads/logo3.png", 'sports4u' , 0)
	#add_dir("Showsport-tv.com", 'showsporttvcom', 4, "http://showsport-tv.com/images/logoh.png", 'showsporttvcom', 0)

	add_dir("Vipracing.net", 'vipracinginfo', 4, "", 'vipracinginfo', 0)
	add_dir("Zonasports.me", 'zonasportsme', 4, "http://i.imgur.com/yAuKRZw.png", 'zonasportsme', 0)
	#patched ffmpeg sites
	patchedFfmpeg = XBMCUtils.getSettingFromContext(int(sys.argv[1]), "ffmpeg_patch")
	if patchedFfmpeg == "true":
		add_dir("Cinestrenostv.tv", 'cineestrenos', 4, "http://i.imgur.com/z3CINCU.jpg", 'cineestrenos',0)  # TODO, put in settings a download and install ffmpeg patched by platform
		add_dir("Vipgoal.net", 'vigoal', 4, "http://vipgoal.net/VIPgoal/img/logo.png", 'vigoal', 0)
	#webcams and others
	add_dir("Skylinewebcams.com", 'skylinewebcams', 4, "http://www.skylinewebcams.com/website.jpg", 'skylinewebcams' , 0)
	enableDinamic = XBMCUtils.getSettingFromContext(int(sys.argv[1]), "enable_pastebin")
	if enableDinamic =="true":
		add_dir("Ramalin.com", 'ramalin', 4, "http://websites-img.milonic.com/img-slide/420x257/r/ramalin.com.png", 'ramalin', 0)
		add_dir("Pastebin.com", 'pastebincom', 4, "", 'pastebincom', 0)
		add_dir("Redeneobux.com", 'redeneobuxcom', 4, "", 'redeneobuxcom', 0)
コード例 #3
0
ファイル: addon.py プロジェクト: harddevelop/tvbox
def get_main_dirs():

	##CONSTANTS PARTS##
	MAIN_URL = XBMCUtils.getSettingFromContext(sys.argv[1], "remote_repository")
	BROWSE_CHANNELS = "browse_channels"
	ICON = XBMCUtils.getAddonFilePath('icon.png')

	#draw welcome menu
	add_dir(XBMCUtils.getString(10001), MAIN_URL, 1, ICON,'', 0)
	add_dir(XBMCUtils.getString(10010), BROWSE_CHANNELS, 3, '', ICON, 0)
	try:
		from window.ImageWindow import windowImage  # teletext window library
		add_dir(name=XBMCUtils.getString(10012), url='teletext', mode=4, provider='teletext', page=0,thumbnailImage="",iconimage=ICON)
	except:
		logger.info("No PIL module installed (needs Pillow 3.4.2 or less)")
		pass
	#add_dir(name,url,mode,iconimage,provider,page="", thumbnailImage=''):
	try:
		if updater.isUpdatable():
			add_dir(XBMCUtils.getString(10011), '', 0, ICON, 0)
	except:
		logger.error("Couldn't add update option: probably server is down!")
		pass
コード例 #4
0
ファイル: updater.py プロジェクト: harddevelop/tvbox
import urllib2,os,sys
from core.xbmcutils import XBMCUtils
from core import logger
from core import downloadtools
from core import ziptools
import time
import CommonFunctions as common

REMOTE_FILE_XML = XBMCUtils.getSettingFromContext(sys.argv[1],"remote_updater")

ROOT_DIR = XBMCUtils.getAddonInfo('path')

def install(remote_file,id,folder):
    #first check if plexus exists, and where
    logger.info("installing "+id+"... ")

    addons_dir = XBMCUtils.getAddonsDir()
    logger.debug("Addons dir set to: "+addons_dir)

    localfile = ROOT_DIR+"/install.zip"

    downloadtools.downloadfile(remote_file, localfile, notStop=False)
    logger.debug("Download done, now it's time to unzip")
    unzipper = ziptools.ziptools()
    if folder == '':
        unzipper.extract(localfile,addons_dir) #github issues
    else:
        unzipper.extractReplacingMainFolder(localfile,addons_dir,folder)
    logger.debug("Unzip done! cleaning...")
    os.remove(localfile)
    logger.info("Additional addon clean done!")
コード例 #5
0
ファイル: cinestrenostv.py プロジェクト: harddevelop/tvbox
    def getChannels(page):
        logger.debug("starting with page from cineestrenos section: "+page)
        if str(page) == '0':
            tradicionalChannels = XBMCUtils.getSettingFromContext(int(sys.argv[1]), "extended_channels")
            logger.debug("using carrusel: "+str(tradicionalChannels))
            if tradicionalChannels=="false":
                page = Cineestrenostv.MAIN_URL+'/carrusel/tv.html'
            else:
                page = Cineestrenostv.MAIN_URL
        html = Cineestrenostv.getContentFromUrl(page,"","",Cineestrenostv.MAIN_URL)
        x = []
        logger.debug("page is: "+page)
        if page.find("/carrusel/tv.html")>-1:
            table = Decoder.extract('<div class="container">',"</div></div></div></div></div>",html)
            for fieldHtml in table.split('<div class="content">'):
                element = {}
                element["link"] = Cineestrenostv.MAIN_URL+Decoder.extract("<div><a href=\"javascript:popUp('..","')",fieldHtml)
                if element["link"] != Cineestrenostv.MAIN_URL:
                    if element["link"].find('/multi')!=-1:
                        logger.debug("found multi link: "+element["link"])
                        element["title"] = Decoder.extract("/multi","/",element["link"])
                    else:
                        element["title"] = Decoder.rExtract("/",".html",element["link"])
                        if element["title"].find(".")>-1:
                            element["title"] = element["title"][:element["title"].rfind(".")]
                    element["thumbnail"] = Decoder.extract(' src="','"',fieldHtml)
                    if element["thumbnail"].find("://")==-1:
                        element["thumbnail"] = Cineestrenostv.MAIN_URL+element["thumbnail"]
                    element["title"] = element["title"].replace("-"," ")
                    logger.debug("found title: "+element["title"]+", link: "+element["link"]+", thumb: "+element["thumbnail"])
                    if element["thumbnail"].find("http")==0 and not(element["title"]=="1" or element["title"]=="venus"):
                        x.append(element)
        elif page == Cineestrenostv.MAIN_URL:
            table = Decoder.extract('<center><table>','</td></tr></table></center>',html)
            for fieldHtml in table.split('<td>'):
                element = {}
                element["link"] = Cineestrenostv.MAIN_URL+"/"+Decoder.extract("<a href=\"/",'"',fieldHtml)
                if element["link"].find('"')>-1:
                    element["link"] = element["link"][0:element["link"].find('"')]
                if element["link"].find('/multi')!=-1:
                    logger.debug("found multi link: "+element["link"])
                    element["title"] = Decoder.extract("/multi","/",element["link"])
                else:
                    logger.debug("found normal link, continue... "+ element["link"])
                    element["title"] = Decoder.extract('" title="','" target',fieldHtml)
                    if element["title"].find('"')>-1:
                        element["title"] = element["title"][0:element["title"].find('"')]
                    if element["title"].find(" online")>-1:
                        element["title"] = element["title"][0:element["title"].find(" online")]
                    if element["title"].find(" Online")>-1:
                        element["title"] = element["title"][0:element["title"].find(" Online")]
                    if element["title"].find(" en directo")>-1:
                        element["title"] = element["title"][0:element["title"].find(" en directo")]

                    element["title"] = element["title"].replace("ver ","")

                #element["title"] = element["title"].decode('utf-8')
                element["thumbnail"] = Decoder.extract('<img src="','" height',fieldHtml)
                if element["thumbnail"].find('"')>-1:
                    element["thumbnail"] = element["thumbnail"][0:element["thumbnail"].find('"')]
                if element["thumbnail"].find("://")==-1:
                    element["thumbnail"] = Cineestrenostv.MAIN_URL+element["thumbnail"]
                if element["thumbnail"]!=Cineestrenostv.MAIN_URL:
                    logger.debug("found title: "+element["title"]+", link: "+element["link"]+", thumb: "+element["thumbnail"])
                    if element["thumbnail"].find("http")==0 and not(element["title"]=="1" or element["title"]=="gran hermano mexico" or element["title"]=="alx syfy" or element["title"]=="intereconomia punto pelota" or element["title"]=="cine" or element["title"].find("-LATINOAMERICA")>-1):
                        x.append(element)
        else:
            logger.debug('extracting channel from: '+page)
            x.append(Cineestrenostv.extractChannel(html,page))
        return x