def epg_verluego(params):
    plugintools.log('[%s %s].epg_verluego %s' % (addonName, addonVersion, repr(params)))
    url = params.get("url")
    thumbnail = params.get("thumbnail")
    fanart = params.get("extra")

    filename = 'quever.txt'
    quever = open(temp + filename, "wb")      

    data = plugintools.read(url)
    #plugintools.log("data= "+data)
    plugintools.add_item(action="", title= '[COLOR lightyellow][B]¿Qué ver después?[/B][/COLOR]', thumbnail = thumbnail , fanart = fanart , folder = False, isPlayable = False)

    body = plugintools.find_multiple_matches(data, '<td class="prga-i">(.*?)</tr>')
    for entry in body:
        channel = plugintools.find_single_match(entry, 'alt=\"([^"]+)')
        hora_luego = plugintools.find_single_match(entry, 'class="fec1">(.*)</span>')
        hora_luego = hora_luego.split("</span>")
        hora_luego = hora_luego[0]
        print 'hora_luego',hora_luego
        diff_luego = plugintools.find_single_match(entry, 'class="fdiff">([^<]+)').strip()
        evento_luego = plugintools.find_single_match(entry, '<span class="tprg1">(.*?)</span>')
        evento_mastarde = plugintools.find_single_match(entry, '<span class="tprg2">(.*?)</span>')
        hora_mastarde = plugintools.find_single_match(entry, 'class="fec2">(.*)</span>')
        hora_mastarde = hora_mastarde.split("</span>")
        hora_mastarde = hora_mastarde[0]
        title = '[COLOR orange][B]'+channel+' [/B][COLOR lightyellow][B]'+hora_luego+'[/B] '+evento_luego+'[/COLOR][COLOR lightgreen][I] ('+diff_luego+') [/I][/COLOR][COLOR white][B]'+hora_mastarde+' [/COLOR][/B]'+evento_mastarde
        quever.write(title+'\n')
        #plugintools.add_item(action="", title= title, thumbnail = thumbnail , fanart = fanart , folder = False, isPlayable = False)

    quever.close()
    params = plugintools.get_params()
    params["url"]=temp+filename
    txt_reader(params)         
Example #2
0
def epg_verluego(params):
    plugintools.log('[%s %s].epg_verluego %s' % (addonName, addonVersion, repr(params)))
    url = params.get("url")
    thumbnail = params.get("thumbnail")
    fanart = params.get("extra")

    filename = 'quever.txt'
    quever = open(temp + filename, "wb")      

    data = plugintools.read(url)
    #plugintools.log("data= "+data)
    plugintools.add_item(action="", title= '[COLOR lightyellow][B]¿Qué ver después?[/B][/COLOR]', thumbnail = thumbnail , fanart = fanart , folder = False, isPlayable = False)

    body = plugintools.find_multiple_matches(data, '<td class="prga-i">(.*?)</tr>')
    for entry in body:
        channel = plugintools.find_single_match(entry, 'alt=\"([^"]+)')
        hora_luego = plugintools.find_single_match(entry, 'class="fec1">(.*)</span>')
        hora_luego = hora_luego.split("</span>")
        hora_luego = hora_luego[0]
        print 'hora_luego',hora_luego
        diff_luego = plugintools.find_single_match(entry, 'class="fdiff">([^<]+)').strip()
        evento_luego = plugintools.find_single_match(entry, '<span class="tprg1">(.*?)</span>')
        evento_mastarde = plugintools.find_single_match(entry, '<span class="tprg2">(.*?)</span>')
        hora_mastarde = plugintools.find_single_match(entry, 'class="fec2">(.*)</span>')
        hora_mastarde = hora_mastarde.split("</span>")
        hora_mastarde = hora_mastarde[0]
        title = '[COLOR orange][B]'+channel+' [/B][COLOR lightyellow][B]'+hora_luego+'[/B] '+evento_luego+'[/COLOR][COLOR lightgreen][I] ('+diff_luego+') [/I][/COLOR][COLOR white][B]'+hora_mastarde+' [/COLOR][/B]'+evento_mastarde
        quever.write(title+'\n')
        #plugintools.add_item(action="", title= title, thumbnail = thumbnail , fanart = fanart , folder = False, isPlayable = False)

    quever.close()
    params = plugintools.get_params()
    params["url"]=temp+filename
    txt_reader(params)         
def futbolentv0(params):    
    filename = 'futboltv.txt'
    futboltv = open(temp + filename, "wb")
    
    futbolenlatv(params, futboltv)
    futboltv.write('\n\n')
    futbolenlatv_manana(params)
    futbolenlatv(params, futboltv)
    futboltv.close()
    params = plugintools.get_params()
    params["url"]=temp+'futboltv.txt'
    txt_reader(params)    
def feltv0(params):

    filename = 'futboltv.txt'
    futboltv = open(temp + filename, "wb")

    feltv1(params, futboltv)
    futboltv.write('\n\n')
    #futbolenlatv_manana(params)
    #feltv1(params, futboltv)
    futboltv.close()
    params = plugintools.get_params()
    params["url"] = temp + 'futboltv.txt'
    txt_reader(params)
