def MakePlaylistFromList(Listdata,title="default"):
	logger.info("[%s.py] MakePlaylistFromList" %CHANNELNAME)
	
	if title== ("default" or ""):
		nombrefichero = FULL_FILENAME_PATH
	else:
		nombrefichero = os.path.join( downloadtools.getDownloadPath(),title + ".pls")

	if len(Listdata)>0:
		playlistFile = open(nombrefichero,"w")
		playlistFile.write("[playlist]\n")
		playlistFile.write("\n")
		c = 0		
		for match in Listdata:
			c += 1
			playlistFile.write("File%d=%s\n"  %(c,match[1]))
			playlistFile.write("Title%d=%s\n" %(c,match[0]))
			playlistFile.write("\n")
			
		playlistFile.write("NumberOfEntries=%d\n" %c)
		playlistFile.write("Version=2\n")
		playlistFile.flush();
		playlistFile.close()	
		return nombrefichero,c
	else:
		return ""
Example #2
0
def MakePlaylistFromList(Listdata, title="default"):
    logger.info("[%s.py] MakePlaylistFromList" % CHANNELNAME)

    if title == ("default" or ""):
        nombrefichero = FULL_FILENAME_PATH
    else:
        nombrefichero = os.path.join(downloadtools.getDownloadPath(),
                                     title + ".pls")

    if len(Listdata) > 0:
        playlistFile = open(nombrefichero, "w")
        playlistFile.write("[playlist]\n")
        playlistFile.write("\n")
        c = 0
        for match in Listdata:
            c += 1
            playlistFile.write("File%d=%s\n" % (c, match[1]))
            playlistFile.write("Title%d=%s\n" % (c, match[0]))
            playlistFile.write("\n")

        playlistFile.write("NumberOfEntries=%d\n" % c)
        playlistFile.write("Version=2\n")
        playlistFile.flush()
        playlistFile.close()
        return nombrefichero
    else:
        return ""
def MakePlaylistFromXML(xmlurl,title="default"):
	logger.info("[%s.py] MakePlaylistFromXML" %CHANNELNAME)
	
	if title== ("default" or ""):
		nombrefichero = FULL_FILENAME_PATH_XML
	else:
		nombrefichero = os.path.join( downloadtools.getDownloadPath(),title + ".pls")
	xmldata = scrapertools.cachePage(xmlurl)
	patron = '<title>([^<]+)</title>.*?<location>([^<]+)</location>'
	matches = re.compile(patron,re.DOTALL).findall(xmldata)
	if len(matches)>0:
		playlistFile = open(nombrefichero,"w")
		playlistFile.write("[playlist]\n")
		playlistFile.write("\n")
		c = 0		
		for match in matches:
			c += 1
			playlistFile.write("File%d=%s\n"  %(c,match[1]))
			playlistFile.write("Title%d=%s\n" %(c,match[0]))
			playlistFile.write("\n")
			
		playlistFile.write("NumberOfEntries=%d\n" %c)
		playlistFile.write("Version=2\n")
		playlistFile.flush();
		playlistFile.close()	
		return nombrefichero,c
	else:
		return ""
def mainlist(params, url, category):
    xbmc.output("[descargados.py] mainlist")

    # Verifica ruta de descargas
    downloadpath = downloadtools.getDownloadPath()

    xbmctools.addnewfolder("descargadoslist", "mainlist", category, "Descargas pendientes", "", "", "")
    xbmctools.addnewfolder("descargadoslist", "errorlist", category, "Descargas con error", "", "", "")

    # Añade al listado de XBMC
    try:
        ficheros = os.listdir(downloadpath)
        for fichero in ficheros:
            if (
                fichero != "lista"
                and fichero != "error"
                and not fichero.endswith(".nfo")
                and not fichero.endswith(".tbn")
            ):
                url = os.path.join(downloadpath, fichero)
                listitem = xbmcgui.ListItem(fichero, iconImage="DefaultVideo.png")
                xbmcplugin.addDirectoryItem(handle=pluginhandle, url=url, listitem=listitem, isFolder=False)
    except:
        pass

        # Label (top-right)...
    xbmcplugin.setPluginCategory(handle=int(sys.argv[1]), category=category)

    # Disable sorting...
    xbmcplugin.addSortMethod(handle=int(sys.argv[1]), sortMethod=xbmcplugin.SORT_METHOD_NONE)

    # End of directory...
    xbmcplugin.endOfDirectory(handle=int(sys.argv[1]), succeeded=True)
