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

	import xbmctools

	# Crea un listado con las entradas de favoritos
	if usingsamba:
		ficheros = samba.get_files(BOOKMARK_PATH)
	else:
		ficheros = os.listdir(BOOKMARK_PATH)
	ficheros.sort()
	for fichero in ficheros:

		try:
			# Lee el bookmark
			titulo,thumbnail,plot,server,url = readbookmark(fichero)

			# Crea la entrada
			# En la categoría va el nombre del fichero para poder borrarlo
			xbmctools.addnewvideo( CHANNELNAME , "play" , os.path.join( BOOKMARK_PATH, fichero ) , server , titulo , url , thumbnail, plot )
		except:
			pass

	# Label (top-right)...
	xbmcplugin.setPluginCategory( handle=int( sys.argv[ 1 ] ), category=category )
	xbmcplugin.addSortMethod( handle=int( sys.argv[ 1 ] ), sortMethod=xbmcplugin.SORT_METHOD_NONE )
	xbmcplugin.endOfDirectory( handle=int( sys.argv[ 1 ] ), succeeded=True )
Example #2
0
def mainlist(params,url,category):
    logger.info("[descargadoslist.py] mainlist")

    import xbmctools

    # Crea un listado con las entradas de la lista
    if usingsamba:
        ficheros = samba.get_files(DOWNLOAD_PATH)
    else:
        ficheros = os.listdir(DOWNLOAD_PATH)
    ficheros.sort()
    
    for fichero in ficheros:
        #xbmc.output("fichero="+fichero)
        try:
            # Lee el bookmark
            titulo,thumbnail,plot,server,url = readbookmark(fichero)

            # Crea la entrada
            # En la categoría va el nombre del fichero para poder borrarlo
            xbmctools.addnewvideo( CHANNELNAME , "play" , os.path.join( DOWNLOAD_PATH, fichero ) , server , titulo , url , thumbnail, plot )
        except:
            pass
            logger.info("[downloadall.py] error al leer bookmark")
            for line in sys.exc_info():
                logger.error( "%s" % line )

    xbmctools.addnewvideo( CHANNELNAME , "downloadall" , "category" , "server" , "(Empezar la descarga de la lista)" , "" , os.path.join(IMAGES_PATH, "Crystal_Clear_action_db_update.png"), "" )

    # Label (top-right)...
    xbmcplugin.setPluginCategory( handle=int( sys.argv[ 1 ] ), category=category )
    xbmcplugin.addSortMethod( handle=int( sys.argv[ 1 ] ), sortMethod=xbmcplugin.SORT_METHOD_NONE )
    xbmcplugin.endOfDirectory( handle=int( sys.argv[ 1 ] ), succeeded=True )
def mainlist(item):
    logger.info("[favoritos.py] mainlist")
    itemlist=[]

    # Crea un listado con las entradas de favoritos
    if usingsamba(BOOKMARK_PATH):
        ficheros = samba.get_files(BOOKMARK_PATH)
    else:
        ficheros = os.listdir(BOOKMARK_PATH)
    
    # Ordena el listado por nombre de fichero (orden de incorporación)
    ficheros.sort()
    
    # Rellena el listado
    for fichero in ficheros:

        try:
            # Lee el bookmark
            canal,titulo,thumbnail,plot,server,url,fulltitle = readbookmark(fichero)
            if canal=="":
                canal="favoritos"

            # Crea la entrada
            # En extra va el nombre del fichero para poder borrarlo
            ## <-- Añado fulltitle con el titulo de la peli
            itemlist.append( Item( channel=canal , action="play" , url=url , server=server, title=fulltitle, thumbnail=thumbnail, plot=plot, fanart=thumbnail, extra=os.path.join( BOOKMARK_PATH, fichero ), fulltitle=fulltitle, folder=False ))
        except:
            for line in sys.exc_info():
                logger.error( "%s" % line )
    
    return itemlist