def epg_txt0(params):
    plugintools.log('[%s %s] Cargando EPG-TXT ... %s' % (addonName, addonVersion, params.get("url")))
	
    # Creamos diccionario con las URLs de la programación TV
    channel = params.get("title").replace(" [EPG-TXT]", "").strip()
    channel = channel.replace("Opción 1", "").replace("HD", "").replace("720p", "").replace("1080p", "").replace("SD", "").replace("HQ", "").replace("LQ", "").strip()
    channel = channel.replace("Opción 2", "").replace("Opción 3", "").replace("Op. 1", "").replace("Op. 2", "").replace("Op. 3", "")
    channel = parser_title(channel)
    plugintools.log("Cargando programación TV de "+channel)	
	
    # Consultamos diccionario de URLs de programación TV ...
    url = params.get("url")
                    
    # Creamos y abrimos archivo EPG-TXT ...
    fname = url.replace("http://servicios.elpais.com/m/programacion-tv/canal/", "").replace("/", "").replace("+", "p")
    fname_txt = fname+'.txt'  # Nombre de archivo	
    fname_txt = playlists + fname_txt  # Ruta del EPG-TXT
    fepg_txt = open(fname_txt, "wb")
    
    # Parseamos web con la programación TV ...
    plugintools.log("URL= "+url)
    data = plugintools.read(url)
    
    # Cabecera con la fecha de hoy, mañana y pasado
    bloque_head = plugintools.find_single_match(data, '<div id="hoy"(.*?)<div class="cont-rejilla">')
    bloque_events = plugintools.find_single_match(data, '<div id="hoy"(.*?)</tbody>')
    #plugintools.log("bloque_events= "+bloque_events)
    epg_txt2(url, fepg_txt, bloque_head, bloque_events)  # Parseo y escritura en EPG-TXT ...
    fepg_txt.write('\n\n')
            
    bloque_head = plugintools.find_single_match(data, '<div id="manana" class="ocultar_manana">(.*?)<div class="cont-rejilla">')
    bloque_events = plugintools.find_single_match(data, '<div id="manana" class="ocultar_manana">(.*?)</tbody>')
    #plugintools.log("bloque_events= "+bloque_events)
    epg_txt2(url, fepg_txt, bloque_head, bloque_events)
    fepg_txt.write('\n\n')
            
    bloque_head = plugintools.find_single_match(data, '<div id="pasado" class="ocultar_pasado">(.*?)<div class="cont-rejilla">')
    bloque_events = plugintools.find_single_match(data, '<div id="pasado" class="ocultar_pasado">(.*?)</tbody>')
    #plugintools.log("bloque_events= "+bloque_events)
    epg_txt2(url, fepg_txt, bloque_head, bloque_events)
    
    fepg_txt.close()
    url = 'txt:'+fname_txt
    plugintools.log("URL= "+url)

    params["url"] = url    
    txt_reader(params)
Example #6
0
def epg_txt0(params):
    plugintools.log('[%s %s] Cargando EPG-TXT ... %s' % (addonName, addonVersion, params.get("url")))
	
    # Creamos diccionario con las URLs de la programación TV
    channel = params.get("title").replace(" [EPG-TXT]", "").strip()
    channel = channel.replace("Opción 1", "").replace("HD", "").replace("720p", "").replace("1080p", "").replace("SD", "").replace("HQ", "").replace("LQ", "").strip()
    channel = channel.replace("Opción 2", "").replace("Opción 3", "").replace("Op. 1", "").replace("Op. 2", "").replace("Op. 3", "")
    channel = parser_title(channel)
    plugintools.log("Cargando programación TV de "+channel)	
	
    # Consultamos diccionario de URLs de programación TV ...
    url = params.get("url")
                    
    # Creamos y abrimos archivo EPG-TXT ...
    fname = url.replace("http://servicios.elpais.com/m/programacion-tv/canal/", "").replace("/", "").replace("+", "p")
    fname_txt = fname+'.txt'  # Nombre de archivo	
    fname_txt = playlists + fname_txt  # Ruta del EPG-TXT
    fepg_txt = open(fname_txt, "wb")
    
    # Parseamos web con la programación TV ...
    plugintools.log("URL= "+url)
    data = plugintools.read(url)
    
    # Cabecera con la fecha de hoy, mañana y pasado
    bloque_head = plugintools.find_single_match(data, '<div id="hoy"(.*?)<div class="cont-rejilla">')
    bloque_events = plugintools.find_single_match(data, '<div id="hoy"(.*?)</tbody>')
    #plugintools.log("bloque_events= "+bloque_events)
    epg_txt2(url, fepg_txt, bloque_head, bloque_events)  # Parseo y escritura en EPG-TXT ...
    fepg_txt.write('\n\n')
            
    bloque_head = plugintools.find_single_match(data, '<div id="manana" class="ocultar_manana">(.*?)<div class="cont-rejilla">')
    bloque_events = plugintools.find_single_match(data, '<div id="manana" class="ocultar_manana">(.*?)</tbody>')
    #plugintools.log("bloque_events= "+bloque_events)
    epg_txt2(url, fepg_txt, bloque_head, bloque_events)
    fepg_txt.write('\n\n')
            
    bloque_head = plugintools.find_single_match(data, '<div id="pasado" class="ocultar_pasado">(.*?)<div class="cont-rejilla">')
    bloque_events = plugintools.find_single_match(data, '<div id="pasado" class="ocultar_pasado">(.*?)</tbody>')
    #plugintools.log("bloque_events= "+bloque_events)
    epg_txt2(url, fepg_txt, bloque_head, bloque_events)
    
    fepg_txt.close()
    url = 'txt:'+fname_txt
    plugintools.log("URL= "+url)

    params["url"] = url    
    txt_reader(params)