Example #5
0
def MakePlaylistFromXML(xmlurl, title="default"):
    logger.info("[%s.py] MakePlaylistFromXML" % CHANNELNAME)

    if title == ("default" or ""):
        nombrefichero = FULL_FILENAME_PATH_XML
    else:
        nombrefichero = os.path.join(downloadtools.getDownloadPath(),
                                     title + ".pls")
    xmldata = scrapertools.cachePage(xmlurl)
    patron = '<title>([^<]+)</title>.*?<location>([^<]+)</location>'
    matches = re.compile(patron, re.DOTALL).findall(xmldata)
    if len(matches) > 0:
        playlistFile = open(nombrefichero, "w")
        playlistFile.write("[playlist]\n")
        playlistFile.write("\n")
        c = 0
        for match in matches:
            c += 1
            playlistFile.write("File%d=%s\n" % (c, match[1]))
            playlistFile.write("Title%d=%s\n" % (c, match[0]))
            playlistFile.write("\n")

        playlistFile.write("NumberOfEntries=%d\n" % c)
        playlistFile.write("Version=2\n")
        playlistFile.flush()
        playlistFile.close()
        return nombrefichero
    else:
        return ""
Example #6
0
def mainlist(params,url,category):
	logger.info("[configuracion.py] mainlist")
	
	# Verifica ruta de descargas
	downloadpath = downloadtools.getDownloadPath()
	downloadlistpath = downloadtools.getDownloadListPath()

	config.openSettings( )
Example #7
0
def mainlist(params, url, category):
    logger.info("[configuracion.py] mainlist")

    # Verifica ruta de descargas
    downloadpath = downloadtools.getDownloadPath()
    downloadlistpath = downloadtools.getDownloadListPath()

    config.openSettings()
def mainlist(params,url,category):
	xbmc.output("[configuracion.py] mainlist")
	
	# Verifica ruta de descargas
	downloadpath = downloadtools.getDownloadPath()
	downloadlistpath = downloadtools.getDownloadListPath()
	
	xbmcplugin.openSettings( sys.argv[ 0 ] )
Example #9
0
def mainlist(params, url, category):
    xbmc.output("[configuracion.py] mainlist")

    # Verifica ruta de descargas
    downloadpath = downloadtools.getDownloadPath()
    downloadlistpath = downloadtools.getDownloadListPath()

    xbmcplugin.openSettings(sys.argv[0])
