def dailym_getvideo(url): plugintools.log("palcoTV.dailymotion_videos "+url) # Fetch video list from Dailymotion feed data = plugintools.read(url) #plugintools.log("data= "+data) # Extract items from feed pattern = "" matches = plugintools.find_multiple_matches(data,'{"(.*?)}') pattern = '{"(.*?)},{' for entry in matches: plugintools.log("entry= "+entry) # Not the better way to parse XML, but clean and easy title = plugintools.find_single_match(entry,'title":"(.*?)"') title = title.replace("\u00e9" , "é") title = title.replace("\u00e8" , "è") title = title.replace("\u00ea" , "ê") title = title.replace("\u00e0" , "à") video_id = plugintools.find_single_match(entry,'id":"(.*?)",') if video_id: plugintools.log("video_id= "+video_id) return video_id
def sportseven(params): plugintools.log("[PalcoTV-0.3.0].sport7.ru "+repr(params)) plugintools.add_item(action="", title='[COLOR white]s p o r t[COLOR red][B] 7[/B][/COLOR] . r u[/COLOR]' , url="", thumbnail = "http://sport7.ru/images/sport_logo.png" , fanart = "http://2.cdn.nhle.com/lightning/v2/ext/wallpaper/arena_fans_wallpaper_1680x1050.jpg" , folder=False, isPlayable=False) data = plugintools.read(params.get("url")) plugintools.log("data= "+data) matches = plugintools.find_single_match(data, 'class=\"head-match\"(.*?)class=\"mar-top5 jus\"') plugintools.log("matches= "+matches) title = plugintools.find_multiple_matches(matches, '<h2>(.*?)</h2>') for entry in title: canal = plugintools.find_single_match(matches, '<h2>'+entry+'(.*?)class=\"com_bl utext\"') plugintools.log("canal= "+canal) title = convertrus(entry) bitrate = plugintools.find_single_match(canal, '<div class=\"rc\">(.*?)</div>') url_p2p = plugintools.find_single_match(canal, 'sop://(.*?)\',') if url_p2p == "": url_p2p = plugintools.find_single_match(canal, 'acestream://(.*?)\'') url = 'plugin://plugin.video.p2p-streams/?url=acestream://' + url_p2p + '&mode=1&name=' url = url.strip() plugintools.log("URL_Acestream= "+url) title = '[COLOR lightyellow]' + title + ' [/COLOR][COLOR lightblue] [Acestream] [/COLOR][COLOR green]['+bitrate+'][/COLOR]' plugintools.add_item(action="play", title=title, url=url, thumbnail = "http://sport7.ru/images/sport_logo.png", fanart = "http://2.cdn.nhle.com/lightning/v2/ext/wallpaper/arena_fans_wallpaper_1680x1050.jpg" , folder = False, isPlayable = False) else: url = 'plugin://plugin.video.p2p-streams/?url=sop://' + url_p2p + '&mode=2&name=' url = url.strip() plugintools.log("URL_Sopcast= "+url) title = '[COLOR lightyellow]' + title + ' [/COLOR][COLOR darkorange] [Sopcast] [/COLOR][COLOR green]['+bitrate+'][/COLOR]' plugintools.add_item(action="play", title=title, url=url, folder = False, thumbnail = "http://sport7.ru/images/sport_logo.png", fanart = "http://2.cdn.nhle.com/lightning/v2/ext/wallpaper/arena_fans_wallpaper_1680x1050.jpg", isPlayable = False)
def themoviedb(title, datamovie): plugintools.log("The Movie Database: "+title) try: url = 'https://www.themoviedb.org/search?query='+title plugintools.log("URL= "+url) referer = 'https://www.themoviedb.org/' data = gethttp_referer_headers(url,referer) matches = plugintools.find_single_match(data, '<ul class="search_results movie">(.*?)</ul>') title_film = plugintools.find_single_match(matches, 'title="([^"]+)') plugintools.log("title_film= "+title_film) url_film = plugintools.find_single_match(matches, '<a href="([^"]+)') url_film_fixed = url_film.split("-") if len(url_film_fixed) >= 2: url_film_fixed = url_film[0] else: url_film_fixed = url_film url_film = 'https://www.themoviedb.org'+url_film+'?language=es' url_film = url_film.strip() plugintools.log("url_film= "+url_film) request_headers=[] request_headers.append(["User-Agent","Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_3) AppleWebKit/537.31 (KHTML, like Gecko) Chrome/26.0.1410.65 Safari/537.31"]) request_headers.append(["Referer", referer]) body,response_headers = plugintools.read_body_and_headers(url_film, headers=request_headers) plugintools.log("body= "+body) backdrop = plugintools.find_single_match(body, '<meta name="twitter:image" content="([^"]+)') datamovie["Fanart"]=backdrop plugintools.log("backdrop= "+backdrop) except: pass
def program_capis(params): plugintools.log("[PalcoTV-0.3.0].LaTuerka Videos"+repr(params)) fanart = params.get("extra") data = plugintools.read(params.get("url")) #plugintools.log("data= "+data) #<a href="/publico-tv/program/59/video/216146/otra-vuelta-de-tuerka-jesus-cintora" class="play"><span>Reproducir</span></a> items_programa = plugintools.find_multiple_matches(data, '<div class="thumb">(.*?)</li>') for entry in items_programa: plugintools.log("items_programa= "+entry) url_programa = plugintools.find_single_match(entry, '<a href=\"(.*?)\"') img_programa = plugintools.find_single_match(entry, '<img src=\"(.*?)\"') title_programa = plugintools.find_single_match(entry, 'title="">(.*?)</a></p>') title_programa = title_programa.split('title="">') title_programa = title_programa[1] title_programa = title_programa.replace("ñ", "ñ") #url_programa = plugintools.find_multiple_matches(entry, '<a href=(.*?)class=\"foto') url_programa = 'http://www.publico.es' + url_programa plugintools.log("url_programa= "+url_programa) url = tuerka_link(url_programa) plugintools.log("img_programa= "+img_programa) plugintools.log("title_programa= "+title_programa) plugintools.add_item(action="play", title = title_programa, url = url , thumbnail = img_programa, fanart = 'http://www.latuerka.net/img/bg.jpg' , folder = False , isPlayable = True)
def dailym_pl(params): plugintools.log("dailym_pl " + repr(params)) pl = params.get("url") data = plugintools.read(pl) plugintools.log("playlist= " + data) dailym_vid = plugintools.find_multiple_matches(data, "{(.*?)}") for entry in dailym_vid: plugintools.log("entry= " + entry) title = plugintools.find_single_match(entry, '"title":"(.*?)",') title = title.replace('"', "") title = title.replace("\*", "") video_id = plugintools.find_single_match(entry, '"id":"(.*?)",') thumbnail = "https://api.dailymotion.com/thumbnail/video/" + video_id + "" if thumbnail == "": thumbnail = "http://image-parcours.copainsdavant.com/image/750/1925508253/4094834.jpg" url = "plugin://plugin.video.dailymotion_com/?url=" + video_id + "&mode=playVideo" print "url", url plugintools.add_item( action="play", title=title, url=url, folder=False, fanart="http://image-parcours.copainsdavant.com/image/750/1925508253/4094834.jpg", thumbnail=thumbnail, isPlayable=True, )
def lista_capis(params): plugintools.log('[%s %s] lista_capis %s' % (addonName, addonVersion, repr(params))) show = plugintools.get_setting("series_id") if show == "": show = "tvshows" plugintools.modo_vista(show) plugintools.log("show= "+show) thumbnail = params.get("thumbnail") if thumbnail == "": thumbnail = 'http://m1.paperblog.com/i/249/2490697/seriesflv-mejor-alternativa-series-yonkis-L-2whffw.jpeg' fanart = 'http://www.nikopik.com/wp-content/uploads/2011/10/S%C3%A9ries-TV.jpg' sinopsis = params.get("plot") datamovie = {} datamovie["Plot"]=sinopsis url = params.get("url") referer = 'http://www.seriesflv.net/' data = gethttp_referer_headers(url,referer,show) # Carátula de la serie cover = plugintools.find_single_match(data, '<div class="portada">(.*?)</div>') thumbnail = plugintools.find_single_match(cover, 'src="([^"]+)') matches = plugintools.find_multiple_matches(data, '<th class="sape">Capitulos</th>(.*?)</table>') for entry in matches: capis= plugintools.find_multiple_matches(entry, '<td class="sape">(.*?)</td>') for entry in capis: title_capi = plugintools.find_single_match(entry, 'class="color4">(.*?)</a>') url_capi = plugintools.find_single_match(entry, '<a href="([^"]+)') plugintools.add_item(action="chapter_urls", title= title_capi, url= url_capi, info_labels = datamovie , page = show , extra = show , thumbnail = thumbnail , fanart = fanart , folder = True, isPlayable = False)
def tumarcador_canales(params): # 31-10-16 titulo = params.get("title") canal = params.get("url") fondo = params.get("fanart") logo = params.get("thumbnail") ## >5 y [COLOR red]5-Acestream[/COLOR]<fin canal_normal = plugintools.find_single_match(canal,'>(.*?) y') canal_aces = plugintools.find_single_match(canal,'red](.*?)-') pagina_aces = "http://tumarcador.xyz/canal" + canal_aces + "a.php" plugintools.add_item(action="",url="",title=titulo,thumbnail=logo,fanart=fondo,folder=False,isPlayable=False) plugintools.add_item(action="",url="",title="",thumbnail=logo, fanart=fondo, folder=False, isPlayable=False) r=requests.get(pagina_aces) data = r.content #Busco los 2 enlaces aces... el m3u8 y el acestream m3u8 = plugintools.find_single_match(data,'file: "(.*?)"') aces = "acestream://" + plugintools.find_single_match(data,'acestream://(.*?)"') el_canal = "http://tumarcador.xyz/canal" + canal_normal + ".php" lanzo_spd = url_montada.replace("MI_CANAL", el_canal) url_montada2 = 'plugin://plugin.video.SportsDevil/?mode=1&item=catcher%3dstreams%26url='+m3u8+'%26referer=http://tumarcador.xyz/' url_montada3 = 'plugin://plugin.video.SportsDevil/?mode=1&item=catcher%3dstreams%26url='+aces+'%26referer=http://tumarcador.xyz/' plugintools.runAddon(action="runPlugin",url=lanzo_spd,title="[COLOR white]-Ver en Canal "+canal_normal+"[/COLOR]",thumbnail=logo, fanart=fondo, folder=False, isPlayable=True) plugintools.add_item(action="runPlugin",url=url_montada3,title="[COLOR red]-Ver en Canal "+canal_aces+"a Formato Acestream[/COLOR]",thumbnail=logo,fanart=fanart,folder=False,isPlayable=True) plugintools.add_item(action="runPlugin",url=url_montada2,title="[COLOR blue]-Ver en Canal "+canal_aces+"a Formato m3u8[/COLOR]",thumbnail=logo,fanart=fanart,folder=False,isPlayable=True)
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 lightyellow][B]¿Qué ver más 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 orange][B]'+channel+' [/B][COLOR lightyellow][B]'+hora_mastarde + '[/B] '+evento_mastarde+'[/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 search(params): plugintools.log("movie4k.search "+repr(params)) text = plugintools.keyboard_input(title="Input search terms") url = MAIN_URL+"movies.php?list=search" post = "search="+text.replace(" ","+") body,response_headers = read_body_and_headers_cached(url, post=post) pattern = '<TR id="coverPreview\d+">(.*?)</TR>' matches = plugintools.find_multiple_matches(body,pattern) for match in matches: pattern = '<a href="([^"]+)">([^<]+).*?<img border=0 src="([^"]+)' scrapedurl, scrapedtitle, flag = plugintools.find_single_match(match, pattern) pattern = '/img/smileys/(\d).gif' quality = plugintools.find_single_match(match, pattern) pattern = '<STRONG>(\d+\.*\d*)' rating = plugintools.find_single_match(match, pattern) url = urljoin(url,scrapedurl) title = html_unescape(scrapedtitle) title = re.sub('\s+', ' ', title).strip() + " (" + get_language_from_flag_img(flag) + " IMDB:" + rating + " Quality:" + quality + ")" plugintools.log("movie4k.search title=" + title + ", url=" + url) if "watch-tvshow" in url: url = MAIN_URL+"tvshows-season-"+plugintools.find_single_match(url,MAIN_URL+"([A-Za-z0-9\-]+)-watch-tvshow-\d+.html")+".html" plugintools.add_item( action="tvshow_seasons", title=title, url=url, fanart=FANART , folder=True ) else: plugintools.add_item( action="single_movie", title=title, url=url, fanart=FANART , folder=True )
def curl_frame(url, ref, body, bodyi, bodyy, urli): request_headers = [] request_headers.append(["User-Agent", "Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)"]) request_headers.append(["Referer", ref]) try: body, response_headers = plugintools.read_body_and_headers(url, headers=request_headers) # print "HEADERS:\n";print response_headers except: pass try: r = "'set-cookie',\s'([^;]+.)" jar = plugintools.find_single_match(str(response_headers), r) jar = getjad(jar) except: pass try: r = "'location',\s'([^']+)" loc = plugintools.find_single_match(str(response_headers), r) except: pass if loc: request_headers.append(["Referer", url]) if jar: request_headers.append(["Cookie", jar]) # print jar body, response_headers = plugintools.read_body_and_headers(loc, headers=request_headers) try: r = "'set-cookie',\s'([^;]+.)" jar = plugintools.find_single_match(str(response_headers), r) jar = getjad(jar) except: pass if body: bodyi += [body] return body
def header_pl(data, title_header): # Mostramos encabezado header = plugintools.find_single_match(data, '<div id="pl-header"(.*?)</ul>') #plugintools.log("header= "+header) title = plugintools.find_single_match(header, '<h1 class="pl-header-title">(.*?)</h1>').strip() plugintools.log("title= "+title) pl_name = plugintools.find_single_match(header, 'data-name="">(.*?)</a>').strip() hits = plugintools.find_multiple_matches(header, '<li>(.*?)</li>') hit_list = [] for entry in hits: #plugintools.log("hit= "+entry) hit_list.append(entry) if title == "": plugintools.add_item(action="", title = title_header, url = "", folder=False, isPlayable=False) return title_header else: try: title_header = '[COLOR orange][B]'+title+'[/B][I][COLOR white] '+hit_list[1]+' [COLOR lightyellow]'+hit_list[2]+'[/I][/COLOR]' plugintools.add_item(action="", title = title_header, url = "", folder=False, isPlayable=False) return title_header except: title_header = '[COLOR orange][B]'+title+'[/B][I][COLOR white] '+hit_list[1]+' [/I][/COLOR]' plugintools.add_item(action="", title = title_header, url = "", folder=False, isPlayable=False) return title_header
def youtube_videos(url): plugintools.log('[%s %s].youtube_videos %s' % (addonName, addonVersion, url)) # Fetch video list from YouTube feed data = plugintools.read(url) plugintools.log("data= "+data) # Extract items from feed pattern = "" matches = plugintools.find_multiple_matches(data,"<entry(.*?)</entry>") for entry in matches: plugintools.log("entry="+entry) # Not the better way to parse XML, but clean and easy title = plugintools.find_single_match(entry,"<titl[^>]+>([^<]+)</title>") title = title.replace("I Love Handball | ","") plot = plugintools.find_single_match(entry,"<summa[^>]+>([^<]+)</summa") thumbnail = plugintools.find_single_match(entry,"<media\:thumbnail url='([^']+)'") fanart = art+'youtube.png' video_id = plugintools.find_single_match(entry,"http\://www.youtube.com/watch\?v\=([0-9A-Za-z_-]{11})") url = "plugin://plugin.video.youtube/?path=/root/video&action=play_video&videoid="+video_id # Appends a new item to the xbmc item list plugintools.add_item( action="play" , title=title , plot=plot , url=url , thumbnail=thumbnail , fanart=fanart , isPlayable=True, folder=False )
def login_pordede(): plugintools.log('[%s %s] ---> Iniciando login en Pordede.com... <--- ' % (addonName, addonVersion)) params = plugintools.get_params() url = "http://www.pordede.com/site/login" post = "LoginForm[username]="+plugintools.get_setting("pordede_user")+"&LoginForm[password]="+plugintools.get_setting("pordede_pwd") headers = DEFAULT_HEADERS[:] regex = params.get("extra") try: if os.path.exists(temp+'pordede.com') is True: print "Eliminando carpeta caché..." os.remove(temp+'pordede.com') except: pass data = scrapertools.cache_page(url,headers=headers,post=post);print data if data != "": login_info = plugintools.find_single_match(data, '<div class="friendMini shadow"(.*?)</div>') user_title = plugintools.find_single_match(login_info, 'title="([^"]+)') user_thumb = plugintools.find_single_match(login_info, 'src="([^"]+)') if regex == "": plugintools.log("regex= "+regex) plugintools.add_item(action="menuseries", title='Usuario: [COLOR lightyellow][I]'+user_title+'[/I][/COLOR]', url="", thumbnail=user_thumb, fanart=fanart, folder=True, isPlayable=False) plugintools.add_item(action="menuseries", title="Series", url="", thumbnail=thumbnail, fanart=fanart, folder=True, isPlayable=False) plugintools.add_item(action="menupeliculas", title="Películas", url="", thumbnail=thumbnail, fanart=fanart, folder=True, isPlayable=False) plugintools.add_item(action="listas_sigues", title="Listas que sigues", url="http://www.pordede.com/lists/following", thumbnail=thumbnail, fanart=fanart, folder=True, isPlayable=False) plugintools.add_item(action="tus_listas", title="Tus listas", url="http://www.pordede.com/lists/yours", thumbnail=thumbnail, fanart=fanart, folder=True, isPlayable=False) plugintools.add_item(action="listas_sigues", title="Top listas", url="http://www.pordede.com/lists", thumbnail=thumbnail, fanart=fanart, folder=True, isPlayable=False)
def lstv2(): params = plugintools.get_params() url = params.get("url") data = gethttp_referer_headers(url,url) match_coverage = plugintools.find_single_match(data, 'International Coverage(.*?)<div id="match-lineups" class="match-info hidden">') country_match = plugintools.find_multiple_matches(match_coverage, '<div class="row">(.*?)<div class="b_channel col-xs-12 -low b_trim -international">') for entry in country_match: plugintools.log("entry= "+entry) country = plugintools.find_single_match(entry, '<div class="fll b_channel_name -broadcast -country b_trim_inner">(.*?)</div>').replace(" ", "").strip() if country != "": channels = "" channel = plugintools.find_multiple_matches(entry, '<div class="fll b_channel_name -broadcast b_trim_inner">(.*?)</div>') for item in channel: if channels == "": channels = item else: channels = channels + ', '+item lstv_file = open(temp + "lstv.tmp", "a") lstv_file.write('[COLOR gold][B]'+country+'[/B][/COLOR][COLOR white]: '+channels+'[/COLOR]\n') lstv_file.close() params["url"] = temp + 'lstv.tmp' txt_reader(params)
def peliculas(params): plugintools.log("[%s %s] Pordede: Listando películas... %s " % (addonName, addonVersion, repr(params))) url = params.get("url") # Descarga la pagina headers = DEFAULT_HEADERS[:] headers.append(["X-Requested-With","XMLHttpRequest"]) data = scrapertools.cache_page(url,headers=headers) #plugintools.log("data= "+data) # Extrae las entradas (carpetas) items = plugintools.find_multiple_matches(data, 'defaultLink(.*?)data-action') for entry in items: entry=entry.replace('\\', '').replace("u00e1", "á").replace("u00ed", "í").replace("u00e9", "é").replace("u00f3", "ó").replace("u00a1", "¡").replace("00f1", "ñ") #plugintools.log("entry= "+entry) title_item = plugintools.find_single_match(entry, 'title=(.*?)>') url_item = plugintools.find_single_match(entry, 'href=(.*?)>') thumb_item = plugintools.find_single_match(entry, 'http(.*?)png') year_item = plugintools.find_single_match(entry, 'year(.*?)<') rank_item = plugintools.find_single_match(entry, '</i>(.*?)</span>') title_item=title_item.replace("\\", "").replace('"', "") url_item=url_item.replace("\\", "").replace('"', "");url_item='http://www.pordede.com'+url_item;url_item=url_item.replace("/peli/","/links/view/slug/")+"/what/peli" thumb_item='http'+thumb_item+'png' year_item=year_item.replace("\\", "").replace('"', "").replace(">", "") rank_item=rank_item.replace("\\", "").replace('"', "") #plugintools.log("title_item= "+title_item) #plugintools.log("url_item= "+url_item) #plugintools.log("thumb_item= "+thumb_item) #plugintools.log("year_item= "+year_item) #plugintools.log("rank_item= "+rank_item) title_fixed= '[COLOR white]'+title_item+' [/COLOR][COLOR lightyellow][I]('+year_item+') [/COLOR][COLOR lightgreen] ['+rank_item+'][/I][/COLOR]' plugintools.add_item(action="pdd_findvideos", title=title_fixed, url=url_item, thumbnail=thumb_item, fanart=fanart, folder=True, isPlayable=False)
def movies_all(params): plugintools.log("movie4k.movies_all "+repr(params)) #plugintools.set_view(plugintools.THUMBNAIL) body,response_headers = read_body_and_headers(params.get("url")) pattern = '<TR id="(coverPreview\d+)[^<]+' pattern += '<TD width="550" id="tdmovies"[^<]+' pattern += '<a href="([^"]+)">([^<]+)</a[^<]+.*?<TD align="right" id="tdmovies"[^<]+<img border=0 src="([^\"]+)"' matches = plugintools.find_multiple_matches(body,pattern) for cover_id, scrapedurl, scrapedtitle, flag in matches: url = urlparse.urljoin(params.get("url"),scrapedurl) title = scrapedtitle.strip() if title.strip().endswith(":"): title = title.strip()[:-1] title=title + get_language_from_flag_img(flag) thumbnail = plugintools.find_single_match(body,"\$\(\"\#"+cover_id+"\"\).hover\(function\(e\)[^<]+<p id='coverPreview'><img src='([^']+)'") plot = "" plugintools.log("movie4k.movies_all title="+title+", url="+url+", thumbnail="+thumbnail) plugintools.add_item( action="single_movie", title=title, url=url, thumbnail=thumbnail , plot=plot, fanart=thumbnail , folder=True ) next_page_url = plugintools.find_single_match(body,'<div id="boxwhite">\d+ </div><div id="boxgrey"><a href="([^"]+)">\d+') next_page_number = plugintools.find_single_match(body,'<div id="boxwhite">\d+ </div><div id="boxgrey"><a href="[^"]+">(\d+)') if next_page_url!="": plugintools.add_item( action="movies_all", title=">> Go to page "+next_page_number, url=urlparse.urljoin(params.get("url"),next_page_url), folder=True )
def tvshows_all(params): plugintools.log("movie4k.tvshows_all "+repr(params)) #plugintools.set_view(plugintools.THUMBNAIL) ''' <TR> <TD id="tdmovies" width="538"><a href="tvshows-season-Jane-by-Design.html">Jane By Design </a></TD> <TD id="tdmovies"><img border=0 src="http://img.movie4k.to/img/us_flag_small.png" width=24 height=14></TD> </TR> ''' body,response_headers = read_body_and_headers(params.get("url")) pattern = '<TR[^<]+' pattern += '<TD id="tdmovies" width="538"[^<]+' pattern += '<a href="([^"]+)">([^<]+)</a.*?<img border=0 src="([^\"]+)"' matches = plugintools.find_multiple_matches(body,pattern) for scrapedurl, scrapedtitle, flag in matches: url = urlparse.urljoin(params.get("url"),scrapedurl) title = scrapedtitle.strip() if title.strip().endswith(":"): title = title.strip()[:-1] title=title + get_language_from_flag_img(flag) thumbnail = "" plot = "" plugintools.log("movie4k.tvshows_all title="+title+", url="+url+", thumbnail="+thumbnail) plugintools.add_item( action="tvshow_seasons", title=title, url=url, thumbnail=thumbnail , plot=plot, fanart=thumbnail , folder=True ) next_page_url = plugintools.find_single_match(body,'<div id="boxwhite">\d+ </div><div id="boxgrey"><a href="([^"]+)">\d+') next_page_number = plugintools.find_single_match(body,'<div id="boxwhite">\d+ </div><div id="boxgrey"><a href="[^"]+">(\d+)') if next_page_url!="": plugintools.add_item( action="tvshows_all", title=">> Go to page "+next_page_number, url=urlparse.urljoin(params.get("url"),next_page_url), folder=True )
def isohunt1_bum(params): plugintools.log('[%s %s] [BUM+] Isohunt results... %s' % (addonName, addonVersion, repr(params))) thumbnail = 'http://www.userlogos.org/files/logos/dfordesmond/isohunt%201.png' fanart = 'http://2.bp.blogspot.com/_NP40rzexJsc/TMGWrixybJI/AAAAAAAAHCU/ij1--_DQEZo/s1600/Keep_Seeding____by_Carudo.jpg' show = 'list' plugintools.modo_vista(show) #plugintools.add_item(action="", title= '[COLOR blue][B]Iso[/COLOR][COLOR lightblue][I]Hunt[/I][/COLOR] [/B][COLOR lightyellow][I]By Juarrox[/I][/COLOR]', url = "", thumbnail = thumbnail , fanart = fanart, folder = False, isPlayable = False) url = params.get("url") referer = 'https://isohunt.to/' data = gethttp_referer_headers(url,referer) #Todo: Añadir modo de vista (show) #plugintools.log("data= "+data) matches = plugintools.find_multiple_matches(data, '<tr data-key="(.*?)</td></tr>') for entry in matches: plugintools.log("entry= "+entry) page_url = plugintools.find_single_match(entry, '<a href="([^"]+)') page_url = 'https://isohunt.to'+page_url title_url = plugintools.find_single_match(entry, '<span>(.*?)</span>') plugintools.log("title_url= "+title_url) plugintools.log("page_url= "+page_url) size = plugintools.find_single_match(entry, '<td class="size-row">(.*?)</td>') plugintools.log("size= "+size) seeds = plugintools.find_single_match(entry, '<td class=" sy">(.*?)</td>') leechs = '?' plugintools.log("seeds= "+seeds) category = plugintools.find_single_match(entry, 'title="([^"]+)') plugintools.log("category= "+category) if entry.find("Verified Torrent") >= 0: verified = '[COLOR lightgreen][I][Verified][/I][/COLOR]' plugintools.log("verified yes") plugintools.add_item(action="isohunt2_bum", title= '[COLOR gold][I]['+seeds+'/'+leechs+'][/I][/COLOR] [COLOR white] '+title_url+' [/COLOR] [COLOR lightyellow][I]['+size + '] [Isohunt][/I][/COLOR]', url = page_url , thumbnail = thumbnail, fanart = fanart, folder = False, isPlayable = True)
def video(params): plugintools.log("miratuserie_tv.video "+repr(params)) url=params.get("url") plugintools.add_item(title=url) #"verVid('kv2a6a98x113','played',0,1,0,1,'es'); sub="112" urlorg="americanhorrorstory/ir"" #url ="verVid('kv2a6a98x113','played',0,1,0,1,'es'); sub='112' urlorg='americanhorrorstory/ir'" id=plugintools.find_single_match(url,"verVid\((.*?)\);") split1= plugintools.find_multiple_matches(id,"'(.*?)'") split2= plugintools.find_multiple_matches(id,",(\d)") #spliit1 [0] key ,[1]host,[2]idiomas #split2 [0]plugin,[1]subs,[2]hd,[3]gk sub= plugintools.find_single_match(url,'sub="(.*?)"') urlorig= plugintools.find_single_match(url,'urlorg="(.*?)"') #print sub #print urlorig key=split1[0] host=split1[1] plugin=split2[0] subs=split2[1] sub=sub hd=split2[2] gk=split2[3] idiomas=split1[2] urlserie=urlorig urlvideo=get_url_video(key,host,plugin,subs,sub,hd,gk,idiomas,urlserie) #print "--------split------",split1,"--------split2------",split2 #print key,host,plugin,subs,sub,hd,gk,idiomas,urlserie,urlvideo pagvideo=plugintools.read(urlvideo) print "-----------------------pagvideo----------------------------------",pagvideo,"-----------------------------------------------"
def seriesblanco1(params): plugintools.log('[%s %s] Linker SeriesBlanco %s' % (addonName, addonVersion, repr(params))) sinopsis = params.get("plot") datamovie = {} datamovie["Plot"]=sinopsis thumbnail = params.get("thumbnail") fanart = params.get("fanart") headers = {'Host':"seriesblanco.com","User-Agent": 'User-Agent=Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; es-ES; rv:1.9.2.12) Gecko/20101026 Firefox/3.6.12', "Referer": referer} url = params.get("url").replace('www.seriesblanco.com','seriesblanco.com') r = requests.get(url,headers=headers) data = r.content plugintools.add_item(action="",url="",title="[COLOR lightblue][B]Linker SeriesBlanco"+version+"[/B][COLOR lightblue]"+sc4+"[I] ***PLD.VisionTV***[/I]"+ec4,thumbnail=thumbnail,fanart=fanart,folder=False,isPlayable=False) #No hay peticion Ajax match_listacapis = plugintools.find_single_match(data,"<h2>Visionados Online</h2>(.*?)<h2>Descarga</h2>") #Si hay peticion Ajax if match_listacapis =="": # Buscando la url y datos del envio post a la peticion ajax ajax = plugintools.find_single_match(data,"function LoadGrid(.*?)success:") ajaxrequest = plugintools.find_single_match(ajax,"url : '(.*?)'.*?data : \"(.*?)\"") # Petición ajax url_ajax = scrapertools.cache_page(referer + ajaxrequest[0], ajaxrequest[1]) custom_post=ajaxrequest[1] body,response_headers = plugintools.read_body_and_headers(referer+ajaxrequest[0], post=custom_post) #plugintools.log("data= "+data) match_listacapis = plugintools.find_single_match(body,'<h2>Visionados Online</h2>(.*?)</table>') match_capi = plugintools.find_multiple_matches(match_listacapis,'<td><div class="grid_content sno">(.*?)<br>') for entry in match_capi: img = plugintools.find_single_match(entry,"src='/servidores([^']+)") url_img = 'http://www.seriesblanco.com/servidores'+img url_capi = plugintools.find_single_match(entry,'<a href="([^"]+)"') #url_capi = 'http://www.seriesblanco.com'+url_capi #Puede ser seriesblanco.tv o seriesblanco.com lang_audio = plugintools.find_single_match(entry,'<img src="http://seriesblanco.tv/banderas/([^"]+)"') if lang_audio =="": lang_audio = plugintools.find_single_match(entry,'<img src="http://seriesblanco.com/banderas/([^"]+)"') if lang_audio.find("es.png") >= 0: lang_audio = "ESP" elif lang_audio.find("la.png") >= 0: lang_audio = "LAT" elif lang_audio.find("vos.png") >= 0: lang_audio = "V.O.S." elif lang_audio.find("vo.png") >= 0: lang_audio = "V.O." url_server = plugintools.find_single_match(entry,"<img src='/servidores/([^']+)") url_server = url_server.replace(".png", "").replace(".jpg", "") quality = plugintools.find_single_match(entry,"<img src='/servidores/.*?alt=''>.*?</center></td><td class='tam12'>(.*?)</td>") #if quality == "": quality = "undefined" server = video_analyzer(url_server) titlefull = params.get("title")+sc2+'[I] ['+lang_audio+'] [/I]'+ec2+sc5+'[I] ['+server+'][/I] '+ec5+sc+'[I]'+quality+'[/I]'+ec if server != "": plugintools.addPeli(action="getlink_seriesblanco",title=titlefull,url=url_capi,info_labels=datamovie,thumbnail=url_img,fanart=fanart,folder=False,isPlayable=True)
def themoviedb(title, datamovie): plugintools.log("TMD: "+title) title_fixed = title.replace(" ", "+") plugintools.log("title_fixed= "+title_fixed) url = 'https://www.themoviedb.org/search?query='+title_fixed+'?language=es' plugintools.log("URL= "+url) referer = 'https://www.hemoviedb.org/' data = gethttp_referer_headers(url,referer) plugintools.log("data= "+data) matches = plugintools.find_single_match(data, '<ul class="search_results movie">(.*?)</ul>') plugintools.log("matches= "+matches) title_film = plugintools.find_single_match(matches, 'title="([^"]+)') plugintools.log("title_film= "+title_film) url_film = plugintools.find_single_match(matches, '<a href="([^"]+)') url_film = 'https://www.themoviedb.org/'+url_film+'?language=es' plugintools.log("url_film= "+url_film) year_film = plugintools.find_single_match(matches, '<span>(.*?)</span>') plugintools.log("year_film= "+year_film) body = gethttp_referer_headers(url_film,referer) plugintools.log("body= "+body) sinopsis = plugintools.find_single_match(body, 'itemprop="description">(.*?)</p>') datamovie["Plot"]=sinopsis.replace('"',"'") plugintools.log("sinopsis= "+sinopsis) crew_match = plugintools.find_single_match(body, '<h3>Crew</h3>(.*?)</table>') match_director = plugintools.find_single_match(crew_match, '<td class="job">Director:</td>(.*?)</td>') director = plugintools.find_multiple_matches(match_director, 'itemprop="name">(.*?)</span>') directores = "" for match in director: if directores == "": directores = match else: directores = directores+", "+match datamovie["Director"] = directores plugintools.log("director(es)= "+directores) match_writers = plugintools.find_single_match(crew_match, '<td class="job">Writers:</td>(.*?)</td>') writers = plugintools.find_multiple_matches(match_director, 'itemprop="name">(.*?)</span>') guionistas = "" for entry in writers: if guionistas == "": guionistas = entry else: guionistas = guionistas+", "+entry datamovie["Writer"] = guionistas plugintools.log("guionista(s)= "+guionistas) backdrop = plugintools.find_single_match(body, '<meta name="twitter:image" content="([^"]+)') datamovie["Fanart"]=backdrop plugintools.log("backdrop= "+backdrop) match_genres = plugintools.find_single_match(body, '<span id="genres">(.*?)</ul>') genres_match = plugintools.find_multiple_matches(match_genres, '<span itemprop="genre">(.*?)</span>') generos = "" for genero in genres_match: if generos == "": generos = genero else: generos = generos+", "+genero datamovie["Genre"] = generos plugintools.log("generos= "+generos)
def peaktv(params): #plugintools.get_localized_string(21) url = params.get("url") request_headers=[] request_headers.append(["User-Agent","Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)"]) body,response_headers = plugintools.read_body_and_headers(url, headers=request_headers) #os.environ["HTTP_PROXY"]=Proxy data=body #print "START="+params.get("url") p = 'href="([^<]*)' matches = plugintools.find_multiple_matches_multi(data,p) del matches[0] for scrapedurl in matches: url = scrapedurl.strip() #print url title = plugintools.find_single_match(url,'>(.*?:[^:]+)') #title = title.replace("\xe2","a".encode('iso8859-16')); title = title.replace("\xe2","a"); title = title.replace("\xc3","t"); title = title.replace("\xe0","f"); title = title.replace("\xfc","u"); title = title.replace("\xdb","s"); title = title.replace("\x15f","s"); ''' #print title.decode("utf-8") print unicode(title,"iso8859-16") ''' canal = plugintools.find_single_match(url,'php\?([^"]+)') url = 'http://peaktv.me/Live.php/?'+canal.strip() if 'DigiSport1' in str(url): thumb='http://www.digisport.ro/img/sigla_digisport1.png' elif 'DigiSport2' in str(url): thumb='http://itutorial.ro/wp-content/uploads/digi_sport2.png' elif 'DigiSport3' in str(url): thumb='http://www.sport4u.tv/web/logo/sport/digi_sport3_ro.png' elif 'DolceSportHD' in str(url): thumb='http://static.dolcetv.ro/img/tv_sigle/sigle_black/116.png' elif 'DolceSport1' in str(url): thumb='http://static.dolcetv.ro/img/tv_sigle/sigle_black/101.png' elif 'DolceSport2' in str(url): thumb='http://static.dolcetv.ro/img/tv_sigle/sigle_black/107.png' elif 'DolceSport3' in str(url): thumb='http://static.dolcetv.ro/img/tv_sigle/sigle_black/134.png' elif 'DolceSport4' in str(url): thumb='http://static.dolcetv.ro/img/tv_sigle/sigle_black/247.png' elif 'EuroSport2HD' in str(url): thumb='http://www.sport4u.tv/web/logo/sport/eurosport-2.png' elif 'EuroSport1HD' in str(url): thumb='http://4.bp.blogspot.com/-k50Qb45ZHGY/UrMCA2zRoGI/AAAAAAAAStA/Dj6sF0dHcs8/s1600/790px-Eurosport_logo.svg.png' elif 'LookPlusHD' in str(url): thumb='http://upload.wikimedia.org/wikipedia/commons/thumb/a/ac/Look_Plus_HD.png/100px-Look_Plus_HD.png' elif 'LookTVHD' in str(url): thumb='http://upload.wikimedia.org/wikipedia/commons/thumb/8/89/Look_TV_HD_logo.png/100px-Look_TV_HD_logo.png' else: thumb='http://frocus.net/images/logotv/Sport-ro_HD.jpg' print thumb fanart = thumb plugintools.add_item( action="peaktv2" , title=title , url=url ,thumbnail=thumb ,fanart=fanart , isPlayable=True, folder=False )
def jscalpe(bodyy, url, ref): print "jscalpe(bodyy,url,ref)" p = ( "m3u8", "freelivetv", "freetvcast", "goo\.gl", "vercosasgratis", "verdirectotv", "byetv", "9stream", "castalba", "direct2watch", "kbps", "flashstreaming", "cast247", "ilive", "freebroadcast", "flexstream", "mips", "veemi", "yocast", "yukons", "ilive", "iguide", "ucaster", "ezcast", "plusligaonline", "tvonlinegratis", "dinozap", "businessapp1", ) z = len(p) for i in range(0, z): regex = "<script.*?(" + str(p[i]) + ").*?<\/script>" caster = [] enctrd = plugintools.find_single_match(bodyy, regex) #!!!Quita el "if" de abajo para ver todo los "enctrd" encontrados de cada "p" caster !!! if len(enctrd) > 0: caster = "".join(map(str, enctrd)) print caster r = re.compile("(<script.*?(?=>)>(.*?)(?=<))?.*?src='?\"?(.*?" + caster + "[^'\",;]+)", re.VERBOSE) res = re.findall(r, bodyy) if caster.find("m3u8") >= 0: r = "file=(.*?m3u8)" res = plugintools.find_single_match(bodyy, r) res = filter(None, res) res = str(res) script = "" nstream2(url, ref, caster, res, script) else: res = filter(None, res) print res res = list(set(res)) script = "".join(map(str, res)) nstream2(url, ref, caster, res, script)
def lstv3(): params=plugintools.get_params() title = params.get("title").replace("[COLOR white]", "[COLOR lightgreen]") team_a = title.split(" vs ")[0] team_b = title.split(" vs ")[1] url = 'http://m.livesoccertv.com/match/1709586/olympiakos-piraeus-vs-bayern-m-nchen/' data = gethttp_referer_headers(url,url) lstv_file = open(temp + "lstv_stats.tmp", "wb") lstv_file.write("\n[COLOR red]"+title+"[/COLOR]\n") lstv_file.write("\n[COLOR gold]TITULARES[/COLOR]\n") stats = plugintools.find_single_match(data, '<span>Stats</span>(.*?)Substitutes</h3>') players_a = plugintools.find_multiple_matches(stats, '<div class="fll b_lineup_players b_trim_inner -right">(.*?)</div>') players_b = plugintools.find_multiple_matches(stats, '<div class="fll b_lineup_players b_trim_inner -left">(.*?)</div>') i = 0 while i < len(players_a): players_a[i]=players_a[i].replace("</span>", "[/COLOR] ").replace('<span class="b_lineup_number">', '[COLOR lightyellow]').rstrip() players_b[i]=players_b[i].replace("</span>", "[/COLOR] ").replace('<span class="b_lineup_number">', '[COLOR lightyellow]').rstrip() spaces = 80 - len(players_b[i]) plugintools.log("longitud_texto= "+str(len(players_a[i]))) plugintools.log("espacios que faltan= "+str(spaces)) tabulador = "" j = spaces k = 0 while k <= j: tabulador = tabulador + "..." k = k + 1 line_player = players_b[i]+tabulador+players_a[i]+'\n' lstv_file.write(line_player) print line_player i = i + 1 lstv_file.write("\n\n[COLOR gold]SUPLENTES[/COLOR]\n") stats = plugintools.find_single_match(data, 'Substitutes</h3>(.*?)<div id="match-stats"') players_a = plugintools.find_multiple_matches(stats, '<div class="fll b_lineup_players b_trim_inner -right">(.*?)</div>') players_b = plugintools.find_multiple_matches(stats, '<div class="fll b_lineup_players b_trim_inner -left">(.*?)</div>') i = 0 while i < len(players_a): players_a[i]=players_a[i].replace("</span>", "[/COLOR] ").replace('<span class="b_lineup_number">', '[COLOR lightyellow]').rstrip() players_b[i]=players_b[i].replace("</span>", "[/COLOR] ").replace('<span class="b_lineup_number">', '[COLOR lightyellow]').rstrip() spaces = 80 - len(players_b[i]) tabulador = "" j = spaces k = 0 while k <= j: tabulador = tabulador + "..." k = k + 1 line_player = players_b[i]+tabulador+players_a[i]+'\n' lstv_file.write(line_player) print line_player i = i + 1 lstv_file.close() params["url"] = temp + 'lstv_stats.tmp' txt_reader(params)
def lista_series(match_series): serie = plugintools.find_multiple_matches(match_series, '<li>(.*?)</a></li>') for entry in serie: url = plugintools.find_single_match(entry, 'href="([^"]+)') url = 'http://www.seriesyonkis.sx'+url plugintools.log("url= "+url) title_serie = plugintools.find_single_match(entry, 'title="([^"]+)').strip() plugintools.log("title_serie= "+title_serie) if title_serie != "": plugintools.log("url_serie= "+url) plugintools.add_item(action="serie_capis", title = title_serie, url = url, thumbnail = thumbnail , fanart = fanart , folder = True, isPlayable = False)
def mips(url,ref,res): p = re.compile(ur'(width|height|channel)=\'?"?([^\,\'"]+)');par=re.findall(p,str(res)); w=par[0][1];h=par[1][1];c=par[2][1];ref=url;url='http://www.mips.tv/embedplayer/'+c+'/1/'+w+'/'+h;body=''; bodi=curl_frame(url,ref,body);#print bodi p ='SWFObject\(\'?"?([^\'"]+)';swf='http://www.mips.tv'+plugintools.find_single_match(bodi,p); p = 'FlashVars\'?"?,?\s?\'?"?([^\'"]+)';flashvars=plugintools.find_single_match(bodi,p); p = re.compile(ur'\&?.*?=([^\&]+)');flashvars=re.findall(p,flashvars);id=flashvars[0];c=flashvars[1]; lb='http://mips.tv:1935/loadbalancer';lb=plugintools.read(lb);lb=plugintools.find_single_match(lb,'redirect=(.*)'); media_url = 'rtmp://'+lb+'/live/ playpath='+c+'?id='+id+' swfUrl='+swf+' swfVfy=1 conn=S:OK live=true pageUrl='+url plugintools.play_resolved_url(media_url) print "MEDIA URL="+media_url
def nowvideo(params): plugintools.log("[Movies-Online 0.0.1].nowvideo " + repr(params)) data = plugintools.read(params.get("url")) #data = data.replace("amp;", "") if "The file is being converted" in data: xbmc.executebuiltin("Notification(%s,%s,%i,%s)" % ('Movies-Online', "El archivo está en proceso", 3 , art+'icon.png')) elif "no longer exists" in data: xbmc.executebuiltin("Notification(%s,%s,%i,%s)" % ('Movies-Online', "El archivo ha sido borrado", 3 , art+'icon.png')) else: #plugintools.log("data= "+data) domain = plugintools.find_single_match(data, 'flashvars.domain="([^"]+)') video_id = plugintools.find_single_match(data, 'flashvars.file="([^"]+)') filekey = plugintools.find_single_match(data, 'flashvars.filekey=([^;]+)') # En la página nos da el token de esta forma (siendo fkzd el filekey): var fkzd="83.47.1.12-8d68210314d70fb6506817762b0d495e"; token_txt = 'var '+filekey #plugintools.log("token_txt= "+token_txt) token = plugintools.find_single_match(data, filekey+'=\"([^"]+)') token = token.replace(".","%2E").replace("-","%2D") #plugintools.log("domain= "+domain) #plugintools.log("video_id= "+video_id) #plugintools.log("filekey= "+filekey) #plugintools.log("token= "+token) if video_id == "": xbmc.executebuiltin("Notification(%s,%s,%i,%s)" % ('Movies-Online', "Error!", 3 , art+'icon.png')) else: #http://www.nowvideo.sx/api/player.api.php?user=undefined&pass=undefined&cid3=undefined&numOfErrors=0&cid2=undefined&key=83%2E47%2E1%2E12%2D8d68210314d70fb6506817762b0d495e&file=b5c8c44fc706f&cid=1 url = 'http://www.nowvideo.sx/api/player.api.php?user=undefined&pass=undefined&cid3=undefined&numOfErrors=0&cid2=undefined&key=' + token + '&file=' + video_id + '&cid=1' # Vamos a lanzar una petición HTTP de esa URL referer = 'http://www.nowvideo.sx/video/b5c8c44fc706f' request_headers=[] request_headers.append(["User-Agent","Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_3) AppleWebKit/537.31 (KHTML, like Gecko) Chrome/26.0.1410.65 Safari/537.31"]) request_headers.append(["Referer",referer]) body,response_headers = plugintools.read_body_and_headers(url, headers=request_headers) # plugintools.log("data= "+body) # body= url=http://s173.coolcdn.ch/dl/04318aa973a3320b8ced6734f0c20da3/5440513e/ffe369cb0656c0b8de31f6ef353bcff192.flv&title=The.Black.Rider.Revelation.Road.2014.DVDRip.X264.AC3PLAYNOW.mkv%26asdasdas&site_url=http://www.nowvideo.sx/video/b5c8c44fc706f&seekparm=&enablelimit=0 body = body.replace("url=", "") body = body.split("&") if len(body) >= 0: print 'body',body url = body[0] plugintools.play_resolved_url(url) xbmc.executebuiltin("Notification(%s,%s,%i,%s)" % ('Movies-Online', "Cargando vídeo...", 1 , art+'icon.png')) else: xbmc.executebuiltin("Notification(%s,%s,%i,%s)" % ('Movies-Online', "Error!", 3 , art+'icon.png'))
def paginador_next(data): match_paginas = plugintools.find_single_match(data, 'class="paginator">(.*?)<div id="sidebar-section">') plugintools.log("match_paginas= "+match_paginas) pag_actual = plugintools.find_single_match(match_paginas, '<strong>(.*?)</strong>') plugintools.log("pag_actual = "+str(pag_actual)) num_pags = plugintools.find_multiple_matches(match_paginas, '<a(.*?)</a>') i = 0 for entry in num_pags: i = i + 1 plugintools.log("Núm. páginas= "+str(i)) next = int(pag_actual) + 1 plugintools.add_item(action="", title= '[COLOR lightyellow][I]Siguiente (Pág. '+str(next)+')[/I][/COLOR]', url = "", thumbnail = thumbnail , fanart = fanart , folder = True , isPlayable = False)
def kickass1_bum(params): plugintools.log('[%s %s] [BUM+] Kickass results... %s' % (addonName, addonVersion, repr(params))) bumfile = temp + 'bum.dat' controlbum = open(bumfile, "a") show = 'biglist' plugintools.modo_vista(show) #plugintools.add_item(action="", title= '[COLOR green][B]KickAss[/COLOR][COLOR gold][I] Torrents[/I][/COLOR] [/B][COLOR lightyellow][I]By Juarrox[/I][/COLOR]', url = "", thumbnail = thumbnail , fanart = fanart, folder = False, isPlayable = False) #plugintools.add_item(action="", title= '[COLOR red][B]Título [/COLOR][COLOR white] (Tamaño) [/COLOR] [/B][COLOR lightyellow][I](Semillas)[/I][/COLOR]', url = "", thumbnail = thumbnail , fanart = fanart, folder = False, isPlayable = False) url = params.get("url") referer = 'https://kat.cr/' data = gethttp_referer_headers(url,referer) #plugintools.log("data= "+data) thumbnail = plugintools.find_single_match(data, '<img src="([^"]+)') thumbnail = 'http:'+thumbnail #plugintools.log("thumbnail= "+thumbnail) match_num_results = plugintools.find_single_match(data, '<div><h2>(.*?)</a></h2>') num_results = plugintools.find_single_match(match_num_results, '<span>(.*?)</span>') num_results = num_results.replace("from", "de").replace("results", "Resultados:").strip() #plugintools.log("num_results= "+num_results) results = plugintools.find_single_match(data, '<table width="100%" cellspacing="0" cellpadding="0" class="doublecelltable" id="mainSearchTable">(.*?)</table>') #plugintools.log("results_table= "+results) matches = plugintools.find_multiple_matches(results, '<div class="torrentname">(.*?)<a data-download') for entry in matches: #plugintools.log("entry= "+entry) match_title = plugintools.find_single_match(entry, 'class="cellMainLink">(.*?)</a>') match_title = match_title.replace("</strong>", "").replace("<strong>", "").replace('<strong class="red">', "").strip() #plugintools.log("match_title= "+match_title) magnet_match = 'magnet:'+plugintools.find_single_match(entry, 'magnet:([^"]+)') plugintools.log("magnet_match= "+magnet_match) magnet_match = urllib.quote_plus(magnet_match).strip() addon_magnet = plugintools.get_setting("addon_magnet") if addon_magnet == "0": # Stream (por defecto) magnet_url = 'plugin://plugin.video.stream/play/'+magnet_match magnet_url = magnet_url.strip() elif addon_magnet == "1": # Pulsar magnet_url = 'plugin://plugin.video.pulsar/play?uri=' + magnet_match magnet_url = magnet_url.strip() elif addon_magnet == "2": # KMediaTorrent magnet_url = 'plugin://plugin.video.kmediatorrent/play/' + magnet_match magnet_url = magnet_url.strip() plugintools.log("magnet_url= "+magnet_url) size = plugintools.find_single_match(entry, 'class=\"nobr center\">(.*?)</td>') size = size.replace("<span>","").replace("</span>","").strip() #plugintools.log("size= "+size) seeds = plugintools.find_single_match(entry, '<td class="green center">(.*?)</td>').replace(",", "").replace(".", "") leechs = plugintools.find_single_match(entry, '<td class="red lasttd center">(.*?)</td>') #plugintools.log("seeds= "+seeds) #plugintools.log("leechs= "+leechs) title_fixed='[COLOR gold][I]['+seeds+'/'+leechs+'][/I][/COLOR] [COLOR white] '+match_title+' [I]['+size + '] [/COLOR][COLOR orange][Kickass][/I][/COLOR]' #plugintools.add_item(action="play", title=title_fixed, url=magnet_url, thumbnail = thumbnail , fanart = fanart , show = show , extra = show , folder=False, isPlayable=True) controlbum.write('Title: '+title_fixed+'\nURL: '+magnet_url+'\nThumbnail: '+thumbnail+'\nSeeds: '+seeds+'\nSize: '+size+'\n\n') controlbum.close()
def ucaster(url,ref,res): p1 = re.compile(ur'channel=?\'?"?([^\'"\&,;]+)');f1=re.findall(p1, str(res)); p2 = re.compile(ur'width=?\'?"?([^\'"\&,;]+)');f2=re.findall(p2, str(res)); p3 = re.compile(ur'height=?\'?"?([^\'"\&,;]+)');f3=re.findall(p3, str(res)); c=f1[0];w=f2[0];h=f3[0]; url='http://www.ucaster.eu/embedded/'+c+'/1/'+w+'/'+h;body='' bodi=curl_frame(url,ref,body) p ='SWFObject\(\'?"?([^\'"]+)';swf='http://www.ucaster.eu'+plugintools.find_single_match(bodi,p); p = 'FlashVars\'?"?,?\s?\'?"?([^\'"]+)';flashvars=plugintools.find_single_match(bodi,p);print flashvars; p = re.compile(ur'\&?.*?=([^\&]+)');flashvars=re.findall(p,flashvars);print flashvars;id=flashvars[0];c=flashvars[1]; lb='http://www.ucaster.eu:1935/loadbalancer';lb=plugintools.read(lb);lb=plugintools.find_single_match(lb,'redirect=(.*)'); media_url = 'rtmp://'+lb+'/live/ playpath='+c+'?id='+id+' swfUrl='+swf+' swfVfy=1 conn=S:OK live=true pageUrl='+url plugintools.play_resolved_url(media_url)
def elite1(params): plugintools.log("[%s %s] Elitetorrent últimos estrenos %s " % (addonName, addonVersion, repr(params))) plugintools.add_item( action="", title= '[B][COLOR white]Título[COLOR blue] (Fecha de subida) [COLOR green][Puntuación] [COLOR red][Video/Audio][/COLOR][/B]', url="", thumbnail=thumbnail, fanart=fanart, folder=False, isPlayable=False) url = params.get("url") r = plugintools.read(url) matches = plugintools.find_multiple_matches(r, '<li>(.*?)</li>') for entry in matches: if entry.find("loco-bingo-1.html") >= 0: pass else: url_torrent = plugintools.find_single_match( entry, '<a href="([^"]+)') url_torrent = 'http://www.elitetorrent.net' + url_torrent thumb_torrent = plugintools.find_single_match( entry, 'src="([^"]+)') thumb_torrent = thumb_torrent.replace("../", "") thumb_torrent = 'http://www.elitetorrent.net/' + thumb_torrent title_torrent = plugintools.find_single_match( entry, 'title="([^"]+)') age = plugintools.find_single_match( entry, '<span class="fecha">(.*?)</span>') nota = plugintools.find_single_match( entry, 'title="Valoracion media">([^<]+)') quality = plugintools.find_single_match( entry, '<span class="voto2"[^>]+>([^<]+)') if nota == "": nota = "N/D" if quality == "": quality = "N/D" plugintools.add_item(action="elite2", title='[COLOR white][B]' + title_torrent + '[COLOR green] (' + age + ') [COLOR red][' + nota + '] [COLOR blue][' + quality + '][/B][/COLOR]', url=url_torrent, thumbnail=thumb_torrent, fanart=fanart, folder=False, isPlayable=True)
def seriesflv_linker_servers(params): plugintools.log('[%s %s] SeriesFlv %s' % (addonName, addonVersion, repr(params))) plugintools.add_item(action="", url="", title="[COLOR lightblue][B]SeriesFlv" + version + "[/B][COLOR lightblue]" + sc4 + "[I] [/I]" + ec4, thumbnail=thumbnail, fanart=fanart, folder=False, isPlayable=False) url = params.get("url") title_capit = params.get("extra") data = cloudflare.request(url) bloq_cover = plugintools.find_single_match( data, '<div class="portada">(.*?)</div>') corver = plugintools.find_single_match(bloq_cover, 'src="([^"]+)') bloq_server = plugintools.find_single_match( data, '<div id="enlaces">(.*?)</table>') server = plugintools.find_multiple_matches(bloq_server, '<img width="20"(.*?)</tr>') for item in server: lang = plugintools.find_single_match( item, 'src="http://www.seriesflv.net/images/lang/(.*?).png"') if lang == 'es': lang = sc2 + '[I][ESP][/I]' + ec2 elif lang == 'la': lang = sc2 + '[I][LAT][/I]' + ec2 elif lang == 'en': lang = sc2 + '[I][ENG][/I]' + ec2 elif lang == 'sub': lang = sc2 + '[I][SUB][/I]' + ec2 else: lang = sc2 + '[I][N/D][/I]' + ec2 server_name = plugintools.find_single_match( item, 'class="e_server"><img width="16" src="([^"]+)"') server_name = server_name.split("domain=") server_name = server_name[-1] url_redir = plugintools.find_single_match( item, '<td width="84"><a href="([^"]+)"') url = getlinkflv(url_redir) #,cookie_ses) server = video_analyzer(server_name) titlefull = sc + str(title_capit) + ec + ' ' + str( lang) + ' ' + sc5 + '[I][' + str(server) + '][/I]' + ec5 plugintools.addPeli(action=server, url=url, title=titlefull, thumbnail=thumbnail, fanart=fanart, folder=False, isPlayable=True)
def main_list(params): plugintools.log("3alshasha.main_list " + repr(params)) # On first page, pagination parameters are fixed if params.get("url") is None: params[ "url"] = "http://gdata.youtube.com/feeds/api/users/" + YOUTUBE_CHANNEL_ID + "/uploads?start-index=1&max-results=50" # Fetch video list from YouTube feed data = plugintools.read(params.get("url")) # Extract items from feed pattern = "" matches = plugintools.find_multiple_matches(data, "<entry>(.*?)</entry>") for entry in matches: plugintools.log("entry=" + entry) # Not the better way to parse XML, but clean and easy title = plugintools.find_single_match(entry, "<titl[^>]+>([^<]+)</title>") plot = plugintools.find_single_match( entry, "<media\:descriptio[^>]+>([^<]+)</media\:description>") thumbnail = plugintools.find_single_match( entry, "<media\:thumbnail url='([^']+)'") video_id = plugintools.find_single_match( entry, "http\://www.youtube.com/watch\?v\=([0-9A-Za-z_-]{11})") url = "plugin://plugin.video.youtube/?path=/root/video&action=play_video&videoid=" + video_id # Appends a new item to the xbmc item list plugintools.add_item(action="play", title=title, plot=plot, url=url, thumbnail=thumbnail, isPlayable=True, folder=False) # Calculates next page URL from actual URL start_index = int( plugintools.find_single_match(params.get("url"), "start-index=(\d+)")) max_results = int( plugintools.find_single_match(params.get("url"), "max-results=(\d+)")) next_page_url = "http://gdata.youtube.com/feeds/api/users/" + YOUTUBE_CHANNEL_ID + "/uploads?start-index=%d&max-results=%d" % ( start_index + max_results, max_results) plugintools.add_item(action="main_list", title=">> Next page", url=next_page_url, folder=True)
def programandola0(params): plugintools.log("[%s %s] Parser Programando.la... %s " % (addonName, addonVersion, repr(params))) thumbnail = 'http://nodogeek.com/wp-content/uploads/2013/01/programando-la-cursos-gratis-programacion.jpg' fanart = 'http://www.comolohago.cl/wp-content/uploads/2008/05/phpcode.jpg' #headers = {"User-Agent": 'Mozilla/5.0 (Windows NT 6.1; WOW64; rv:41.0) Gecko/20100101 Firefox/41.0', "Referer": url} #r=requests.get(url, headers=headers) r = requests.get(url) data = r.content plugintools.add_item( action="", url="", title= "[COLOR blue][B]Programando [COLOR white](VideoTutoriales)[/B][/COLOR]", thumbnail=thumbnail, fanart=fanart, folder=False, isPlayable=False) plugintools.add_item(action="", url="", title="", thumbnail=thumbnail, fanart=fanart, folder=False, isPlayable=False) cada_categoria = plugintools.find_multiple_matches( data, 'title="Dificultad(.*?)/h2>') for item in cada_categoria: categoria = plugintools.find_single_match(item, '">(.*?)<') plugintools.add_item(action="pilla_tutos", title="[COLOR white][B]" + categoria + "[/B][/COLOR]", extra=categoria, url=url, thumbnail=thumbnail, fanart=fanart, folder=True, isPlayable=False)
def pornhd_enlaces(params): url = params.get("url") data = requests.get(url).content titulo = plugintools.find_single_match( data, '<meta name="description" content="(.*?)" />') logo = plugintools.find_single_match( data, '<meta name="og:image" content="(.*?)" />') titulo_pantalla(titulo, logo, fanart) bloque = plugintools.find_single_match(data, "players.push(.*?)}") video240 = plugintools.find_single_match(bloque, "'240p' : '(.*?)'") video480 = plugintools.find_single_match(bloque, "'480p' : '(.*?)'") video720 = plugintools.find_single_match(bloque, "'720p' : '(.*?)'") video1080 = plugintools.find_single_match(bloque, "'1800p' : '(.*?)'") plugintools.play_resolved_url(video480)
def seriesflv_linker_capit(params): plugintools.log('[%s %s] SeriesFlv %s' % (addonName, addonVersion, repr(params))) plugintools.add_item(action="", url="", title="[COLOR lightblue][B]SeriesFlv" + version + "[/B][COLOR lightblue]" + sc4 + "[I] [/I]" + ec4, thumbnail=thumbnail, fanart=fanart, folder=False, isPlayable=False) url = params.get("url") data = cloudflare.request(url) bloq_capit = plugintools.find_single_match( data, '<div class="serie-cont left">(.*?)</table>') title_temp = plugintools.find_single_match( bloq_capit, '<h1 class="off">(.*?)</h1>').replace('\\', '') plugintools.add_item(action="", url="", title=sc2 + '[B]' + title_temp + '[/B]' + ec2, thumbnail=thumbnail, fanart=fanart, folder=False, isPlayable=False) bloq_cover = plugintools.find_single_match( data, '<div class="portada">(.*?)</div>') corver = plugintools.find_single_match(bloq_cover, 'src="([^"]+)') capit = plugintools.find_multiple_matches(bloq_capit, '<td class="sape">(.*?)</tr>') for item in capit: title_capit = plugintools.find_single_match( item, 'class="color4".*?">(.*?)</a>').replace('\\', '') url_capit = plugintools.find_single_match( item, '<a class="color4" href="([^"]+)"') lang = plugintools.find_multiple_matches( item, 'http://www.seriesflv.net/images/lang/(.*?).png') plugintools.addPeli(action="seriesflv_linker_servers", url=url_capit, title=sc + str(title_capit) + ec, extra=str(title_capit), thumbnail=corver, fanart=fanart, folder=True, isPlayable=False)
def elite2(params): plugintools.log("[%s %s] Elitetorrent obteniendo url %s " % (addonName, addonVersion, repr(params))) url = params.get("url") #r = requests.get(url) r = plugintools.read(url) url_magnet = plugintools.find_single_match(r, '<a href="magnet:([^"]+)') url_magnet = 'magnet:' + url_magnet print url_magnet addon_magnet = plugintools.get_setting("addon_magnet") if addon_magnet == "0": # Stream (por defecto) url = 'plugin://plugin.video.stream/play/' + url_magnet elif addon_magnet == "1": # Pulsar url = 'plugin://plugin.video.pulsar/play?uri=' + url_magnet elif addon_magnet == "2": # Kmediatorrent url = 'plugin://plugin.video.kmediatorrent/play/' + url_magnet #url = urllib.unquote_plus(url) plugintools.log("Magnet URL= " + url) plugintools.play_resolved_url(url)
def playerapp1(url, ref, body): k = url hidd = 'type="hidden"\sid="([^"]+)"\svalue="([^"]*)' hidd = plugintools.find_multiple_matches(body, hidd) #print hidd; swfUrl = 'http://www.playerapp1.pw/jwplayer5/addplayer/jwplayer.flash.swf' Epoc_mil = str(int(time.time() * 1000)) EpocTime = str(int(time.time())) app = plugintools.find_single_match( hidd[1][1].decode('base64').replace('\\', ''), '1735\/([^"]+)') #app=app.replace("vod", "redirect") q = '%s app=%s playpath=%s flashver=WIN%5C2017,0,0,134 swfUrl=%s swfVfy=1 pageUrl=%s live=1 timeout=15' #dzap,tvdirecto w = hidd[1][1].decode('base64').replace('\\', '').replace( "vod", "redirect" ) + ' app=' + app + ' playpath=' + hidd[0][1].decode( 'base64' ) + ' flashver=WIN%5C2017,0,0,134 swfUrl=' + swfUrl + ' swfVfy=1 pageUrl=' + k + ' live=1 timeout=15' plugintools.play_resolved_url(w) sys.exit()
def tvcatchup(url): url = 'https://tvcatchup.com/watch/' + url iconimage = "" req = urllib2.Request(url) req.add_header( 'User-Agent', 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.3' ) response = urllib2.urlopen(req) link = response.read() response.close() pattern = "" matches = plugintools.find_multiple_matches(link, "jwplayer(.*?)</script>") for entry in matches: url = plugintools.find_single_match(entry, "file: '(.+?)'") play(url)
def play_peliculas_playlists(params): plugintools.log("ohpelis_play_peliculas_series_playlists") request_headers=[] request_headers.append(["User-Agent","Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_3) AppleWebKit/537.31 (KHTML, like Gecko) Chrome/26.0.1410.65 Safari/537.31"]) url_main = params.get("url") try: data,response_headers = plugintools.read_body_and_headers(url_main, headers=request_headers) except: xbmcgui.Dialog().ok("Error","\nFallo al obtener la información de","\n"+data) data="" xbmcgui.Dialog().ok("Error","\nFallo al obtener la información de","\n"+url_main) return pass #plugintools.log("data="+data) url = plugintools.find_single_match(data,'rptss" src="(.*?)" frameborder') plugintools.log("url="+url) #plugintools.log(test_video_exists(url)) uurl = "plugin://plugin.video.alfa/?"+url xbmc.executebuiltin("xbmc.PlayMedia("+uurl+")")
def seriesblanco2(params): plugintools.log("[beta.1-0.3.0].seriesblanco " + repr(params)) show = params.get("page") plugintools.modo_vista(show) plugintools.log("show= " + show) url = params.get("url") referer = url data = gethttp_referer_headers(url, referer, show) plugintools.modo_vista(show) #plugintools.log("data= "+data) # onclick='window.open("http://allmyvideos.net/lh18cer7ut8r") url_final = plugintools.find_single_match(data, "onclick='window.open(.*?);'/>") url_final = url_final.replace('("', "").replace('")', "") #plugintools.log("url_final= "+url_final) params = plugintools.get_params() params["url"] = url_final getlink_seriesblanco(params)
def search(params): plugintools.log("movie4k.search " + repr(params)) text = plugintools.keyboard_input(title="Input search terms") url = MAIN_URL + "movies.php?list=search" post = "search=" + text.replace(" ", "+") body, response_headers = read_body_and_headers(url, post=post) pattern = '<TR id="coverPreview[^<]+' pattern += '<TD width="550" id="tdmovies"[^<]+' pattern += '<a href="([^"]+)">([^<]+)</a>' matches = plugintools.find_multiple_matches(body, pattern) for scrapedurl, scrapedtitle in matches: url = urlparse.urljoin(url, scrapedurl) title = scrapedtitle.strip() thumbnail = "" plot = "" plugintools.log("movie4k.search title=" + title + ", url=" + url + ", thumbnail=" + thumbnail) if "watch-tvshow" in url: url = MAIN_URL + "tvshows-season-" + plugintools.find_single_match( url, MAIN_URL + "([A-Za-z0-9\-]+)-watch-tvshow-\d+.html") + ".html" plugintools.add_item(action="tvshow_seasons", title=title, url=url, thumbnail=thumbnail, plot=plot, fanart=thumbnail, folder=True) else: plugintools.add_item(action="single_movie", title=title, url=url, thumbnail=thumbnail, plot=plot, fanart=thumbnail, folder=True)
def disneyweb(params): plugintools.log("soritvch.disneyweb " + repr(params)) # Fetch video list from YouTube feed data = plugintools.read(params.get("url")) data = plugintools.find_single_match( data, '<div id="video_main_promos_inner">(.*?)<div id="content_index_navigation">' ) # Extract items from feed ''' <div class="promo" style="background-image: url(/cms_res/disney-junior/images/promo_support/promo_holders/video.png);"> <a href="/disney-junior/contenido/video/canta_con_dj_arcoiris.jsp " class="promoLinkTracking"><img src="/cms_res/disney-junior/images/video/canta_dj_arco_iris_164x104.jpg" class="promo_image" alt=""/></a> <div class="promo_title_3row"><p>Canta con DJ: La canción del arco iris</p></div> <a class="playlist_button_large" href="" ref="canta_con_dj_arcoiris"><img src="/cms_res/disney-junior/images/promo_support/playlist_add_icon.png" alt="" /></a> </div> ''' pattern = '<div class="promo"[^<]+' pattern += '<a href="([^"]+)"[^<]+' pattern += '<img src="([^"]+)"[^<]+' pattern += '</a[^<]+' pattern += '<div[^<]+' pattern += '<p>([^<]+)</p>' matches = plugintools.find_multiple_matches(data, pattern) for scrapedurl, scrapedthumbnail, scrapedtitle in matches: # Not the better way to parse XML, but clean and easy title = scrapedtitle thumbnail = urlparse.urljoin(params.get("url"), scrapedthumbnail) url = urlparse.urljoin(params.get("url"), scrapedurl.strip()) plot = "" # Appends a new item to the xbmc item list plugintools.add_item(action="disneyweb_play", title=title, plot=plot, url=url, thumbnail=thumbnail, isPlayable=True, folder=False)
def ukiptv(url): url = 'http://uktv.robssatellitetv.com/watch-uk-tv-online/' + url iconimage = "" req = urllib2.Request(url) req.add_header( 'User-Agent', 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.3' ) response = urllib2.urlopen(req) link = response.read() response.close() pattern = "" matches = plugintools.find_multiple_matches( link, 'player = flowplayer(.*?)</script>') for entry in matches: url = plugintools.find_single_match(entry, 'src: "(.+?)"') play(url)
def epg_verahora(params): plugintools.log('[%s %s].epg_verahora %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 ahora?[/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=\"([^"]+)') print 'channel',channel ahora = plugintools.find_single_match(entry, '<p>(.*?)</p>') print 'ahora',ahora 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() print 'diff_luego',diff_luego evento_luego = plugintools.find_single_match(entry, '<span class="tprg1">(.*?)</span>') print 'evento_luego',evento_luego evento_mastarde = plugintools.find_single_match(entry, '<span class="tprg2">(.*?)</span>') print 'evento_mastarde',evento_mastarde 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]'+ahora+'[/COLOR] [COLOR lightgreen][I]('+diff_luego+') [/I][/COLOR][COLOR white][B]'+hora_luego+' [/COLOR][/B] '+evento_luego quever.write('[COLOR orange][B]'+channel+' [/B][/COLOR]\n') quever.write(' [COLOR lightblue]Ahora: [COLOR lightyellow]'+ahora+'[/COLOR]\n') quever.write(' [COLOR white][B]'+hora_luego+' [/B] '+evento_luego+' [/COLOR][COLOR lightgreen][I]('+diff_luego+') [/I][/COLOR]\n') quever.write(' [COLOR white][B]'+hora_mastarde+' [/B] '+evento_mastarde+'[/COLOR]\n\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 sport7_0(params): plugintools.log("[%s %s] SPORT7.ru %s" % (addonName, addonVersion, repr(params))) plugintools.add_item(action="", title='[COLOR white][B]SPORT[COLOR green]7[/B][/COLOR].ru[/COLOR]' , url="", thumbnail=thumbnail, fanart=fanart, folder=False, isPlayable=False) data = plugintools.read('http://sport7.ru/onlain_sopcast') bloque = plugintools.find_single_match(data, '<div class="block_news">(.*?)<div id="r_okno">') matches = plugintools.find_multiple_matches(bloque, 'href="http://sport7.ru/match/([^"]+)') for entry in matches: url_event='http://sport7.ru/match/'+entry title_event=plugintools.find_single_match(bloque, entry+'\"\>(.*?)</a>') plugintools.add_item(action="sport7_1", title='[COLOR white]'+title_event+' [/COLOR][COLOR blue][I]Live![/I][/COLOR]', url=url_event, thumbnail=thumbnail, fanart=fanart, folder=True, isPlayable=False) # Canales Acestream/Sopcast matches = plugintools.find_single_match(data, 'class=\"head-match\"(.*?)class=\"mar-top5 jus\"') title = plugintools.find_multiple_matches(matches, '<h2>(.*?)</h2>') for entry in title: plugintools.log("entry= "+entry) canal = plugintools.find_single_match(matches, '<h2>'+entry+'(.*?)class=\"com_bl utext\"') plugintools.log("canal= "+canal) title = convertrus(entry) plugintools.log("title= "+title) bitrate = plugintools.find_single_match(canal, '<div class=\"rc\">(.*?)</div>') plugintools.log("bitrate= "+bitrate) url_p2p = 'sop://'+plugintools.find_single_match(canal, "sop://([^\?]+)") plugintools.log("url_p2p= "+url_p2p) type_p2p = plugintools.find_single_match(canal, 'alt="([^ ]+)') plugintools.log("type_p2p= "+type_p2p) if type_p2p.startswith("Sopcast") == True: title = '[COLOR lightyellow]' + title + ' [/COLOR][COLOR lightblue] [Sopcast] [/COLOR][COLOR green][I]['+bitrate+'][/I][/COLOR]' url_media=p2p_builder_url(url_p2p, 'sport7', p2p="sop") plugintools.add_item(action="play", title=title, url=url_media, thumbnail=thumbnail, fanart=fanart, folder=False, isPlayable=True) elif type_p2p.startswith("Acestream)") == True: title = '[COLOR lightyellow]' + title + ' [/COLOR][COLOR lightblue] [Acestream] [/COLOR][COLOR green][I]['+bitrate+'][/I][/COLOR]' data = plugintools.read(url_p2p) url_media=plugintools.find_single_match(data, '<a href="([^"]+)') plugintools.log("url_media= "+url_media) url_media=p2p_builder_url(url_media, 'sport7', p2p="sop") plugintools.add_item(action="play", title=title, url=url_media, thumbnail=thumbnail, fanart=fanart, folder=False, isPlayable=True)
def canales_programacion(params): fanart = params.get("fanart") thumbnail = params.get("thumbnail") titulo = params.get("title") titulo2=titulo.replace("-> [COLOR yellow]"," ").replace("[","<").replace("]",">").replace("(","desde aqui").replace(")"," ") titulo_cabecera = plugintools.find_single_match(titulo2,'desde aqui(.*?)<') cada_canal = plugintools.find_multiple_matches(titulo2,'<Canal: (.*?)>') plugintools.add_item(action="",url="",title="[COLOR lightgreen][B]"+titulo_cabecera+"[/B][/COLOR]",thumbnail=thumbnail,fanart=fanart,folder=False,isPlayable=False) plugintools.add_item(action="",url="",title="",thumbnail=thumbnail, fanart=fanart, folder=False, isPlayable=False) for item in cada_canal: ##Porque no existen nº de canales de 3 dígitos... aunq en la programación aparezcan. item=item.strip() if len(item) < 3: url_canal="http://www.tv-sports-livestream.fr/chaine_"+item+".html" url_montada = 'plugin://plugin.video.SportsDevil/?mode=1&item=catcher%3dstreams%26url='+url_canal+'%26referer='+url_ref plugintools.add_item(action="runPlugin", title="Ver en [COLOR red]Canal "+item+"[/COLOR]", url=url_montada, thumbnail=thumbnail , fanart=fanart, folder = False, isPlayable=True)
def latuerka_menu(params): plugintools.log("[PalcoTV] La Tuerka Parser( "+repr(params)) plugintools.add_item(action="", title = '[B][I][COLOR lightyellow]LaTuerka Videos[/B][/I][/COLOR]', url = "", folder = True, isPlayable = False) url = params.get("url") data = plugintools.read(url) #plugintools.log("data= "+data) menu = plugintools.find_single_match(data, '<ul class="menu-tuerka">(.*?)</ul>') #plugintools.log("menu_latuerka= "+menu) items_menu = plugintools.find_multiple_matches(menu, '<a href=([^<]+)</a>') for entry in items_menu: #plugintools.log("item= "+entry) entry = entry.split(">") url_program = entry[0] title_program = entry[1] url_program = url_program.replace('"', "") url_program = 'http://www.publico.es' + url_program plugintools.log("title_program= "+title_program) plugintools.log("url_program= "+url_program) plugintools.add_item(action="program_capis" , title = title_program , url = url_program , thumbnail = 'http://www.latuerka.net/img/logo.png' , fanart = 'http://www.latuerka.net/img/bg.jpg' , folder = True , isPlayable = False)
def epg_arenasports(horas, eventos, title): #plugintools.log("[%s %s] Arenasports EPG Guide ... %s " % (addonName, addonVersion, title)) epg_channel = [] # Consultamos ruta del archivo de programación de TV.nu para hoy y mañana formatodia = "%Y-%m-%d" hoy = datetime.today();epg_arenasp_hoy = hoy.strftime(formatodia) epg_arenasp_hoy = temp + 'Guide_Arenasport-'+str(epg_arenasp_hoy)+'.txt' if os.path.exists(epg_arenasp_hoy): fepg = open(epg_arenasp_hoy, "r");data=fepg.read() else: plugintools.log("Creamos archivo EPG de Arenasport para hoy: "+epg_arenasp_hoy) fepg_arenasp = open(epg_arenasp_hoy, "wb") r=requests.get('http://tv.aladin.info/live');data=r.content;fepg_arenasp.write(data);fepg_arenasp.close() if title == "arenasport 1" or title == "arenasport 1 hd": id = '69' elif title == "arenasport 2" or title == "arenasport 2 hd": id = '70' elif title == "arenasport 3" or title == "arenasport 3 hd": id = '71' elif title == "arenasport 4" or title == "arenasport 4 hd": id = '72' elif title == "arenasport 5" or title == "arenasport 5 hd": id = '91' elif title == "sportklub 1" or title == "sportklub 1 hd": id = '57' elif title == "sportklub 2" or title == "sportklub 2 hd": id = '58' elif title == "sportklub 3" or title == "sportklub 3 hd": id = '92' elif title == "sportklub 4" or title == "sportklub 4 hd": id = '93' tablevents = plugintools.find_single_match(data, 'tv_source_'+id+'(.*?)</div><style>') eventos = plugintools.find_multiple_matches(tablevents, 'class=\'list-group-item(.*?)/li>') evento_ahora="";hora_ahora="";evento_luego="";evento_mastarde="";hora_luego="";hora_mastarde=""; for entry in eventos: #plugintools.log("evento= "+entry) if evento_luego != "" and evento_mastarde=="": evento_mastarde = plugintools.find_single_match(entry, '</span>(.*?)<') hora_mastarde = plugintools.find_single_match(entry, 'block\'>(.*?)</span>').strip() if evento_ahora != "" and evento_luego =="": hora_luego = plugintools.find_single_match(entry, 'block\'>(.*?)</span>').strip() evento_luego = plugintools.find_single_match(entry, '</span>(.*?)<') if entry.find("bg-warning") >= 0: hora_ahora = plugintools.find_single_match(entry, 'block\'>(.*?)</span>').strip() evento_ahora = plugintools.find_single_match(entry, '</span>(.*?)<') epg_channel = hora_ahora,evento_ahora,hora_luego,evento_luego,hora_mastarde,evento_mastarde return epg_channel
def xhamster_buspag(params): plugintools.log('[%s %s] Buscando página... %s' % (addonName, addonVersion, repr(params))) total = params.get("extra") plugintools.log("Número total de páginas: " + total) user_pag = "" #user_pag = plugintools.keyboard_input(user_pag) user_pag = xbmcgui.Dialog().numeric( 0, 'Introduzca núm. entre 1 y ' + total) # Solicitamos al usuario número de página a mostrar plugintools.log("Página solicitada: " + user_pag) if user_pag == "": errormsg = plugintools.message( "Movie Ultra 7K", "Por favor, introduzca la pagina a buscar") else: try: if int(user_pag) <= int(total): url = params.get( "url") # Cogemos la URL del diccionario params num_pag = plugintools.find_single_match( url, 'page=([0-9]*)').strip( ) # Extraemos el número de la página actual if num_pag == "": num_pag = "1" new_pag = url.replace(num_pag, user_pag).strip( ) # Reemplazamos página actual por la que el usuario desea params = plugintools.get_params() params["url"] = new_pag xhamster_bus1(params) else: errormsg = plugintools.message( "Movie Ultra 7K", "Introduzca un valor inferior o igual a %s " % (total)) except ValueError: errormsg = plugintools.message( "Movie Ultra 7K", "Por favor, introduzca un valor numérico") # ---------------------------------------------------------------------------------------------------------------------------------------------
def estrenos_conectores_playlists(params): plugintools.log("estrenos_conectores_playlists") request_headers = [] request_headers.append([ "User-Agent", "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_3) AppleWebKit/537.31 (KHTML, like Gecko) Chrome/26.0.1410.65 Safari/537.31" ]) request_headers.append( ["referrer", "http://verdirectotv.com/tv/digitales2/plustoros.html"]) url_main = params.get("url") #plugintools.log("url_main="+url_main) plot = params.get("plot") thumbnail = params.get("thumbnail") title = params.get("title") try: data, response_headers = plugintools.read_body_and_headers( url_main, headers=request_headers) except: xbmcgui.Dialog().ok("Error", "\nFallo al obtener la información de", "\n" + data) data = "" xbmcgui.Dialog().ok("Error", "\nFallo al obtener la información de", "\n" + url_main) return pass #https://my.mail.ru/video/embed/3641166504956794027 movies = plugintools.find_multiple_matches(data, '<a id="op(.*?)clearfix') i = 0 for entry in movies: i = i + 1 plugintools.log("entry=" + entry) url = plugintools.find_single_match(entry, 'rel="(.*?)" class') plugintools.log("url=" + url) plugintools.add_item(action="direct_play", title="Opción " + str(i) + " (" + url + ")", thumbnail=thumbnail, url=url, plot=plot, isPlayable=True, folder=False)
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 white][B]Mi Guia TV Despues[/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 blue][B]' + channel + ' [COLOR red]' + hora_luego + ' [COLOR white]' + evento_luego + '[/COLOR][COLOR green] (' + diff_luego + ') [/COLOR][COLOR red]' + hora_mastarde + ' [COLOR white]' + evento_mastarde quever.write(title + '[/COLOR][/B]\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 epg_verahora(params): plugintools.log("Arena+ " + repr(params)) url = params.get("url") thumbnail = params.get("thumbnail") fanart = params.get("extra") data = plugintools.read(url) #plugintools.log("data= "+data) plugintools.add_item( action="", title='[COLOR lightyellow][B]¿Qué ver ahora?[/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=\"([^"]+)') print 'channel', channel ahora = plugintools.find_single_match(entry, '<p>(.*?)</p>') print 'ahora', ahora 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() print 'diff_luego', diff_luego evento_luego = plugintools.find_single_match( entry, '<span class="tprg1">(.*?)</span>') print 'evento_luego', evento_luego evento_mastarde = plugintools.find_single_match( entry, '<span class="tprg2">(.*?)</span>') print 'evento_mastarde', evento_mastarde plugintools.add_item( action="", title='[COLOR orange][B]' + channel + ' [/B][COLOR lightyellow]' + ahora + '[/COLOR] [COLOR lightgreen][I](' + diff_luego + ') [/I][/COLOR][COLOR white][B]' + hora_luego + ' [/COLOR][/B] ' + evento_luego, thumbnail=thumbnail, fanart=fanart, folder=False, isPlayable=False)
def danko_slug(params): plugintools.log("[%s %s] Danko %s" % (addonName, addonVersion, repr(params))) plugintools.add_item(action="",url="",title="[COLOR lightblue][B] Danko"+version+"[/B][COLOR lightblue]"+sc4+"[I] [/I]"+ec4,thumbnail=thumbnail,fanart=fanart,folder=False,isPlayable=False) params_danko_slug = params.get("extra").split('|') #separando los parametros cookie_ses = params_danko_slug[0];id_vid = params_danko_slug[1];slug1 = params_danko_slug[-1] title = params.get("title");logo = params.get("thumbnail");fondo = params.get("fanart") headers = {'Host': 'pelisdanko.com','User-Agent': 'Mozilla/5.0 (Windows NT 6.1; WOW64; rv:46.0) Gecko/20100101 Firefox/46.0', 'Referer': params.get("url"),'pelisdanko_session':cookie_ses} url = params.get("url") #http://pelisdanko.com/peli/deadpool-5233/7V9gGJlcbE1vi7TJ10697/ss?#ss r = requests.get(url,headers=headers) data = r.content title_pel = plugintools.find_single_match(data,'<meta itemprop="name" content="([^"]+)').strip() plugintools.add_item(action="",url="",title=title,thumbnail=thumbnail,fanart=fanart,folder=False,isPlayable=False) streaming = plugintools.find_single_match(data,'<h3 class="coolfont">Streaming</h3>(.*?)</iframe>') if streaming !="": url_streaming = plugintools.find_single_match(streaming,'src="([^"]+)"') server = video_analyzer(streaming) titlefull = sc+'1. '+title_pel+ec+sc5+' [I]['+server+'][/I]'+ec5 plugintools.addPeli(action=server,url=url_streaming,title=titlefull,thumbnail=logo,fanart=fondo,folder=False,isPlayable=True) else: pass bloq_slug2 = plugintools.find_single_match(data,'class="lnks"><div class="text-center">(.*?)">Mostrar enlaces</span></a>') slug2 = plugintools.find_single_match(bloq_slug2,'data-slug="([^"]+)"') headers = {'Host': 'pelisdanko.com','User-Agent': 'Mozilla/5.0 (Windows NT 6.1; WOW64; rv:46.0) Gecko/20100101 Firefox/46.0', 'Referer': url,'pelisdanko_session':cookie_ses} #http://pelisdanko.com/strms/5233/7V9gGJlcbE1vi7TJ10697/VLr9dzBnPx9A8l8r10697 url = 'http://pelisdanko.com/strms/'+id_vid+'/'+slug1+'/'+slug2 r = requests.post(url,headers=headers) data = r.content bloq_server = plugintools.find_multiple_matches(data,'<tr>(.*?)</tr>') i=2 for item in bloq_server: url_vid = plugintools.find_single_match(item,'<a href="([^"]+)"') server = video_analyzer(url_vid) titlefull = sc+str(i)+'. '+title_pel+ec+sc5+' [I]['+server+'][/I]'+ec5 plugintools.addPeli(action=server,url=url_vid,title=titlefull,thumbnail=logo,fanart=fondo,folder=False,isPlayable=True) i=i+1
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") 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] plugintools.add_item(action="", 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, thumbnail=thumbnail, fanart=fanart, folder=False, isPlayable=False)
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)
def vod_play(url): url = url iconimage = "" req = urllib2.Request(url) req.add_header( 'User-Agent', 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.3' ) response = urllib2.urlopen(req) link = response.read() response.close() pattern = "" matches = plugintools.find_multiple_matches( link, '"stream":(.*?)"volume_seeker"') for entry in matches: url = plugintools.find_single_match(entry, '"hls":"(.+?)",').replace( '\/', '/') play(url)
def nstr(url, ref, pageurl): p1 = re.compile(ur'channel=?\'?"?([^\'"\&,;]+)') p2 = re.compile(ur'width=?\'?"?([^\'"\&,;]+)') p3 = re.compile(ur'height=?\'?"?([^\'"\&,;]+)') f1 = re.findall(p1, pageurl) f2 = re.findall(p2, pageurl) f3 = re.findall(p3, pageurl) #res=list(set(f)); c = f1[0] w = f2[0] h = f3[0] url = 'http://www.9stream.com/embedplayer.php?width=' + w + '&height=' + h + '&channel=' + c + '&autoplay=true' body = '' # plugintools.log("url= " + url) plugintools.log("referer= " + ref) bodi = curl_frame(url, ref, body) print "\nURLXXX = " + url + "\nREFXXX = " + ref #+"\n"+bodi tkserv = '' strmr = '' plpath = '' swf = '' vala = '' vals = ioncube.ioncube1(bodi) print "URL = " + url print "REF = " + ref tkserv = vals[0][1] strmr = vals[1][1].replace("\/", "/") plpath = vals[2][1].replace(".flv", "") swf = vals[3][1] ref = url url = tkserv bodi = curl_frame(url, ref, body) p = 'token":"([^"]+)' token = plugintools.find_single_match(bodi, p) #print token media_url = strmr + '/' + plpath + ' swfUrl=' + swf + ' token=' + token + ' live=1 timeout=15 swfVfy=1 pageUrl=' + ref plugintools.play_resolved_url(media_url) print media_url
def tmdbsearch(title): plugintools.log("[%s %s] Searching URL TMDB.org for... %s" % (addonName, addonId, title)) try: title = title.replace(" ", "+") tmdb_search = 'https://ajax.googleapis.com/ajax/services/search/web?v=1.0&q=' + title + '+themoviedb' data = gethttp_referer_headers(tmdb_search, referer='') # Solicitamos URL de TMDB.org... request_headers = [] request_headers.append([ "User-Agent", "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_3) AppleWebKit/537.31 (KHTML, like Gecko) Chrome/26.0.1410.65 Safari/537.31" ]) data, response_headers = plugintools.read_body_and_headers( url, headers=request_headers) url_tmdb = tmdb + plugintools.find_single_match( data, 'https://www.themoviedb.org/([^"]+)') return url_tmdb except: pass
def kami(params): plugintools.log('[%s %s] Yotta %s' % (addonName, addonVersion, repr(params))) url = params.get("url") headers = { "User-Agent": "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.8.1.14) Gecko/20080404 Firefox/2.0.0.14", 'Referer': referer } r = requests.get(url, headers=headers) data = r.content sources = plugintools.find_single_match(data, "sources: \[\{(.*?)\}\],") media_url = plugintools.find_multiple_matches(sources, 'file: "([^"]+)"') try: media_url = media_url[0] print '$' * 43 + '- By Movies Ultra -' + '$' * 43, media_url, '$' * 105 except: xbmc.executebuiltin( "Notification(%s,%s,%i,%s)" % ('Movies UltraTV', "Archivo no disponible", 3, art + 'icon.png')) plugintools.play_resolved_url(media_url)