Example #7
0
def epg_vermastarde(params):
    plugintools.log('[%s %s].epg_vermastarde %s' %
                    (addonName, addonVersion, repr(params)))
    url = params.get("url")
    thumbnail = params.get("thumbnail")
    fanart = params.get("extra")

    filename = 'quever.txt'
    quever = open(temp + filename, "wb")

    data = plugintools.read(url)
    #plugintools.log("data= "+data)
    plugintools.add_item(
        action="",
        title='[COLOR white][B]Mi Guia TV Mas Tarde[/B][/COLOR]',
        thumbnail=thumbnail,
        fanart=fanart,
        folder=False,
        isPlayable=False)

    body = plugintools.find_multiple_matches(data,
                                             '<td class="prga-i">(.*?)</tr>')
    for entry in body:
        channel = plugintools.find_single_match(entry, 'alt=\"([^"]+)')
        evento_mastarde = plugintools.find_single_match(
            entry, '<span class="tprg2">(.*?)</span>')
        hora_mastarde = plugintools.find_single_match(
            entry, 'class="fec2">(.*)</span>')
        hora_mastarde = hora_mastarde.split("</span>")
        hora_mastarde = hora_mastarde[0]
        title = '[COLOR blue][B]' + channel + ' [COLOR red]' + hora_mastarde + '[COLOR white] ' + evento_mastarde + '[/B][/COLOR]'
        quever.write(title + '\n')
        #plugintools.add_item(action="", title= title, thumbnail = thumbnail , fanart = fanart , folder = False, isPlayable = False)

    quever.close()
    params = plugintools.get_params()
    params["url"] = temp + filename
    txt_reader(params)