def ListaCat(params,url,category):
	logger.info("[cineadicto.py] ListaCat")
	import downloadtools
	nombrefichero = ""
	fullpath = os.path.join( downloadtools.getDownloadPath(),"subtitulos" , nombrefichero )
	urlfile = "http://www.subtitulos.es/updated/5/10855/0"
	fullnombrefichero = downloadtools.downloadfileGzipped(urlfile,fullpath)
	print fullnombrefichero
	fichero = os.path.basename(fullnombrefichero).encode('utf-8')
	print fichero
	fichero = u'%s' %fichero
	print fichero
	
	
	
	xbmctools.addnewfolder( CHANNELNAME ,"ListvideosMirror", category , "Acci�n","http://www.cine-adicto.com/category/categorias/accion/","","")
	xbmctools.addnewfolder( CHANNELNAME ,"ListvideosMirror", category , "Animado","http://www.cine-adicto.com/category/categorias/animado/","","")
	xbmctools.addnewfolder( CHANNELNAME ,"ListvideosMirror", category , "Anime","http://www.cine-adicto.com/category/categorias/anime/","","")
	xbmctools.addnewfolder( CHANNELNAME ,"ListvideosMirror", category , "Asi�ticas","http://www.cine-adicto.com/category/categorias/asiaticas/","","")
	xbmctools.addnewfolder( CHANNELNAME ,"ListvideosMirror", category , "Aventuras","http://www.cine-adicto.com/category/categorias/aventura/","","")
	xbmctools.addnewfolder( CHANNELNAME ,"ListvideosMirror", category , "Ciencia-Ficci�n","http://www.cine-adicto.com/category/categorias/ciencia-ficcion/","","")
	xbmctools.addnewfolder( CHANNELNAME ,"ListvideosMirror", category , "Cl�sicos","http://www.cine-adicto.com/category/categorias/clasicos/","","")
	xbmctools.addnewfolder( CHANNELNAME ,"listvideosMirror", category , "Comedia","http://www.cine-adicto.com/category/categorias/comedia/","","")
	xbmctools.addnewfolder( CHANNELNAME ,"listvideosMirror", category , "Comedias Romanticas","http://www.cine-adicto.com/category/categorias/comedias-romanticas/","","")
	xbmctools.addnewfolder( CHANNELNAME ,"listvideosMirror", category , "Destacado","http://www.cine-adicto.com/category/categorias/destacado/","","")
	xbmctools.addnewfolder( CHANNELNAME ,"listvideosMirror", category , "Documentales","http://www.cine-adicto.com/category/categorias/documentales/","","")
	xbmctools.addnewfolder( CHANNELNAME ,"ListvideosMirror", category , "Drama","http://www.cine-adicto.com/category/categorias/drama/","","")
	xbmctools.addnewfolder( CHANNELNAME ,"ListvideosMirror", category , "Espa�ol Latino","http://www.cine-adicto.com/category/categorias/espanol-latino/","","")
	xbmctools.addnewfolder( CHANNELNAME ,"ListvideosMirror", category , "Estreno","http://www.cine-adicto.com/category/categorias/estreno/","","")
	xbmctools.addnewfolder( CHANNELNAME ,"ListvideosMirror", category , "Infantil","http://www.cine-adicto.com/category/categorias/infantil/","","")
	xbmctools.addnewfolder( CHANNELNAME ,"listvideosMirror", category , "Intriga","http://www.cine-adicto.com/category/categorias/intriga/","","")
	xbmctools.addnewfolder( CHANNELNAME ,"ListvideosMirror", category , "Musicales","http://www.cine-adicto.com/category/categorias/musicales/","","")
	xbmctools.addnewfolder( CHANNELNAME ,"listvideosMirror", category , "Peliculas HD","http://www.cine-adicto.com/category/categorias/peliculas-hd-categorias/","","")
	xbmctools.addnewfolder( CHANNELNAME ,"ListvideosMirror", category , "Romance","http://www.cine-adicto.com/category/categorias/romance/","","")
	xbmctools.addnewfolder( CHANNELNAME ,"listvideosMirror", category , "Suspenso","http://www.cine-adicto.com/category/categorias/suspenso/","","")
	xbmctools.addnewfolder( CHANNELNAME ,"ListvideosMirror", category , "Terror","http://www.cine-adicto.com/category/categorias/terror/","","")
	xbmctools.addnewfolder( CHANNELNAME ,"ListvideosMirror", category , "Thriller","http://www.cine-adicto.com/category/categorias/thriller/","","")
	xbmctools.addnewfolder( CHANNELNAME ,"ListvideosMirror", category , "Western","http://www.cine-adicto.com/category/categorias/western/","","")
	
	# Asigna el t�tulo, desactiva la ordenaci�n, y cierra el directorio
	xbmcplugin.setPluginCategory( handle=pluginhandle, category=category )
	xbmcplugin.addSortMethod( handle=pluginhandle, sortMethod=xbmcplugin.SORT_METHOD_NONE )
	xbmcplugin.endOfDirectory( handle=pluginhandle, succeeded=True )