Example #4
0
def savebookmark(
    canal=CHANNELNAME, titulo="", url="", thumbnail="", server="", plot="", fulltitle="", savepath=BOOKMARK_PATH
):
    logger.info("[favoritos.py] savebookmark(path=" + savepath + ")")

    # Crea el directorio de favoritos si no existe
    if not usingsamba(savepath):
        try:
            os.mkdir(savepath)
        except:
            pass

    # Lee todos los ficheros
    if usingsamba(savepath):
        ficheros = samba.get_files(savepath)
    else:
        ficheros = os.listdir(savepath)
    ficheros.sort()

    # Averigua el último número
    if len(ficheros) > 0:
        # XRJ: Linea problemática, sustituida por el bucle siguiente
        # filenumber = int( ficheros[len(ficheros)-1][0:-4] )+1
        filenumber = 1
        for fichero in ficheros:
            logger.info("[favoritos.py] fichero=" + fichero)
            try:
                tmpfilenumber = int(fichero[0:8]) + 1
                if tmpfilenumber > filenumber:
                    filenumber = tmpfilenumber
            except:
                pass
    else:
        filenumber = 1

    # Genera el contenido
    filecontent = ""
    filecontent = filecontent + urllib.quote_plus(downloadtools.limpia_nombre_excepto_1(titulo)) + "\n"
    filecontent = filecontent + urllib.quote_plus(url) + "\n"
    filecontent = filecontent + urllib.quote_plus(thumbnail) + "\n"
    filecontent = filecontent + urllib.quote_plus(server) + "\n"
    filecontent = filecontent + urllib.quote_plus(downloadtools.limpia_nombre_excepto_1(plot)) + "\n"
    filecontent = filecontent + urllib.quote_plus(fulltitle) + "\n"
    filecontent = filecontent + urllib.quote_plus(canal) + "\n"

    # Genera el nombre de fichero
    from core import scrapertools

    filename = "%08d-%s.txt" % (filenumber, scrapertools.slugify(fulltitle))
    logger.info("[favoritos.py] savebookmark filename=" + filename)

    # Graba el fichero
    if not usingsamba(savepath):
        fullfilename = os.path.join(savepath, filename)
        bookmarkfile = open(fullfilename, "w")
        bookmarkfile.write(filecontent)
        bookmarkfile.flush()
        bookmarkfile.close()
    else:
        samba.write_file(filename, filecontent, savepath)
Example #5
0
def mainlist(params,url,category):
    logger.info("[favoritos.py] mainlist")

    import xbmctools

    # Crea un listado con las entradas de favoritos
    if usingsamba:
        ficheros = samba.get_files(BOOKMARK_PATH)
    else:
        ficheros = os.listdir(BOOKMARK_PATH)
    ficheros.sort()
    for fichero in ficheros:

        try:
            # Lee el bookmark
            titulo,thumbnail,plot,server,url = readbookmark(fichero)

            # Crea la entrada
            # En la categoría va el nombre del fichero para poder borrarlo
            xbmctools.addnewvideo( CHANNELNAME , "play" , os.path.join( BOOKMARK_PATH, fichero ) , server , titulo , url , thumbnail, plot )
        except:
            pass

    # Label (top-right)...
    xbmcplugin.setPluginCategory( handle=int( sys.argv[ 1 ] ), category=category )
    xbmcplugin.addSortMethod( handle=int( sys.argv[ 1 ] ), sortMethod=xbmcplugin.SORT_METHOD_NONE )
    xbmcplugin.endOfDirectory( handle=int( sys.argv[ 1 ] ), succeeded=True )
def GuardarFavorito(item, Ruta=BOOKMARK_PATH):
    logger.info("[favoritos.py] GuardarFavorito")
    import time
    # Lee todos los ficheros
    if usingsamba(Ruta):
        ficheros = samba.get_files(Ruta)
    else:
        ficheros = os.listdir(Ruta)

    filename = str(int(time.time())) + ".json"
    fullfilename = os.path.join(Ruta,filename)
    logger.info("[favoritos.py] savebookmark filename="+filename)
    
    # Genera el contenido
    if item.refered_action: item.action = item.refered_action
    item.context =""
    item.file = fullfilename
    filecontent = item.tojson()

    # Graba el fichero
    import json
    if not usingsamba(Ruta):
        open(fullfilename.decode("utf-8"),"w").write(filecontent)
    else:
        samba.write_file(filename, filecontent, Ruta)