def agendatv(params):
    plugintools.log('[%s %s] AgendaTV %s' % (addonName, addonVersion, repr(params)))

    filename = 'agendatv.txt'
    agendatxt = open(temp + filename, "wb")
    
    hora_partidos = []
    lista_equipos=[]
    campeonato=[]
    canales=[]

    url = params.get("url")
    params["folder"]='False'
    data = plugintools.read(url)
    plugintools.log("data= "+data)

    matches = plugintools.find_multiple_matches(data,'<tr>(.*?)</tr>')
    horas = plugintools.find_multiple_matches(data, 'color=#990000>(.*?)</td>')
    txt = plugintools.find_multiple_matches(data, 'color="#000099"><b>(.*?)</td>')
    tv = plugintools.find_multiple_matches(data, '<td align="left"><font face="Verdana, Arial, Helvetica, sans-serif" size="1" ><b>([^<]+)</b></font></td>')

    # <b><a href="indexf.php?comp=Súper Final Argentino">Súper Final Argentino&nbsp;&nbsp;</td>
    for entry in matches:
        torneo = plugintools.find_single_match(entry, '<a href=(.*?)">')
        torneo = torneo.replace("&nbsp;&nbsp;", "")
        torneo = torneo.replace("indexf.php?comp=", "")
        torneo = torneo.replace('>', "")
        torneo = torneo.replace('"', "")
        torneo = torneo.replace("\n", "")
        torneo = torneo.strip()
        torneo = torneo.replace('\xfa', 'ú')
        torneo = torneo.replace('\xe9', 'é')
        torneo = torneo.replace('\xf3', 'ó')
        torneo = torneo.replace('\xfa', 'ú')
        torneo = torneo.replace('\xaa', 'ª')
        torneo = torneo.replace('\xe1', 'á')
        torneo = torneo.replace('\xf1', 'ñ')
        torneo = torneo.replace('indexuf.php?comp=', "")
        torneo = torneo.replace('indexfi.php?comp=', "")
        plugintools.log("string encoded= "+torneo)
        if torneo != "":
            plugintools.log("torneo= "+torneo)
            campeonato.append(torneo)

    # ERROR! Hay que añadir las jornadas, tal como estaba antes!!

    # Vamos a crear dos listas; una de los equipos que se enfrentan cada partido y otra de las horas de juego

    for dato in txt:
        lista_equipos.append(dato)

    for tiempo in horas:
        hora_partidos.append(tiempo)

    # <td align="left"><font face="Verdana, Arial, Helvetica, sans-serif" size="1" ><b>&nbsp;&nbsp; Canal + Fútbol</b></font></td>
    # <td align="left"><font face="Verdana, Arial, Helvetica, sans-serif" size="1" ><b>&nbsp;&nbsp; IB3</b></font></td>

    for kanal in tv:
        kanal = kanal.replace("&nbsp;&nbsp;", "")
        kanal = kanal.strip()
        kanal = kanal.replace('\xfa', 'ú')
        kanal = kanal.replace('\xe9', 'é')
        kanal = kanal.replace('\xf3', 'ó')
        kanal = kanal.replace('\xfa', 'ú')
        kanal = kanal.replace('\xaa', 'ª')
        kanal = kanal.replace('\xe1', 'á')
        kanal = kanal.replace('\xf1', 'ñ')
        canales.append(kanal)


    print lista_equipos
    print hora_partidos  # Casualmente en esta lista se nos ha añadido los días de partido
    print campeonato
    print canales

    i = 0       # Contador de equipos
    j = 0       # Contador de horas
    k = 0       # Contador de competición
    max_equipos = len(lista_equipos) - 2
    print max_equipos
    for entry in matches:
        while j <= max_equipos:
            # plugintools.log("entry= "+entry)
            fecha = plugintools.find_single_match(entry, 'color=#990000><b>(.*?)</b></td>')
            fecha = fecha.replace("&#225;", "á")
            fecha = fecha.strip()
            gametime = hora_partidos[i]
            gametime = gametime.replace("<b>", "")
            gametime = gametime.replace("</b>", "")
            gametime = gametime.strip()
            gametime = gametime.replace('&#233;', 'é')
            gametime = gametime.replace('&#225;', 'á')
            gametime = gametime.replace('&#233;', 'é')
            gametime = gametime.replace('&#225;', 'á')
            print gametime.find(":")
            if gametime.find(":") == 2:
                i = i + 1
                #print i
                local = lista_equipos[j]
                local = local.strip()
                local = local.replace('\xfa', 'ú')
                local = local.replace('\xe9', 'é')
                local = local.replace('\xf3', 'ó')
                local = local.replace('\xfa', 'ú')
                local = local.replace('\xaa', 'ª')
                local = local.replace('\xe1', 'á')
                local = local.replace('\xf1', 'ñ')
                j = j + 1
                print j
                visitante = lista_equipos[j]
                visitante = visitante.strip()
                visitante = visitante.replace('\xfa', 'ú')
                visitante = visitante.replace('\xe9', 'é')
                visitante = visitante.replace('\xf3', 'ó')
                visitante = visitante.replace('\xfa', 'ú')
                visitante = visitante.replace('\xaa', 'ª')
                visitante = visitante.replace('\xe1', 'á')
                visitante = visitante.replace('\xf1', 'ñ')
                local = local.replace('&#233;', 'é')
                local = local.replace('&#225;', 'á')
                j = j + 1
                print j
                tipo = campeonato[k]
                channel = canales[k]
                channel = channel.replace('\xfa', 'ú')
                channel = channel.replace('\xe9', 'é')
                channel = channel.replace('\xf3', 'ó')
                channel = channel.replace('\xfa', 'ú')
                channel = channel.replace('\xaa', 'ª')
                channel = channel.replace('\xe1', 'á')
                channel = channel.replace('\xf1', 'ñ')
                channel = channel.replace('\xc3\xba', 'ú')
                channel = channel.replace('Canal +', 'Canal+')
                title = '[B][COLOR khaki]' + tipo + ':[/B][/COLOR] ' + '[COLOR lightyellow]' + '(' + gametime + ')[COLOR white]  ' + local + ' vs ' + visitante + '[/COLOR][COLOR lightblue][I] (' + channel + ')[/I][/COLOR]'
                title = title.replace("http://www.futbolenlatele.com/", "")
                title = title.replace("http://www.calciointv.com/", "")
                title = title.replace("http://www.footballonuktv.com/", "")
                #plugintools.add_item(plot = channel , action="contextMenu", title=title , url = "", fanart = art + 'agendatv.jpg', thumbnail = art + 'icon.png' , folder = True, isPlayable = False)
                agendatxt.write(title+'\n')
                # diccionario[clave] = valor
                plugintools.log("channel= "+channel)
                params["plot"] = channel
                params["folder"] = "False"
                # plugintools.add_item(plot = channel , action = "search_channel", title = '[COLOR lightblue]' + channel + '[/COLOR]', url= "", thumbnail = art + 'icon.png', fanart = fanart , folder = True, isPlayable = False)
                k = k + 1
                print k
                plugintools.log("title= "+title)
            else:
                title='[B][COLOR red]' + gametime + '[/B][/COLOR]'
                title = title.replace("http://www.futbolenlatele.com/", "")
                agendatxt.write('\n'+title+'\n')
                #plugintools.add_item(action="", title=title, thumbnail = art + 'icon.png' , fanart = art + 'agendatv.jpg' , folder = True, isPlayable = False)
                i = i + 1

    agendatxt.close()
    params = plugintools.get_params()
    params["url"]=temp+'agendatv.txt'
    txt_reader(params)