Example #11
0
def creartag(params, url, category):
    nombrefichero = os.path.join(downloadtools.getDownloadPath(), "sonolatino_category.txt")
    data = scrapertools.cachePage(url)
    patron = '<ul id="ul_categories">(.*?)</ul>'
    matches = re.compile(patron, re.DOTALL).findall(data)
    if len(matches) > 0:
        patron = '<li><a href="([^"]+)">([^<]+)</a></li>'
        matches2 = re.compile(patron, re.DOTALL).findall(matches[0])
        if len(matches2) > 0:
            filetag = open(nombrefichero, "w")

            for match in matches2:
                filetag.write(
                    'xbmctools.addnewfolder(CHANNELNAME , "listatipoVideo" , category , "%s","%s","","")\n'
                    % (match[1], match[0])
                )

            filetag.flush()
            filetag.close()
            print "Lista tag creada correctamente"
        else:
            print "no encontro ningun tag"
    xbmcplugin.endOfDirectory(handle=pluginhandle, succeeded=True)
Example #12
0
def mainlist(params, url, category):
    logger.info("[descargados.py] mainlist")

    # Verifica ruta de descargas
    downloadpath = downloadtools.getDownloadPath()

    xbmctools.addnewfolder("descargadoslist", "mainlist", category,
                           "Descargas pendientes", "", "", "")
    xbmctools.addnewfolder("descargadoslist", "errorlist", category,
                           "Descargas con error", "", "", "")

    # Añade al listado de XBMC
    try:
        ficheros = os.listdir(downloadpath)
        for fichero in ficheros:
            if fichero != "lista" and fichero != "error" and not fichero.endswith(
                    ".nfo") and not fichero.endswith(".tbn"):
                url = os.path.join(downloadpath, fichero)
                listitem = xbmcgui.ListItem(fichero,
                                            iconImage="DefaultVideo.png")
                xbmcplugin.addDirectoryItem(handle=pluginhandle,
                                            url=url,
                                            listitem=listitem,
                                            isFolder=False)
    except:
        pass

    # Label (top-right)...
    xbmcplugin.setPluginCategory(handle=int(sys.argv[1]), category=category)

    # Disable sorting...
    xbmcplugin.addSortMethod(handle=int(sys.argv[1]),
                             sortMethod=xbmcplugin.SORT_METHOD_NONE)

    # End of directory...
    xbmcplugin.endOfDirectory(handle=int(sys.argv[1]), succeeded=True)
Example #13
0
# http://blog.tvalacarta.info/plugin-xbmc/pelisalacarta/
#------------------------------------------------------------

import re, sys, os
import urlparse, urllib, urllib2
import os.path
import sys
import scrapertools
import config
import downloadtools
import logger

DEBUG = True
CHANNELNAME = "xmltoplaylist"
PLAYLIST_XML_FILENAME_TEMP = "video_playlist.xml.temp.pls"
FULL_FILENAME_PATH_XML = os.path.join(downloadtools.getDownloadPath(),
                                      PLAYLIST_XML_FILENAME_TEMP)
PLAYLIST_FILENAME_TEMP = "video_playlist.temp.pls"
FULL_FILENAME_PATH = os.path.join(downloadtools.getDownloadPath(),
                                  PLAYLIST_FILENAME_TEMP)


def geturl(xmlurl, title="default"):
    logger.info("[xmltoplaylist.py] geturl")

    return MakePlaylistFromXML(xmlurl)


def MakePlaylistFromXML(xmlurl, title="default"):
    logger.info("[%s.py] MakePlaylistFromXML" % CHANNELNAME)
Example #14
0
import scrapertools
import megavideo
import servertools
import binascii
import xbmctools
import config
import logger
import downloadtools
import vk
from xml.dom import minidom
from xml.dom import EMPTY_NAMESPACE

CHANNELNAME = "pelisflv"
ATOM_NS = 'http://www.w3.org/2005/Atom'
PLAYLIST_FILENAME_TEMP = "video_playlist.temp.pls"
FULL_FILENAME_PATH = os.path.join( downloadtools.getDownloadPath(), PLAYLIST_FILENAME_TEMP )


# Esto permite su ejecuci�n en modo emulado
try:
	pluginhandle = int( sys.argv[ 1 ] )
except:
	pluginhandle = ""

# Traza el inicio del canal
logger.info("[pelisflv.py] init")

DEBUG = True

def mainlist(params,url,category):
	logger.info("[pelisflv.py] mainlist")