Example #7
0
def GuardarFavorito(item, Ruta=BOOKMARK_PATH):
    logger.info("[favoritos.py] GuardarFavorito")
    import time
    # Lee todos los ficheros
    if usingsamba(Ruta):
        ficheros = samba.get_files(Ruta)
    else:
        ficheros = os.listdir(Ruta)

    filename = str(int(time.time())) + ".json"
    fullfilename = os.path.join(Ruta, filename)
    logger.info("[favoritos.py] savebookmark filename=" + filename)

    # Genera el contenido
    if item.refered_action: item.action = item.refered_action
    item.context = ""
    item.file = fullfilename
    filecontent = item.tojson()

    # Graba el fichero
    import json
    if not usingsamba(Ruta):
        open(fullfilename.decode("utf-8"), "w").write(filecontent)
    else:
        samba.write_file(filename, filecontent, Ruta)
Example #8
0
def mainlist(item):
    logger.info("[favoritos.py] mainlist")
    itemlist=[]

    # Crea un listado con las entradas de favoritos
    if usingsamba(BOOKMARK_PATH):
        ficheros = samba.get_files(BOOKMARK_PATH)
    else:
        ficheros = os.listdir(BOOKMARK_PATH)
    
    # Ordena el listado por nombre de fichero (orden de incorporación)
    ficheros.sort()
    
    # Rellena el listado
    for fichero in ficheros:

        try:
            # Lee el bookmark
            canal,titulo,thumbnail,plot,server,url,fulltitle = readbookmark(fichero)
            if canal=="":
                canal="favoritos"

            # Crea la entrada
            # En extra va el nombre del fichero para poder borrarlo
            ## <-- Añado fulltitle con el titulo de la peli
            itemlist.append( Item( channel=canal , action="play" , url=url , server=server, title=fulltitle, thumbnail=thumbnail, plot=plot, fanart=thumbnail, extra=os.path.join( BOOKMARK_PATH, fichero ), fulltitle=fulltitle, folder=False ))
        except:
            for line in sys.exc_info():
                logger.error( "%s" % line )
    
    return itemlist
Example #9
0
def savebookmark(canal=CHANNELNAME,titulo="",url="",thumbnail="",server="",plot="",fulltitle="",savepath=BOOKMARK_PATH):
    logger.info("[favoritos.py] savebookmark(path="+savepath+")")

    # Crea el directorio de favoritos si no existe
    if not usingsamba(savepath):
        try:
            os.mkdir(savepath)
        except:
            pass

    # Lee todos los ficheros
    if usingsamba(savepath):
        ficheros = samba.get_files(savepath)
    else:
        ficheros = os.listdir(savepath)
    ficheros.sort()
    
    # Averigua el último número
    if len(ficheros)>0:
        # XRJ: Linea problemática, sustituida por el bucle siguiente
        #filenumber = int( ficheros[len(ficheros)-1][0:-4] )+1
        filenumber = 1
        for fichero in ficheros:
            logger.info("[favoritos.py] fichero="+fichero)
            try:
                tmpfilenumber = int( fichero[0:8] )+1
                if tmpfilenumber > filenumber:
                    filenumber = tmpfilenumber
            except:
                pass
    else:
        filenumber=1

    # Genera el contenido
    filecontent = ""
    filecontent = filecontent + urllib.quote_plus(downloadtools.limpia_nombre_excepto_1(titulo))+'\n'
    filecontent = filecontent + urllib.quote_plus(url)+'\n'
    filecontent = filecontent + urllib.quote_plus(thumbnail)+'\n'
    filecontent = filecontent + urllib.quote_plus(server)+'\n'
    filecontent = filecontent + urllib.quote_plus(downloadtools.limpia_nombre_excepto_1(plot))+'\n'
    filecontent = filecontent + urllib.quote_plus(fulltitle)+'\n'
    filecontent = filecontent + urllib.quote_plus(canal)+'\n'

    # Genera el nombre de fichero
    from core import scrapertools
    filename = '%08d-%s.txt' % (filenumber,scrapertools.slugify(fulltitle))
    logger.info("[favoritos.py] savebookmark filename="+filename)

    # Graba el fichero
    if not usingsamba(savepath):
        fullfilename = os.path.join(savepath,filename)
        bookmarkfile = open(fullfilename,"w")
        bookmarkfile.write(filecontent)
        bookmarkfile.flush();
        bookmarkfile.close()
    else:
        samba.write_file(filename, filecontent, savepath)