Example #9
0
def agendatv(params):
    plugintools.log('[%s %s] AgendaTV %s' %
                    (addonName, addonVersion, repr(params)))

    filename = 'agendatv.txt'
    agendatxt = open(temp + filename, "wb")

    hora_partidos = []
    lista_equipos = []
    campeonato = []
    canales = []

    url = params.get("url")
    params["folder"] = 'False'
    data = plugintools.read(url)
    plugintools.log("data= " + data)

    matches = plugintools.find_multiple_matches(data, '<tr>(.*?)</tr>')
    horas = plugintools.find_multiple_matches(data, 'color=#990000>(.*?)</td>')
    txt = plugintools.find_multiple_matches(data,
                                            'color="#000099"><b>(.*?)</td>')
    tv = plugintools.find_multiple_matches(
        data,
        '<td align="left"><font face="Verdana, Arial, Helvetica, sans-serif" size="1" ><b>([^<]+)</b></font></td>'
    )

    # <b><a href="indexf.php?comp=Súper Final Argentino">Súper Final Argentino&nbsp;&nbsp;</td>
    for entry in matches:
        torneo = plugintools.find_single_match(entry, '<a href=(.*?)">')
        torneo = torneo.replace("&nbsp;&nbsp;", "")
        torneo = torneo.replace("indexf.php?comp=", "")
        torneo = torneo.replace('>', "")
        torneo = torneo.replace('"', "")
        torneo = torneo.replace("\n", "")
        torneo = torneo.strip()
        torneo = torneo.replace('\xfa', 'ú')
        torneo = torneo.replace('\xe9', 'é')
        torneo = torneo.replace('\xf3', 'ó')
        torneo = torneo.replace('\xfa', 'ú')
        torneo = torneo.replace('\xaa', 'ª')
        torneo = torneo.replace('\xe1', 'á')
        torneo = torneo.replace('\xf1', 'ñ')
        torneo = torneo.replace('indexuf.php?comp=', "")
        torneo = torneo.replace('indexfi.php?comp=', "")
        plugintools.log("string encoded= " + torneo)
        if torneo != "":
            plugintools.log("torneo= " + torneo)
            campeonato.append(torneo)

    # ERROR! Hay que añadir las jornadas, tal como estaba antes!!

    # Vamos a crear dos listas; una de los equipos que se enfrentan cada partido y otra de las horas de juego

    for dato in txt:
        lista_equipos.append(dato)

    for tiempo in horas:
        hora_partidos.append(tiempo)

    # <td align="left"><font face="Verdana, Arial, Helvetica, sans-serif" size="1" ><b>&nbsp;&nbsp; Canal + Fútbol</b></font></td>
    # <td align="left"><font face="Verdana, Arial, Helvetica, sans-serif" size="1" ><b>&nbsp;&nbsp; IB3</b></font></td>

    for kanal in tv:
        kanal = kanal.replace("&nbsp;&nbsp;", "")
        kanal = kanal.strip()
        kanal = kanal.replace('\xfa', 'ú')
        kanal = kanal.replace('\xe9', 'é')
        kanal = kanal.replace('\xf3', 'ó')
        kanal = kanal.replace('\xfa', 'ú')
        kanal = kanal.replace('\xaa', 'ª')
        kanal = kanal.replace('\xe1', 'á')
        kanal = kanal.replace('\xf1', 'ñ')
        canales.append(kanal)

    print lista_equipos
    print hora_partidos  # Casualmente en esta lista se nos ha añadido los días de partido
    print campeonato
    print canales

    i = 0  # Contador de equipos
    j = 0  # Contador de horas
    k = 0  # Contador de competición
    max_equipos = len(lista_equipos) - 2
    print max_equipos
    for entry in matches:
        while j <= max_equipos:
            # plugintools.log("entry= "+entry)
            fecha = plugintools.find_single_match(
                entry, 'color=#990000><b>(.*?)</b></td>')
            fecha = fecha.replace("&#225;", "á")
            fecha = fecha.strip()
            gametime = hora_partidos[i]
            gametime = gametime.replace("<b>", "")
            gametime = gametime.replace("</b>", "")
            gametime = gametime.strip()
            gametime = gametime.replace('&#233;', 'é')
            gametime = gametime.replace('&#225;', 'á')
            gametime = gametime.replace('&#233;', 'é')
            gametime = gametime.replace('&#225;', 'á')
            print gametime.find(":")
            if gametime.find(":") == 2:
                i = i + 1
                #print i
                local = lista_equipos[j]
                local = local.strip()
                local = local.replace('\xfa', 'ú')
                local = local.replace('\xe9', 'é')
                local = local.replace('\xf3', 'ó')
                local = local.replace('\xfa', 'ú')
                local = local.replace('\xaa', 'ª')
                local = local.replace('\xe1', 'á')
                local = local.replace('\xf1', 'ñ')
                j = j + 1
                print j
                visitante = lista_equipos[j]
                visitante = visitante.strip()
                visitante = visitante.replace('\xfa', 'ú')
                visitante = visitante.replace('\xe9', 'é')
                visitante = visitante.replace('\xf3', 'ó')
                visitante = visitante.replace('\xfa', 'ú')
                visitante = visitante.replace('\xaa', 'ª')
                visitante = visitante.replace('\xe1', 'á')
                visitante = visitante.replace('\xf1', 'ñ')
                local = local.replace('&#233;', 'é')
                local = local.replace('&#225;', 'á')
                j = j + 1
                print j
                tipo = campeonato[k]
                channel = canales[k]
                channel = channel.replace('\xfa', 'ú')
                channel = channel.replace('\xe9', 'é')
                channel = channel.replace('\xf3', 'ó')
                channel = channel.replace('\xfa', 'ú')
                channel = channel.replace('\xaa', 'ª')
                channel = channel.replace('\xe1', 'á')
                channel = channel.replace('\xf1', 'ñ')
                channel = channel.replace('\xc3\xba', 'ú')
                channel = channel.replace('Canal +', 'Canal+')
                title = '[B][COLOR khaki]' + tipo + ':[/B][/COLOR] ' + '[COLOR lightyellow]' + '(' + gametime + ')[COLOR white]  ' + local + ' vs ' + visitante + '[/COLOR][COLOR lightblue][I] (' + channel + ')[/I][/COLOR]'
                title = title.replace("http://www.futbolenlatele.com/", "")
                title = title.replace("http://www.calciointv.com/", "")
                title = title.replace("http://www.footballonuktv.com/", "")
                #plugintools.add_item(plot = channel , action="contextMenu", title=title , url = "", fanart = art + 'agendatv.jpg', thumbnail = art + 'icon.png' , folder = True, isPlayable = False)
                agendatxt.write(title + '\n')
                # diccionario[clave] = valor
                plugintools.log("channel= " + channel)
                params["plot"] = channel
                params["folder"] = "False"
                # plugintools.add_item(plot = channel , action = "search_channel", title = '[COLOR lightblue]' + channel + '[/COLOR]', url= "", thumbnail = art + 'icon.png', fanart = fanart , folder = True, isPlayable = False)
                k = k + 1
                print k
                plugintools.log("title= " + title)
            else:
                title = '[B][COLOR red]' + gametime + '[/B][/COLOR]'
                title = title.replace("http://www.futbolenlatele.com/", "")
                agendatxt.write('\n' + title + '\n')
                #plugintools.add_item(action="", title=title, thumbnail = art + 'icon.png' , fanart = art + 'agendatv.jpg' , folder = True, isPlayable = False)
                i = i + 1

    agendatxt.close()
    params = plugintools.get_params()
    params["url"] = temp + 'agendatv.txt'
    txt_reader(params)
