def play_livetv(params): plugintools.log("ruyaiptv.play_livetv "+repr(params)) token = plugintools.get_setting("token") if token=="": return mediaurl = params.get("url") plugintools.log("ruyaiptv.play_livetv mediaurl="+repr(mediaurl)) if "|" in params.get("url"): if plugintools.get_setting("quality_selector_live")=="0": plugintools.log("ruyaiptv.play_livetv asking for quality") selected = plugintools.selector(["Watch in SD","Watch in HD"],"Select quality") if selected==-1: return elif plugintools.get_setting("quality_selector_live")=="1": plugintools.log("ruyaiptv.play_livetv default to SD quality") selected = 0 elif plugintools.get_setting("quality_selector_live")=="2": plugintools.log("ruyaiptv.play_livetv default to HD quality") selected = 1 mediaurl = params.get("url").split("|")[selected] plugintools.log("ruyaiptv.play_livetv mediaurl="+repr(mediaurl)) plugintools.log("ruyaiptv.play_livetv mediaurl="+repr(mediaurl)) mediaurl = api.get_livetv_url(token,mediaurl) plugintools.log("ruyaiptv.play_livetv mediaurl="+repr(mediaurl)) plugintools.play_resolved_url( mediaurl )
def goltube2(params): plugintools.log("[%s %s] GolTube " % (addonName, addonVersion)) thumbnail = params.get("thumbnail") fanart = params.get("fanart") url = params.get("url") data = gethttp_referer_headers(url, url) url_item = plugintools.find_single_match(data, '<iframe src="([^"]+)') plugintools.log("url_item= " + url_item) data = gethttp_referer_headers(url_item, url_item) plugintools.log("data= " + data) urls = [] titles = [] url_media = plugintools.find_multiple_matches(data, '<source src="([^"]+)') i = 1 for entry in url_media: plugintools.log("Media: " + entry) quality = plugintools.find_single_match(entry, 'Ves_[0-9]+').replace( "Ves_", "") urls.append(entry) titles.append('Opción ' + str(i) + ' [COLOR lightyellow][I](' + quality + ')[/I][/COLOR]') i = i + 1 print urls seleccion = plugintools.selector(titles, 'GolTube') if seleccion >= 0: plugintools.play_resolved_url(urls[seleccion])
def SelectTemp(params, show, temp): #plugintools.log("[%s %a] Seriesadicto: selectTemp() " % (addonName, addonVersion, repr(params))) show = params.get("series_id") # Obtenemos modo de vista del usuario para series TV if show is None: show = params.get("page") if show is None: show = "tvshows" plugintools.log("show= "+show) plugintools.modo_vista(show) titles_temp = [] seasons = len(temp) i = 1 while i <= seasons: titles_temp.append('[COLOR lightyellow]'+params.get("title").replace("[Multiparser]", "").strip()+': [/COLOR]Temporada '+str(i)) i = i + 1 print titles_temp select_temp = plugintools.selector(titles_temp, 'PalcoTV') i = 0 while i<= seasons : if select_temp == i: params["season"] = temp[i] GetSerieChapters(params) i = i + 1 plugintools.modo_vista(show)
def multihockey(params): plugintools.log("[%s %s] Onhockey multilink " % (addonName, addonVersion)) channelist = params.get("plot") channelist = channelist.split(", ") partido = params.get("title") serverlist = [] for item in channelist: if item.find("youtube") >= 0: serverlist.append(partido + " [Youtube]") elif item.find("castalba") >= 0: serverlist.append(partido + " [Castalba]") elif item.find("sawlive") >= 0: serverlist.append(partido + " [Sawlive]") elif item.find("acestream") >= 0: serverlist.append(partido + " [Acestream]") elif item.find("sopcast") >= 0: serverlist.append(partido + " [Sopcast]") elif item.find("liveall") >= 0: serverlist.append(partido + " [Liveall]") else: serverlist.append(partido + " [Flash]") xbmc.executebuiltin("Container.SetViewMode(515)") try: selector = plugintools.selector(serverlist, partido) if selector > -1: url = channelist[selector] if url.find("acestream") >= 0: #http://onhockey.tv/youtube.php?channel=sDD697xbZ5A, http://onhockey.tv/liveall.php?channel=fbfdb35g, http://onhockey.tv/streamhd.php?channel=4, http://onhockey.tv/worldsport.php?channel=7, http://onhockey.tv/live9.php?channel=30, http://onhockey.tv/cricfree.php?channel=premiersports, http://onhockey.tv/acestream.php?channel=fb2080a96e762e926a33e61c70bd74edb2beabdf, http://onhockey.tv/acestream.php?channel=548d364053e6650458e3f347dfbda0dd852781da, http://onhockey.tv/sopcast.php?channel=146666 # http://onhockey.tv/acestream.php?channel=548d364053e6650458e3f347dfbda0dd852781da ace = url.replace("http://onhockey.tv/acestream.php?channel=", "") url = p2p_builder_url(ace, 'hockey', p2p="ace") xbmc.executebuiltin('XBMC.RunPlugin(' + url + ')') elif url.find("sopcast") >= 0: # http://onhockey.tv/sopcast.php?channel=146666 sop = url.replace("http://onhockey.tv/sopcast.php?channel=", "") url = p2p_builder_url(sop, 'hockey', p2p="sop") xbmc.executebuiltin('XBMC.RunPlugin(' + url + ')') elif url.find("youtube") >= 0: # http://onhockey.tv/youtube.php?channel=sDD697xbZ5A yt_url = url.replace("http://onhockey.tv/youtube.php?channel=", "") url = 'plugin://plugin.video.youtube/play/?video_id=' + yt_url plugintools.log("URL= " + url) plugintools.play_resolved_url(url) else: ref = 'http://onhockey.tv/' url = 'plugin://plugin.video.SportsDevil/?mode=1&item=catcher%3dstreams%26url=' + url + '%26referer=' + ref plugintools.log("URL= " + url) xbmc.executebuiltin('XBMC.RunPlugin(' + url + ')') except KeyboardInterrupt: pass except IndexError: raise xbmc.executebuiltin("Container.SetViewMode(515)")
def lstv1(params): menu_selec = [ '[COLOR cyan]' + params.get("extra") + '[/COLOR]', "Ver cobertura internacional", "Estadísticas en vivo" ] dia_lstv = plugintools.selector(menu_selec, params.get("title")) if dia_lstv == 1: lstv2() if dia_lstv == 2: lstv3()
def vipracing2(params): lista_canales = params.get("plot") lista_canales = lista_canales.split(", ") title = params.get("title") dia = plugintools.selector(lista_canales, title) ch = lista_canales[dia] url = canal_vipracing(ch);referer = 'http://vipracing.tv/' url = 'plugin://plugin.video.SportsDevil/?mode=1&item=catcher%3dstreams%26url='+url+'%26referer='+referer plugintools.log("U R L = "+url) play_vipracing(url)
def stadiumlivebiz2(params): plugintools.log('[%s %s] stadiumlivebiz2 %s' % (addonName, addonVersion, repr(params))) headers = {"Referer": burl};r=requests.get(burl, headers=headers);r.encoding = 'utf-8';body=r.content #plugintools.log("body= "+body) channel_bloque = plugintools.find_single_match(body, '<ul id="main"(.*?)</ul>') channel = plugintools.find_multiple_matches(channel_bloque, '<li>(.*?)</li>') lista_ch = [] url_ch = [] for entry in channel: if entry != "": #plugintools.log("entry= "+entry) url_channel = plugintools.find_single_match(entry, '<a href="([^"]+)') url_channel = 'http://www.stadium-live.biz/'+url_channel title_channel = plugintools.find_single_match(entry, '<a href[^>]+>(.*?)</a>') #plugintools.log("title_channel= "+title_channel) lista_ch.append(title_channel) url_ch.append(url_channel) #plugintools.log("url_channel= "+url_channel) #plugintools.add_item(action="stadiumlivebiz1", title='[COLOR white]'+title_channel+'[/COLOR]', url=url_channel , thumbnail = art + 'stadiumlive.png' , fanart = fanart , folder = False, isPlayable = True) try: select_ch = plugintools.selector(lista_ch, 'Stadium-live.biz') if select_ch >= -1: kanal = lista_ch[select_ch] kanal=burl+kanal.replace(" ","")+'.html' print kanal headers = {"Referer": burl};r=requests.get(kanal, headers=headers);r.encoding = 'utf-8';body=r.content caster = plugintools.find_multiple_matches(body, '<!--<script type="text/javascript" src="([^"]+)') for entry in caster: if entry.find("autostart=true") >= 0: #plugintools.log("entry= "+entry) caster = entry ref = kanal;url = ref.replace("Channel", "ch_").strip();url = url.replace(".html", "");url = url+'code.html' headers = {"Referer": burl};r=requests.get(url, headers=headers);r.encoding = 'utf-8';body=r.content #<script type="text/javascript" src="http://www.playerapp1.pw/channel.php?file=118&width=800&height=450&autostart=true"></script> url = plugintools.find_single_match(body, 'src="([^"]+)') headers = {"Referer": 'http://www.stadium-live.biz/ch_1code.html'};r=requests.get(url, headers=headers);r.encoding = 'utf-8';body=r.content url = plugintools.find_single_match(body, 'src="([^"]+)');url=url.strip() #plugintools.log("url= "+url) #plugintools.log("ref= "+ref) headers = {"Referer": 'http://www.stadium-live.biz/ch_1code.html'};r=requests.get(url, headers=headers);r.encoding = 'utf-8';body=r.content print 'url',url print 'ref',ref playerapp1(url,ref,body) except KeyboardInterrupt: pass; except IndexError: raise
def playtvpw1(params): plugintools.log("[%s %s] PlayTV.pw1 parser %s " % (addonName, addonVersion, repr(params))) title_canales = [] url_canales = [] url = params.get("url") data = scrapertools.cache_page(url) #plugintools.log("data= "+data) #num_links_bloque = plugintools.find_single_match(data, 'jQuery(.*?)</script>') num_links_bloque = plugintools.find_single_match( data, '<div class="alternative-link"(.*?)</div>') plugintools.log("num_links_bloque= " + num_links_bloque) num_links = plugintools.find_multiple_matches( num_links_bloque, '<a class="mybutton" href="([^"]+)') title_links = plugintools.find_multiple_matches(num_links_bloque, ';">(.*?)</a>') for entry in num_links: url_canales.append(entry) for entri in title_links: title_canales.append(entri) #print url_canales #print title_canales try: dia = plugintools.selector(title_canales, 'PlayTV.pw') ch = url_canales[dia] ch = ch.replace("#", "") #plugintools.log("CANAL: "+ch) url_ajax = 'http://playtv.pw/wp-admin/admin-ajax.php?action=get_link_func&link=' + ch + '&id=' + params.get( "extra") plugintools.log("url_ajax= " + url_ajax) url = playtvpw2(params, url_ajax) plugintools.play_resolved_url(url) except KeyboardInterrupt: pass except IndexError: raise except: pass
def play_movie(params): plugintools.log("ruyaiptv.play_movie "+repr(params)) mediaurl = params.get("url") if "|" in params.get("url"): if plugintools.get_setting("quality_selector")=="0": selected = plugintools.selector(["Watch in SD","Watch in HD"],"Select quality") if selected==-1: return elif plugintools.get_setting("quality_selector")=="1": selected = 0 elif plugintools.get_setting("quality_selector")=="2": selected = 1 mediaurl = params.get("url").split("|")[selected] plugintools.play_resolved_url( mediaurl )
def SelectTemp(params, temp): #plugintools.log("[%s %a] Seriesadicto: selectTemp() " % (addonName, addonVersion, repr(params))) titles_temp = [] seasons = len(temp) i = 1 while i <= seasons: titles_temp.append( '[COLOR lightyellow]' + params.get("title").replace("[Multiparser]", "").strip() + ': [/COLOR]Temporada ' + str(i)) i = i + 1 print titles_temp select_temp = plugintools.selector(titles_temp, 'TV Ultra 7K') i = 0 while i <= seasons: if select_temp == i: params["season"] = temp[i] GetSerieChapters(params) i = i + 1
def stadiumlivebiz1(params): plugintools.log('[%s %s] Initializing stadium-live.biz parser... %s' % (addonName, addonVersion, repr(params))) try: ref = burl;ch = params.get("url");ch_total = ch.split(", ");title = params.get("title") selector = plugintools.selector(ch_total, title) if selector >= -1: kanal = ch_total[selector] kanal = kanal.split("(")[0] kanal=burl+kanal.replace(" ","").replace("Ch", "Channel").strip()+'.html' print kanal headers = {"Referer": burl};r=requests.get(kanal, headers=headers);r.encoding = 'utf-8';body=r.content #plugintools.log("body= "+body) caster = plugintools.find_multiple_matches(body, '<!--<script type="text/javascript" src="([^"]+)') for entry in caster: if entry.find("autostart=true") >= 0: #plugintools.log("entry= "+entry) caster = entry ref = kanal;url = ref.replace("Channel", "ch_").strip();url = url.replace(".html", "");url = url+'code.html' headers = {"Referer": burl};r=requests.get(url, headers=headers);r.encoding = 'utf-8';body=r.content #plugintools.log("body= "+body) #<script type="text/javascript" src="http://www.playerapp1.pw/channel.php?file=118&width=800&height=450&autostart=true"></script> url = plugintools.find_single_match(body, 'src="([^"]+)') headers = {"Referer": 'http://www.stadium-live.biz/ch_1code.html'};r=requests.get(url, headers=headers);r.encoding = 'utf-8';body=r.content url = plugintools.find_single_match(body, 'src="([^"]+)');url=url.strip() #plugintools.log("url= "+url) #plugintools.log("ref= "+ref) headers = {"Referer": 'http://www.stadium-live.biz/ch_1code.html'};r=requests.get(url, headers=headers);r.encoding = 'utf-8';body=r.content print 'url',url print 'ref',ref playerapp1(url,ref,body) except KeyboardInterrupt: pass; except IndexError: raise
def tous1(params): plugintools.setview("tvshows") plugintools.log("[%s %s] tous1 " % (addonName, addonId)) canales = [] referer = 'http://www.toussports.info' ref = referer title = params.get("title") plugintools.log("title= " + title) chs = plugintools.find_multiple_matches(title, 'Ch[0-9]+ ') for entry in chs: plugintools.log("entry= " + entry) canales.append(entry) print 'canales', canales try: plugintools.setview("tvshows") dia = plugintools.selector(canales, 'Toussports.info') ch = canales[dia] ch = ch.replace("Ch", "http://www.toussports.info/lecteur.php?id=").strip() print ch datos = '''data=gethttp_referer_headers(ch,referer);referer=ch;p='src="([^"]+)';ch=plugintools.find_single_match(data,p);#print data,url,referer''' exec(datos) exec(datos) exec(datos) exec(datos) datos = '''data=gethttp_referer_headers(ch,referer);p='src="([^"]+)';rurl=ch;ch=plugintools.find_single_match(data,p);''' exec(datos) exec(datos) ###DINOZAP### hidd = 'type="hidden".*?value="([^"]*)' hidd = plugintools.find_multiple_matches(data, hidd) try: y = hidd[0].decode('base64') x = hidd[1].decode('base64') w = 'http://www.businessapp1.pw/jwplayer5/addplayer/jwplayer.flash.swf' z = plugintools.find_single_match(x, '(vod.*)') except: xbmcgui.Dialog().ok( 'ATENCION', 'Cambios en la web,\nno puedo sacar el enlace!') plugintools.setview("tvshows") pass try: q = x + ' app=' + z + ' playpath=' + y + ' swfUrl=' + w + ' swfVfy=true live=true token=@@stop-stole@@ flashver=WIN\2013,0,0,214 timeout=15 pageUrl=' + rurl except: xbmcgui.Dialog().ok('ATENCION', 'Este canal no emite!') sys.exit() plugintools.setview("tvshows") pass print q plugintools.play_resolved_url(q) plugintools.setview("tvshows") sys.exit() except KeyboardInterrupt: pass except IndexError: raise except: pass
def multilink(params): plugintools.log('[%s %s].multilink %s' % (addonName, addonVersion, repr(params))) show = params.get("page") plugintools.set_view(show) dialog = xbmcgui.Dialog() filename = params.get("extra") plugintools.log("filename= "+filename) file = open(playlists + filename, "r") file.seek(0) title = params.get("title") #title = parser_title(params.get("title")) title_parsed = parser_title(params.get("title")) plugintools.log("title= "+title) if title.find(" ") >= 0: title = title.split(" ") title = title[0].strip() title = "@"+title # En la lista aparecerá el título precedido por el símbolo @ encuentra = '#EXTINF:-1,' + title.replace(" [COLOR lightyellow][Multilink][/COLOR]","").replace("[COLOR white]", "") if encuentra.startswith("#EXTINF:-1,@") == True: title_epg = title.replace("[COLOR white]","").split("[COLOR orange") if len(title_epg) >= 1: title_epg = title_epg[0] encuentra = '#EXTINF:-1,'+title_epg;encuentra=encuentra.strip() plugintools.log("*** Texto a buscar= "+encuentra) i = 0 data = file.readline() if data.startswith("#EXTINF:-1,@") == True: epg_no = plugintools.get_setting("epg_no") plugintools.log("epg_no= "+epg_no) if epg_no == "0": # No desactivado EPG pass else: data = data.replace("@", "") encuentra = encuentra.replace("@", "") print data while i <=8: # Control para EOF if data == "": i = i + 1 data = file.readline().strip() if data.startswith("#EXTINF:-1,@") == True: data = data.replace("@", "") continue else: i = 0 plugintools.log("encuentra= "+encuentra) plugintools.log("data= "+data) if data.startswith(encuentra) == True or data.startswith('#EXTINF:-1,@' + title.replace(" [COLOR lightyellow][Multilink][/COLOR]","")) == True: print 'correcto' data = file.readline().strip() if data == "#multilink": #Leemos número de enlaces i = 1 # Variable contador desde 1 porque nos servirá para nombrar los títulos # Recopilamos enlaces en una lista linea_url = file.readline().strip() if linea_url.startswith("desc") == True: linea_url = file.readline().strip() title_options = [] url_options = [] while linea_url != "#multilink" : linea_url = linea_url.strip().split(",") url_option = linea_url[1] title_option = linea_url[0] if title_option.startswith("@") == True: title_option = title_option.replace("@", "") # Ejecutamos EPG... epg_channel = [] epg_channel = epg_now(title_option) if epg_now(title_option) == False: print "No hay EPG" else: try: print epg_channel ejemplo = epg_channel[0] print epg_channel[0] title_option = title_option + " [COLOR orange][I][B] " + epg_channel[0] + "[/B] " + epg_channel[1] + "[/I][/COLOR] " except: pass title_option = str(i) + ': ' + title_option title_fixed = multiparse_title(title_option, url_option,show) title_option = title_fixed plugintools.log("title= "+title_option) i = i + 1 title_options.append(title_option) url_options.append(url_option) linea_url = file.readline() linea_url = linea_url.strip() print title_options print url_options num_items = i - 1 plugintools.log("Núm. items= "+str(num_items)) if title.startswith("@") == True: # Para evitar que en el título del cuadro de diálogo aparezca el nombre del canal precedido por el símbolo arroba (@) title = title.replace("@","") try: selector = plugintools.selector(title_options,title) print selector if selector >= 0: url_analyzer(url_options[selector]) except KeyboardInterrupt: pass; except IndexError: raise; else: data = file.readline().strip() plugintools.modo_vista(show)
def multiparser(params): plugintools.log('[%s %s].Multiparser %s' % (addonName, addonVersion, repr(params))) dialog = xbmcgui.Dialog() show = params.get("page") # Control de modo de vista predefinido plugintools.modo_vista(show) #info_plot = params["info_labels"] #print 'info_plot',info_plot filename = params.get("extra") plugintools.log("filename= "+filename) file = open(playlists + filename, "r") file.seek(0) title = params.get("title").replace("[Multiparser]", "").strip() title = parser_title(title) if title.find(" ") >= 0: title = title.split(" ") title = title[0].strip() title = "@"+title # En la lista aparecerá el título precedido por el símbolo @ #plugintools.log("title_epg= "+title) encuentra = '#EXTINF:-1,' + title.replace(" [COLOR lightyellow][Multiparser][/COLOR]","") plugintools.log("*** Texto a buscar= "+encuentra) i = 0 data = file.readline() #print data while i <=8: # Control para EOF if data == "": i = i + 1 data = file.readline().strip() #print data continue else: i = 0 if data.startswith(encuentra) == True: data = file.readline().strip() print data if data == "#multiparser": #Leemos número de enlaces i = 1 # Variable contador desde 1 porque nos servirá para nombrar los títulos # Recopilamos enlaces en una lista linea_url = file.readline().strip() if linea_url.startswith("desc") == True: linea_url = file.readline().strip() print 'linea_url',linea_url menu_seleccion = [] url_seleccion = [] while linea_url != "#multiparser" : linea_url = linea_url.strip().split(",") url_option = linea_url[1] title_option = linea_url[0] title_option = str(i) + ': ' + title_option title_fixed = multiparse_title(title_option, url_option, show) title_option = title_fixed plugintools.log("title= "+title_option) i = i + 1 menu_seleccion.append(title_option) url_seleccion.append(url_option) linea_url = file.readline() linea_url = linea_url.strip() print menu_seleccion num_items = i - 1 plugintools.log("Núm. items= "+str(num_items)) else: data = file.readline().strip() print menu_seleccion print title seleccion = plugintools.selector(menu_seleccion,title) print seleccion if seleccion >= 0: url_analyzer(url_seleccion[seleccion]) plugintools.modo_vista(show)
def multiparser(params): plugintools.log('[%s %s].Multiparser %s' % (addonName, addonVersion, repr(params))) dialog = xbmcgui.Dialog() show = params.get("page") # Control de modo de vista predefinido plugintools.modo_vista(show) #info_plot = params["info_labels"] #print 'info_plot',info_plot filename = params.get("extra") plugintools.log("filename= " + filename) file = open(playlists + filename, "r") file.seek(0) title = params.get("title").replace("[Multiparser]", "").strip() title = parser_title(title) if title.find(" ") >= 0: title = title.split(" ") title = title[0].strip() title = "@" + title # En la lista aparecerá el título precedido por el símbolo @ #plugintools.log("title_epg= "+title) encuentra = '#EXTINF:-1,' + title.replace( " [COLOR lightyellow][Multiparser][/COLOR]", "") plugintools.log("*** Texto a buscar= " + encuentra) i = 0 data = file.readline() #print data while i <= 8: # Control para EOF if data == "": i = i + 1 data = file.readline().strip() #print data continue else: i = 0 if data.startswith(encuentra) == True: data = file.readline().strip() print data if data == "#multiparser": #Leemos número de enlaces i = 1 # Variable contador desde 1 porque nos servirá para nombrar los títulos # Recopilamos enlaces en una lista linea_url = file.readline().strip() if linea_url.startswith("desc") == True: linea_url = file.readline().strip() print 'linea_url', linea_url menu_seleccion = [] url_seleccion = [] while linea_url != "#multiparser": linea_url = linea_url.strip().split(",") url_option = linea_url[1] title_option = linea_url[0] title_option = str(i) + ': ' + title_option title_fixed = multiparse_title(title_option, url_option, show) title_option = title_fixed plugintools.log("title= " + title_option) i = i + 1 menu_seleccion.append(title_option) url_seleccion.append(url_option) linea_url = file.readline() linea_url = linea_url.strip() print menu_seleccion num_items = i - 1 plugintools.log("Núm. items= " + str(num_items)) else: data = file.readline().strip() print menu_seleccion print title seleccion = plugintools.selector(menu_seleccion, title) print seleccion if seleccion >= 0: url_analyzer(url_seleccion[seleccion]) plugintools.modo_vista(show)
def multilink(params): plugintools.log('[%s %s].multilink %s' % (addonName, addonVersion, repr(params))) show = params.get("page") plugintools.set_view(show) dialog = xbmcgui.Dialog() filename = params.get("extra") plugintools.log("filename= " + filename) file = open(playlists + filename, "r") file.seek(0) title = params.get("title") #title = parser_title(params.get("title")) title_parsed = parser_title(params.get("title")) plugintools.log("title= " + title) if title.find(" ") >= 0: title = title.split(" ") title = title[0].strip() title = "@" + title # En la lista aparecerá el título precedido por el símbolo @ encuentra = '#EXTINF:-1,' + title.replace( " [COLOR lightyellow][Multilink][/COLOR]", "").replace( "[COLOR white]", "") if encuentra.startswith("#EXTINF:-1,@") == True: title_epg = title.replace("[COLOR white]", "").split("[COLOR orange") if len(title_epg) >= 1: title_epg = title_epg[0] encuentra = '#EXTINF:-1,' + title_epg encuentra = encuentra.strip() plugintools.log("*** Texto a buscar= " + encuentra) i = 0 data = file.readline() if data.startswith("#EXTINF:-1,@") == True: epg_no = plugintools.get_setting("epg_no") plugintools.log("epg_no= " + epg_no) if epg_no == "0": # No desactivado EPG pass else: data = data.replace("@", "") encuentra = encuentra.replace("@", "") print data while i <= 8: # Control para EOF if data == "": i = i + 1 data = file.readline().strip() if data.startswith("#EXTINF:-1,@") == True: data = data.replace("@", "") continue else: i = 0 plugintools.log("encuentra= " + encuentra) plugintools.log("data= " + data) if data.startswith(encuentra) == True or data.startswith( '#EXTINF:-1,@' + title.replace(" [COLOR lightyellow][Multilink][/COLOR]", "")) == True: print 'correcto' data = file.readline().strip() if data == "#multilink": #Leemos número de enlaces i = 1 # Variable contador desde 1 porque nos servirá para nombrar los títulos # Recopilamos enlaces en una lista linea_url = file.readline().strip() if linea_url.startswith("desc") == True: linea_url = file.readline().strip() title_options = [] url_options = [] while linea_url != "#multilink": linea_url = linea_url.strip().split(",") url_option = linea_url[1] title_option = linea_url[0] if title_option.startswith("@") == True: title_option = title_option.replace("@", "") # Ejecutamos EPG... epg_channel = [] epg_channel = epg_now(title_option) if epg_now(title_option) == False: print "No hay EPG" else: try: print epg_channel ejemplo = epg_channel[0] print epg_channel[0] title_option = title_option + " [COLOR orange][I][B] " + epg_channel[ 0] + "[/B] " + epg_channel[ 1] + "[/I][/COLOR] " except: pass title_option = str(i) + ': ' + title_option title_fixed = multiparse_title(title_option, url_option, show) title_option = title_fixed plugintools.log("title= " + title_option) i = i + 1 title_options.append(title_option) url_options.append(url_option) linea_url = file.readline() linea_url = linea_url.strip() print title_options print url_options num_items = i - 1 plugintools.log("Núm. items= " + str(num_items)) if title.startswith( "@" ) == True: # Para evitar que en el título del cuadro de diálogo aparezca el nombre del canal precedido por el símbolo arroba (@) title = title.replace("@", "") try: selector = plugintools.selector(title_options, title) print selector if selector >= 0: url_analyzer(url_options[selector]) except KeyboardInterrupt: pass except IndexError: raise else: data = file.readline().strip() plugintools.modo_vista(show)
def lstv1(params): menu_selec = ['[COLOR cyan]'+params.get("extra")+'[/COLOR]', "Ver cobertura internacional", "Estadísticas en vivo"] dia_lstv = plugintools.selector(menu_selec, params.get("title")) if dia_lstv == 1: lstv2() if dia_lstv == 2: lstv3()