Example #10
0
def savebookmark(titulo,url,thumbnail,server,plot):
    logger.info("[favoritos.py] savebookmark")

    # No va bien más que en Windows
    #bookmarkfiledescriptor,bookmarkfilepath = tempfile.mkstemp(suffix=".txt",prefix="",dir=BOOKMARK_PATH)

    # Crea el directorio de favoritos si no existe
    if not usingsamba:
        try:
            os.mkdir(BOOKMARK_PATH)
        except:
            pass

    # Lee todos los ficheros
    if usingsamba:
        ficheros = samba.get_files(BOOKMARK_PATH)
    else:
        ficheros = os.listdir(BOOKMARK_PATH)
    ficheros.sort()
    #print ficheros
    #Filtra solo los ficheros
    ficheros2 = [f for f in ficheros
                if os.path.isfile(os.path.join(BOOKMARK_PATH, f)) and os.path.join(BOOKMARK_PATH, f).endswith(".txt")]

    # Averigua el último número
    if len(ficheros)>0:
        filenumber = int( ficheros[len(ficheros)-1][0:-4] )+1
    else:
        filenumber=1

    # Genera el contenido
    filecontent = ""
    filecontent = filecontent + urllib.quote_plus(downloadtools.limpia_nombre_excepto_1(titulo))+'\n'
    filecontent = filecontent + urllib.quote_plus(url)+'\n'
    filecontent = filecontent + urllib.quote_plus(thumbnail)+'\n'
    filecontent = filecontent + urllib.quote_plus(server)+'\n'
    filecontent = filecontent + urllib.quote_plus(downloadtools.limpia_nombre_excepto_1(plot))+'\n'

    # Genera el nombre de fichero    
    filename = '%08d.txt' % filenumber
    logger.info("[favoritos.py] savebookmark filename="+filename)

    # Graba el fichero
    if not usingsamba:
        fullfilename = os.path.join(BOOKMARK_PATH,filename)
        bookmarkfile = open(fullfilename,"w")
        bookmarkfile.write(filecontent)
        bookmarkfile.flush();
        bookmarkfile.close()
    else:
        samba.write_file(filename, filecontent, BOOKMARK_PATH)
def mainlist(item):
    logger.info("[favoritos.py] mainlist")
    itemlist=[]

    # Crea un listado con las entradas de favoritos
    if usingsamba(BOOKMARK_PATH):
        ficheros = samba.get_files(BOOKMARK_PATH)
    else:
        ficheros = os.listdir(BOOKMARK_PATH)
    ficheros.sort()
    
    # Rellena el listado
    for fichero in ficheros:
      itemlist.append(LeerFavorito(fichero))
    return itemlist
Example #12
0
def mainlist(item):
    logger.info("[favoritos.py] mainlist")
    itemlist = []

    # Crea un listado con las entradas de favoritos
    if usingsamba(BOOKMARK_PATH):
        ficheros = samba.get_files(BOOKMARK_PATH)
    else:
        ficheros = os.listdir(BOOKMARK_PATH)
    ficheros.sort()

    # Rellena el listado
    for fichero in ficheros:
        itemlist.append(LeerFavorito(fichero))
    return itemlist
def GuardarFavorito(item, Ruta=BOOKMARK_PATH):
    logger.info("[favoritos.py] GuardarFavorito")

    # Lee todos los ficheros
    if usingsamba(Ruta):
        ficheros = samba.get_files(Ruta)
    else:
        ficheros = os.listdir(Ruta)
    ficheros.sort()
    
    # Averigua el último número
    if len(ficheros)>0:
        # XRJ: Linea problemática, sustituida por el bucle siguiente
        #filenumber = int( ficheros[len(ficheros)-1][0:-4] )+1
        filenumber = 1
        for fichero in ficheros:
            logger.info("[favoritos.py] fichero="+fichero)
            try:
                tmpfilenumber = int( fichero[0:8] )+1
                if tmpfilenumber > filenumber:
                    filenumber = tmpfilenumber
            except:
                pass
    else:
        filenumber=1

    # Genera el nombre de fichero
    from core import scrapertools
    filename = '%08d-%s.txt' % (filenumber,scrapertools.slugify(item.title))
    fullfilename = os.path.join(Ruta,filename)
    logger.info("[favoritos.py] savebookmark filename="+filename)
    
    # Genera el contenido
    item.channel = "favoritos"
    item.extra = fullfilename
    filecontent = item.serialize()
    item.folder = False

    # Graba el fichero
    if not usingsamba(Ruta):
        bookmarkfile = open(fullfilename.decode("utf-8"),"w")
        bookmarkfile.write(filecontent)
        bookmarkfile.flush();
        bookmarkfile.close()
    else:
        samba.write_file(filename, filecontent, Ruta)