Example #10
0
def url_analyzer(url):
    plugintools.log('[%s %s].URL Analyzer %s' % (addonName, addonVersion, url))	

    params = plugintools.get_params()
    plugintools.log("params = "+repr(params))

    if url == "mundoplus":
        mundoplus_guide(params)
    
    elif url.startswith("goear") == True:
        id_goear = url.replace("goear:", "").replace('"', "").strip()
        url = 'http://www.goear.com/action/sound/get/'+id_goear
        plugintools.log("url= "+url)
        params["url"]=url.strip()
        play_resolved_url(url)
        
    elif url.startswith("serie") == True:
        if url.find("seriesflv") >= 0:
            from resources.tools.seriesflv import *
            url = url.replace("serie:", "")
            show = plugintools.get_setting("series_id")
            params = plugintools.get_params()
            params["url"]=url.strip()
            params["page"]=show
            plugintools.modo_vista(show)            
            lista_capis(params)
        elif url.find("seriesyonkis") >= 0:
            from resources.tools.seriesyonkis import *
            url = url.replace("serie:", "")
            show = plugintools.get_setting("series_id")
            params = plugintools.get_params()
            params["url"]=url.strip()
            plugintools.modo_vista(show)
            serie_capis(params)
        elif url.find("seriesadicto") >= 0:
            from resources.tools.seriesadicto import *
            url = url.replace("serie:", "")
            show = plugintools.get_setting("series_id")
            params = plugintools.get_params()
            params["url"]=url.strip()
            plugintools.modo_vista(show)            
            seriecatcher(params)
        elif url.find("seriesblanco") >= 0:
            from resources.tools.seriesblanco import *
            url = url.replace("serie:", "")
            show = plugintools.get_setting("series_id")
            params = plugintools.get_params()
            params["url"]=url.strip()
            plugintools.modo_vista(show)            
            seriesblanco0(params)
        elif url.find("series.mu") >= 0:
            from resources.tools.seriesmu import *
            url = url.replace("serie:", "")
            show = plugintools.get_setting("series_id")
            params = plugintools.get_params()
            params["page"]=show            
            params["url"]=url.strip()
            plugintools.modo_vista(show)            
            seriesmu0(params)

    elif url.startswith("peli") == True:
        if url.find("oranline") >= 0:
            from resources.tools.oranline import *
            url = url.replace("peli:", "")
            show = plugintools.get_setting("series_id")
            params = plugintools.get_params()
            params["url"]=url.strip()
            params["page"]=show
            plugintools.modo_vista(show)            
            oranline0(params)
        elif url.find("pelisadicto") >= 0:
            from resources.tools.pelisadicto import *
            show = plugintools.get_setting("series_id")
            params = plugintools.get_params()
            params["url"] = url.replace("peli:", "").strip()
            plugintools.modo_vista(show)            
            pelisadicto0(params)
        elif url.find("pordede") >= 0:
            from resources.tools.pelisadicto import *
            show = plugintools.get_setting("series_id")
            params = plugintools.get_params()
            url = url.replace("peli:", "").strip();params["page"]=url
            url_links=url.replace("/peli/","/links/view/slug/")+"/what/peli";params["url"]=url_links
            params["extra"]='regex'
            plugintools.modo_vista(show)            
            pdd_findvideos(params)            
                    
    elif url.startswith("rtmp") == True or url.startswith("rtsp") == True:
        params = plugintools.get_params()
        title = params.get("title")
        title = title + ' [rtmp]'
        params["title"]=title
        show = params.get("page")
        url = parse_url(url, show)
        params = plugintools.get_params()
        params["url"]=url
        get_server(params)            
        
    elif url.startswith("http") == True:        
        if url.find("allmyvideos") >= 0:
            params = plugintools.get_params()
            params["url"]=url
            allmyvideos(params)

        elif url.find("streamcloud") >= 0:                        
            params = plugintools.get_params()
            params["url"]=url
            streamcloud(params)

        elif url.find("vidspot") >= 0:
            params = plugintools.get_params()
            params["url"]=url
            vidspot(params)

        elif url.find("played.to") >= 0:
            params = plugintools.get_params()
            params["url"]=url
            playedto(params)       

        elif url.find("vk.com") >= 0:
            params = plugintools.get_params()
            params["url"]=url
            vk(params)

        elif url.find("nowvideo") >= 0:
            params = plugintools.get_params()
            params["url"]=url
            nowvideo(params)          
        
        elif url.find("tumi.tv") >= 0:
            params = plugintools.get_params()
            params["url"]=url
            tumi(params)

        elif url.find("streamin.to") >= 0:
            params = plugintools.get_params()
            params["url"]=url
            streaminto(params)
            
        elif url.find("veehd") >= 0:
            params = plugintools.get_params()
            params["url"]=url
            veehd(params)

        elif url.find("novamov") >= 0:
            params = plugintools.get_params()
            params["url"]=url
            novamov(params)       

        elif url.find("gamovideo") >= 0:
            params = plugintools.get_params()
            params["url"]=url
            gamovideo(params)

        elif url.find("moevideos") >= 0:
            params = plugintools.get_params()
            params["url"]=url
            moevideos(params)

        elif url.find("movshare") >= 0:
            params = plugintools.get_params()
            params["url"]=url
            movshare(params)              
        
        elif url.find("powvideo") >= 0:
            params = plugintools.get_params()
            params["url"]=url
            powvideo(params)

        elif url.find("mail.ru") >= 0:
            params = plugintools.get_params()
            params["url"]=url
            mailru(params)
            
        elif url.find("videobam") >= 0:
            params = plugintools.get_params()
            params["url"]=url
            videobam(params)

        elif url.find("videoweed") >= 0:
            params = plugintools.get_params()
            params["url"]=url
            videoweed(params)

        elif url.find("streamable") >= 0:
            params = plugintools.get_params()
            params["url"]=url
            streamable(params)

        elif url.find("rocvideo") >= 0:
            params = plugintools.get_params()
            params["url"]=url
            rocvideo(params)

        elif url.find("realvid") >= 0:
            params = plugintools.get_params()
            params["url"]=url
            realvid(params)

        elif url.find("netu") >= 0:
            params = plugintools.get_params()
            params["url"]=url
            netu(params)

        elif url.find("waaw") >= 0:
            params = plugintools.get_params()
            params["url"]=url
            waaw(params)            

        elif url.find("videomega") >= 0:
            params = plugintools.get_params()
            params["url"]=url
            videomega(params)

        elif url.find("video.tt") >= 0:
            params = plugintools.get_params()
            params["url"]=url
            videott(params)

        elif url.find("flashx.tv") >= 0:
            params = plugintools.get_params()
            params["url"]=url
            flashx(params)

        elif url.find("ok.ru") >= 0:
            params = plugintools.get_params()
            params["url"]=url
            okru(params)

        elif url.find("vidto.me") >= 0:
            params = plugintools.get_params()
            params["url"]=url
            vidtome(params)               

        elif url.find("www.youtube.com") >= 0:
            plugintools.log("Youtube: "+url)
            videoid = url.replace("https://www.youtube.com/watch?v=", "")
            url = 'plugin://plugin.video.youtube/play/?video_id='+videoid
            url = url.strip()
            play_url(url)

        elif url.find("dailymotion.com/video") >= 0:
            plugintools.log("Dailymotion: "+url)
            video_id = dailym_getvideo(url)
            if video_id != "":
                thumbnail = "https://api.dailymotion.com/thumbnail/video/"+video_id+""
                url = "plugin://plugin.video.dailymotion_com/?url="+video_id+"&mode=playVideo"
                play_url(url)

        elif url.find("dailymotion.com/playlist") >= 0:
            plugintools.log("Dailymotion: "+url)
            id_playlist = dailym_getplaylist(url)
            if id_playlist != "":
                url = "https://api.dailymotion.com/playlist/"+id_playlist+"/videos"
                thumbnail = "https://api.dailymotion.com/thumbnail/video/"+id_playlist
                if thumbnail == "":
                    thumbnail = 'http://press.dailymotion.com/wp-old/wp-content/uploads/logo-Dailymotion.png'
                url = "https://api.dailymotion.com/playlist/"+id_playlist+"/videos"
                params["url"]=url
                dailym_pl(params)
                
        elif url.find(".m3u8") >= 0:
            plugintools.log("M3u8: "+url)
            url = url.strip()
            play_url(url)

        else:
            url = url.strip()
            play_resolved_url(url)
            
    elif url.startswith("udp") == True:
        plugintools.log("UDP: "+url)
        url = url.strip()
        play_url(url)         
    
    elif url.startswith("rtp") == True:
        plugintools.log("RTP: "+url)
        url = url.strip()
        play_url(url)             
    
    elif url.startswith("mms") == True:
        plugintools.log("mms: "+url)
        url = url.strip()
        play_url(url)       

    elif url.startswith("plugin://") == True:
        play_url(url)
            
    elif url.startswith("magnet") == True:
        plugintools.log("Magnet link: "+url)
        url_fixed = urllib.quote_plus(data)
        url = 'plugin://plugin.video.xbmctorrent/play/' + url_fixed
        url = url.strip()
        play_url(url)

    elif url.startswith("sop") == True:
        # plugin://plugin.video.p2p-streams/?url=sop://124.232.150.188:3912/11265&mode=2&name=Titulo+canal+Sopcast
        url = 'plugin://plugin.video.p2p-streams/?url=' + url + '&mode=2&name='
        url = url.strip()
        play_url(url)
        
    elif url.startswith("ace") == True:
        plugintools.log("Acestream: "+url)
        url = url.replace("ace:", "")
        url = url.strip()
        url = 'plugin://plugin.video.p2p-streams/?url=' + url + '&mode=1&name='
        url = url.strip()
        play_url(url)                                         
    
    elif url.startswith("yt_playlist") == True:
        pid = url.replace("yt_playlist(", "")
        pid = pid.replace(")", "").strip()
        pid = pid+'/';pid=pid.strip();pid.replace(" ", "")
        url = 'plugin://plugin.video.youtube/playlist/'+pid
        plugintools.log("URL Playlist= "+url)
        run_tube(url)
        
    elif url.startswith("yt_channel") == True:
        uid = url.replace("yt_channel(", "")
        uid = uid.replace(")", "").strip()
        uid = uid+'/';uid=uid.strip();uid.replace(" ", "")        
        url = 'plugin://plugin.video.youtube/user/'+uid
        plugintools.log("URL Channel= "+url)
        run_tube2(params)
            
    elif url.startswith("wuarron") == True:
        url = url.replace("wuarron:", "").replace("http://", "")
        channel_id = plugintools.find_single_match(url, '/(.*?)/index.m3u8')
        url = "http://"+url
        url = url.strip()
        params = plugintools.get_params()
        params["url"]=url
        params["plot"]=channel_id
        from resources.tools.wuarron import *
        wuarron_token(params)

    elif url.startswith("short") == True:
        url = url.replace("short:", "").strip()
        params["url"]=url;longurl(params)

    elif url.startswith("devil") == True:
        url = url.replace("devil:", "")
        url = url.split(" ")
        url = url[0];ref=url[1];ref=ref.replace("referer=", "").strip()
        url = 'plugin://plugin.video.SportsDevil/?mode=1&amp;item=catcher%3dstreams%26url='+url+'%26referer='+referer
        #url = urllib.quote_plus(url)
        builtin = 'Container.Update(%s)' %url
        xbmc.executebuiltin(builtin)
        #xbmc.executebuiltin('XBMC.RunPlugin(' + url +')')
        
    elif url.startswith("bum") == True:
        params = plugintools.get_params()
        title = params.get("title")
        show = "list"
        title = multiparse_title(title, url, show)        
        bum_multiparser(params)

    elif url.startswith("img") == True:
        url = url.replace("img:", "").strip()        
        params = plugintools.get_params()
        title = params.get("title")
        show = "thumbnail"
        title = multiparse_title(title, url, show)
        show_image(url)

    elif url.startswith("txt") == True:
        from resources.tools.txt_reader import *
        params=plugintools.get_params()
        url=url.replace("txt:", "")
        params["url"]=url
        params["title"]="Infotext"
        txt_reader(params)

    elif url.startswith("epg-txt") == True:
        from resources.tools.epg_txt import *
        params=plugintools.get_params()
        url=url.replace("epg-txt:", "");print url
        title=url;print title
        url = epg_txt_dict(parser_title(title))
        plugintools.log("url epg-txt: "+url)        
        params["url"]=url
        params["title"]=url
        epg_txt0(params)

    elif url.startswith("agendatv") == True:
        url = url.replace("agendatv:", "").strip()
        if url == "futbolenlatv":
            params["url"] = 'http://agenda.futbolenlatv.com/m?deporte=agenda'
            futbolentv0(params)
        elif url == "footballonuktv":
            params["url"] = 'http://www.footballonuktv.com/'
            agendatv(params)
        elif url == "calciointv":
            params["url"] = 'http://www.calciointv.com/'
            agendatv(params)
        elif url == "futbolenlatele":
            params["url"] = 'http://www.futbolenlatele.com'
            agendatv(params)
        elif url == "queverahora":
            params["url"] = 'http://www.formulatv.com/programacion/'
            epg_verahora(params)