Example #1
0
def descargar_programa_aragontv(channel_id, episodes_action, url,
                                output_folder):
    from servers import aragontv as servermodule
    exec "from tvalacarta.channels import " + channel_id + " as channelmodule"
    exec "itemlist = channelmodule." + episodes_action + "(Item(url=url))"

    resultados = []

    for item in itemlist:
        mediaurl = servermodule.get_video_url(item.url)
        resultados.append([
            item.title, mediaurl[0][1],
            clean_title(item.title) + mediaurl[0][1][-4:]
        ])

    for title, url, localfile in resultados:
        print title, url, localfile

        ejecutable = "/Users/jesus/Downloads/rtmpdump/rtmpdump-2.4"
        salida = os.path.join(output_folder, localfile)

        if not os.path.exists(salida):
            print "Comando: " + ejecutable + ' -r "' + url + '" --live -o "' + salida + '"'
            import shlex, subprocess
            args = shlex.split(ejecutable + ' -r "' + url + '" --live -o "' +
                               salida + '"')
            print args
            p = subprocess.call(args)  # Success!
        else:
            print "Ya existe " + salida
Example #2
0
def descargar_programa_aragontv( channel_id , episodes_action , url , output_folder ):
    from servers import aragontv as servermodule
    exec "from tvalacarta.channels import "+channel_id+" as channelmodule"
    exec "itemlist = channelmodule."+episodes_action+"(Item(url=url))"
    
    resultados = []
    
    for item in itemlist:
        mediaurl = servermodule.get_video_url(item.url)
        resultados.append( [ item.title, mediaurl[0][1] , clean_title(item.title) + mediaurl[0][1][-4:] ] )

    for title,url,localfile in resultados:
        print title,url,localfile
        
        ejecutable = "/Users/jesus/Downloads/rtmpdump/rtmpdump-2.4"
        salida = os.path.join( output_folder , localfile )

        if not os.path.exists(salida):
            print "Comando: "+ejecutable+' -r "'+url+'" --live -o "'+salida+'"'
            import shlex, subprocess
            args = shlex.split(ejecutable+' -r "'+url+'" --live -o "'+salida+'"')
            print args
            p = subprocess.call(args) # Success!
        else:
            print "Ya existe "+salida
Example #3
0
    def ok(self):
        pageurl = self.e.get()
        print "Pagina", pageurl

        output = self.e2.get()
        print "Descargar en", output

        import os
        confpath = os.path.join( config.get_data_path() , "descargar-aragontv.conf" )
        try:
            fichero = open(confpath,"w")
            fichero.write(output)
            fichero.close()
        except:
            print "Error al grabar "+confpath
            pass
        
        # Cierra el gui
        self.top.destroy()

        # Desactiva la cache
        config.set_setting("cache.mode","2")

        # Obtiene el titulo y la URL del vĂ­deo
        windows_mode = os.path.exists("rtmpdump.exe")
        from core import scrapertools
        pageurl = pageurl.encode("utf-8")
        data = scrapertools.cachePage(pageurl)
        patron = "<title>(.*?)</title>"
        matches = re.compile(patron,re.DOTALL).findall(data)
        if len(matches)>0:
            titulo = matches[0]
        print "Titulo = "+titulo
        
        from servers import aragontv
        video_urls = aragontv.get_video_url(pageurl)
        url = video_urls[0][1]

        import os
        salida = os.path.join( output , "%s.mp4" % self.clean_title(titulo,windows_mode) )
        print salida

        # Invoca a rtmpdump
        if windows_mode:
            print "Comando: "+'./rtmpdump.exe -r "'+url+'" -o "'+salida+'" --live'
            import shlex, subprocess
            args = shlex.split('./rtmpdump.exe -r "'+url+'" -o "'+salida+'" --live')
            p = subprocess.call(args) # Success!
        else:
            print "Comando: "+'./rtmpdump -r "'+url+'" -o "'+salida+'" --live'
            import shlex, subprocess
            args = shlex.split('./rtmpdump -r "'+url+'" -o "'+salida+'" --live')
            p = subprocess.call(args) # Success!
Example #4
0
def detalle_episodio(item):

    data = scrapertools.cache_page(item.url)

    scrapedplot = scrapertools.find_single_match(data,'<span class="title">Resumen del v[^>]+</span>(.*?)</div>')
    item.plot = scrapertools.htmlclean( scrapedplot ).strip()

    item.geolocked = "0"
    
    try:
        from servers import aragontv as servermodule
        video_urls = servermodule.get_video_url(item.url)
        item.media_url = video_urls[-1][1]
    except:
        import traceback
        print traceback.format_exc()
        item.media_url = ""

    return item
Example #5
0
def detalle_episodio(item):

    data = scrapertools.cache_page(item.url)

    scrapedplot = scrapertools.find_single_match(
        data, '<span class="title">Resumen del v[^>]+</span>(.*?)</div>')
    item.plot = scrapertools.htmlclean(scrapedplot).strip()

    item.geolocked = "0"

    try:
        from servers import aragontv as servermodule
        video_urls = servermodule.get_video_url(item.url)
        item.media_url = video_urls[-1][1]
    except:
        import traceback
        print traceback.format_exc()
        item.media_url = ""

    return item