Example #14
0
def GuardarFavorito(item, Ruta=BOOKMARK_PATH):
    logger.info("[favoritos.py] GuardarFavorito")

    # Lee todos los ficheros
    if usingsamba(Ruta):
        ficheros = samba.get_files(Ruta)
    else:
        ficheros = os.listdir(Ruta)
    ficheros.sort()

    # Averigua el último número
    if len(ficheros) > 0:
        # XRJ: Linea problemática, sustituida por el bucle siguiente
        #filenumber = int( ficheros[len(ficheros)-1][0:-4] )+1
        filenumber = 1
        for fichero in ficheros:
            logger.info("[favoritos.py] fichero=" + fichero)
            try:
                tmpfilenumber = int(fichero[0:8]) + 1
                if tmpfilenumber > filenumber:
                    filenumber = tmpfilenumber
            except:
                pass
    else:
        filenumber = 1

    # Genera el nombre de fichero
    from core import scrapertools
    filename = '%08d-%s.txt' % (filenumber, scrapertools.slugify(item.title))
    fullfilename = os.path.join(Ruta, filename)
    logger.info("[favoritos.py] savebookmark filename=" + filename)

    # Genera el contenido
    item.channel = "favoritos"
    item.extra = fullfilename
    filecontent = item.serialize()
    item.folder = False

    # Graba el fichero
    if not usingsamba(Ruta):
        bookmarkfile = open(fullfilename.decode("utf-8"), "w")
        bookmarkfile.write(filecontent)
        bookmarkfile.flush()
        bookmarkfile.close()
    else:
        samba.write_file(filename, filecontent, Ruta)
Example #15
0
def errorlist(params,url,category):
    logger.info("[descargadoslist.py] errorlist")

    # Crea el directorio de la lista de descargas con error si no existe
    try:
        os.mkdir(DOWNLOAD_PATH)
    except:
        pass
    try:
        os.mkdir(ERROR_PATH)
    except:
        pass

    # Crea un listado con las entradas de favoritos
    logger.info("[downloadall.py] ERROR_PATH="+ERROR_PATH)
    # Crea un listado con las entradas de la lista
    if usingsamba:
        ficheros = samba.get_files(ERROR_PATH)
    else:
        ficheros = os.listdir(ERROR_PATH)
    ficheros.sort()
    
    for fichero in ficheros:
        logger.info("[downloadall.py] fichero="+fichero)
        try:
            # Lee el bookmark
            titulo,thumbnail,plot,server,url = readbookmarkfile(fichero,ERROR_PATH)

            # Crea la entrada
            # En la categoría va el nombre del fichero para poder borrarlo
            xbmctools.addnewvideo( CHANNELNAME , "playerror" , os.path.join( ERROR_PATH, fichero ) , server , titulo , url , thumbnail, plot )
        except:
            pass
            logger.info("[downloadall.py] error al leer bookmark")
            for line in sys.exc_info():
                logger.error( "%s" % line )

    # Label (top-right)...
    xbmcplugin.setPluginCategory( handle=int( sys.argv[ 1 ] ), category=category )
    xbmcplugin.addSortMethod( handle=int( sys.argv[ 1 ] ), sortMethod=xbmcplugin.SORT_METHOD_NONE )
    xbmcplugin.endOfDirectory( handle=int( sys.argv[ 1 ] ), succeeded=True )
Example #16
0
def downloadall(params,url,category):
    logger.info("[downloadall.py] downloadall")

    logger.info("[downloadall.py] DOWNLOAD_PATH=%s" % DOWNLOAD_PATH)

    if usingsamba:
        lista = samba.get_files(DOWNLOAD_PATH)
    else:
        lista = os.listdir(DOWNLOAD_PATH)
    lista.sort()

    logger.info("[downloadall.py] numero de ficheros=%d" % len(lista))

    # Crea un listado con las entradas de favoritos
    for fichero in lista:
        # El primer video de la lista
        logger.info("[downloadall.py] fichero="+fichero)

        if fichero!="error":
            # Descarga el vídeo
            try:
                # Lee el bookmark
                titulo,thumbnail,plot,server,url = readbookmark(fichero)
                logger.info("[downloadall.py] url="+url)

                # Averigua la URL del vídeo
                if (server=="Megavideo" or server=="Megaupload") and config.getSetting("megavideopremium")=="true":
                    if server=="Megaupload":
                        mediaurl = servertools.getmegauploadhigh(url)
                    else:
                        mediaurl = servertools.getmegavideohigh(url)
                else:
                    mediaurl = servertools.findurl(url,server)
                logger.info("[downloadall.py] mediaurl="+mediaurl)
                
                # Genera el NFO
                nfofilepath = downloadtools.getfilefromtitle("sample.nfo",titulo)
                outfile = open(nfofilepath,"w")
                outfile.write("<movie>\n")
                outfile.write("<title>"+titulo+")</title>\n")
                outfile.write("<originaltitle></originaltitle>\n")
                outfile.write("<rating>0.000000</rating>\n")
                outfile.write("<year>2009</year>\n")
                outfile.write("<top250>0</top250>\n")
                outfile.write("<votes>0</votes>\n")
                outfile.write("<outline></outline>\n")
                outfile.write("<plot>"+plot+"</plot>\n")
                outfile.write("<tagline></tagline>\n")
                outfile.write("<runtime></runtime>\n")
                outfile.write("<thumb></thumb>\n")
                outfile.write("<mpaa>Not available</mpaa>\n")
                outfile.write("<playcount>0</playcount>\n")
                outfile.write("<watched>false</watched>\n")
                outfile.write("<id>tt0432337</id>\n")
                outfile.write("<filenameandpath></filenameandpath>\n")
                outfile.write("<trailer></trailer>\n")
                outfile.write("<genre></genre>\n")
                outfile.write("<credits></credits>\n")
                outfile.write("<director></director>\n")
                outfile.write("<actor>\n")
                outfile.write("<name></name>\n")
                outfile.write("<role></role>\n")
                outfile.write("</actor>\n")
                outfile.write("</movie>")
                outfile.flush()
                outfile.close()
                logger.info("[downloadall.py] Creado fichero NFO")
                
                # Descarga el thumbnail
                logger.info("[downloadall.py] thumbnail="+thumbnail)
                thumbnailfile = downloadtools.getfilefromtitle(thumbnail,titulo)
                thumbnailfile = thumbnailfile[:-4] + ".tbn"
                logger.info("[downloadall.py] thumbnailfile="+thumbnailfile)
                try:
                    downloadtools.downloadfile(thumbnail,thumbnailfile)
                    logger.info("[downloadall.py] Thumbnail descargado")
                except:
                    logger.info("[downloadall.py] error al descargar thumbnail")
                    for line in sys.exc_info():
                        logger.error( "%s" % line )
                
                # Descarga el video
                dev = downloadtools.downloadtitle(mediaurl,titulo)
                if dev == -1:
                    # El usuario ha cancelado la descarga
                    logger.info("[downloadall.py] Descarga cancelada")
                    return
                elif dev == -2:
                    # Error en la descarga, lo mueve a ERROR y continua con el siguiente
                    logger.info("[downloadall.py] ERROR EN DESCARGA DE "+fichero)
                    origen = os.path.join( DOWNLOAD_PATH , fichero )
                    destino = os.path.join( ERROR_PATH , fichero )
                    
                    # TODO: Mover en ruta compartida
                    shutil.move( origen , destino )
                else:
                    logger.info("[downloadall.py] Video descargado")
                    # Borra el bookmark e itera para obtener el siguiente video
                    filepath = os.path.join( DOWNLOAD_PATH , fichero )
                    os.remove(filepath)
                    logger.info("[downloadall.py] "+fichero+" borrado")
            except:
                logger.info("[downloadall.py] ERROR EN DESCARGA DE "+fichero)
                origen = os.path.join( DOWNLOAD_PATH , fichero )
                destino = os.path.join( ERROR_PATH , fichero )
                shutil.move( origen , destino )

    # Label (top-right)...
    xbmcplugin.setPluginCategory( handle=int( sys.argv[ 1 ] ), category=category )
    xbmcplugin.addSortMethod( handle=int( sys.argv[ 1 ] ), sortMethod=xbmcplugin.SORT_METHOD_NONE )
    xbmcplugin.endOfDirectory( handle=int( sys.argv[ 1 ] ), succeeded=True )