def GetSerieChapters(params):
    #plugintools.log("[%s %s] Seriesadicto: getseriechapters() %s" % (addonName, addonVersion, repr(params)))

    season = params.get("season")
    datamovie = {}
    datamovie["Plot"] = params.get("plot")
    data = plugintools.read(params.get("url"))
    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)        
    
    season = plugintools.find_multiple_matches(data, season + '(.*?)</table>')
    season = season[0]
    
    for entry in season:
        url_cap = plugintools.find_multiple_matches(season, '<a href=\"/capitulo(.*?)\" class=\"color4\"')
        title = plugintools.find_multiple_matches(season, 'class=\"color4\">(.*?)</a>')

    num_items = len(url_cap)    
    i = 1
    
    while i <= num_items:
        url_cap_fixed = 'http://seriesadicto.com/capitulo/' + url_cap[i-1]
        title_fixed = title[i-1]
        fanart = "http://socialgeek.co/wp-content/uploads/2013/06/series-TV-Collage-television-10056729-2560-1600.jpg"
        plugintools.add_item(action="seriesadicto4", title= title_fixed, url = url_cap_fixed, thumbnail = params.get("thumbnail") , extra = str(i) , info_labels = datamovie , page = show , plot = datamovie["Plot"] , fanart = fanart, folder = True, isPlayable = False)        
        i = i + 1
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 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 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("&nbsp;", "").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 states(params):
    plugintools.log("broadcastify.states "+repr(params))
    itemlist = []

    # Descarga la home
    body,response_headers = plugintools.read_body_and_headers(params.get("url"))
    
    # Search for states combo
    body2 = plugintools.find_single_match(body,'<form method="GET" action="/listen/"><select size="1" name="stid"(.*?)</selec')
    patron = '<option value="([^"]+)">([^<]+)</option>'
    matches = plugintools.find_multiple_matches(body2,patron)

    for code,title in matches:
        url="http://www.broadcastify.com/listen/stid/"+code
        plugintools.log("title=["+title+"], url=["+url+"]")
        plugintools.add_item( action="feeds", title=title , url=url , folder=True )

    # Search for states urls without repeating
    #<a href="/listen/stid/689">Flevoland</a>
    patron = '<a href="/listen/stid/(\d+)">([^<]+)</a>'
    matches = plugintools.find_multiple_matches(body,patron)

    encontrados = set()

    for code,title in matches:
        if code not in encontrados:    
            url="http://www.broadcastify.com/listen/stid/"+code
            plugintools.log("title=["+title+"], url=["+url+"]")
            plugintools.add_item( action="feeds", title=title , url=url , folder=True )
            encontrados.add(code)
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)
Example #7
0
def laligatv(params):
    plugintools.log("[PalcoTV-0.3.0].laligatv.es Playlist Sport Channels( "+repr(params))

    thumbnail = params.get("thumbnail")
    plugintools.log("thumbnail= "+thumbnail)
   
    plugintools.add_item(action="", title = '[B][I][COLOR darkviolet]LALIGATV.ES[/B][/I][/COLOR]', url = "", thumbnail = 'http://files.lfp.es/201402/640x360_06172611noticia-la-liga-tv.es.jpg' , fanart = 'https://fbcdn-sphotos-b-a.akamaihd.net/hphotos-ak-ash3/556377_550288405007723_1790184113_n.jpg' , folder = True, isPlayable = False)
    plugintools.add_item(action="", title = '[B][I][COLOR white]Las emisiones comenzarán 15 minutos antes de cada partido[/B][/I][/COLOR]', url = "", thumbnail = 'http://files.lfp.es/201402/640x360_06172611noticia-la-liga-tv.es.jpg' , fanart = 'https://fbcdn-sphotos-b-a.akamaihd.net/hphotos-ak-ash3/556377_550288405007723_1790184113_n.jpg' , folder = True, isPlayable = False)
    
    url = params.get("url")
    thumbnail = params.get("thumbnail")
    fanart = params.get("fanart")
    title = params.get("title")
    plugintools.log("title= "+title)
    data = plugintools.read(url)
    match_total = plugintools.find_single_match(data, 'id=\"coming-soon\"(.*?)fb-root')
    plugintools.log("match_total= "+match_total)
    matches_dia = plugintools.find_single_match(data, 'id=\"coming-soon\"(.*?)</div></div>')
    plugintools.log("matches_dia= "+matches_dia) 
    jornada = plugintools.find_multiple_matches(match_total, 'class=\"title_jornada\">(.*?)</div>')
    #print 'jornada',jornada       
    matches = plugintools.find_multiple_matches(matches_dia, '<a href="(.*?)</a>')
    plugintools.add_item(action="" , title = '[COLOR lavender][B]' + jornada[0] + '[/B][/COLOR]' , thumbnail = thumbnail , folder = False , isPlayable = False)
    
    for entry in matches:
        plugintools.log("entry= "+entry)
        url_partido = entry.split('"')
        url_partido = url_partido[0]
        url_partido = url_partido.strip()
        plugintools.log("url_partido= "+url_partido)
        hora = plugintools.find_single_match(entry, 'hora_partido_otras_competiciones\">(.*?)</span>')
        plugintools.log("hora= "+hora)
        local = plugintools.find_single_match(entry, 'equipo_local_otras_competiciones\">(.*?)</span>')
        visitante = plugintools.find_single_match(entry, 'equipo_visitante_otras_competiciones\">(.*?)</span>')
        plugintools.log("local= "+local)
        plugintools.log("viistante= "+visitante)
        plugintools.add_item(action="adelante_geturl" , title = '[COLOR lightyellow][B](' + hora + ')[/B][/COLOR][COLOR white] ' + local + ' - ' + visitante + ' [/COLOR]' , url = url_partido , thumbnail = params.get("thumbnail") , folder = False , isPlayable = True)

    if len(jornada) >= 2:
        plugintools.add_item(action="" , title = '[COLOR lavender][B]' + jornada[1] + '[/B][/COLOR]' , thumbnail = thumbnail , folder = False , isPlayable = False)
        matches_dia = plugintools.find_single_match(match_total, jornada[1]+'(.*?)</div></div>')
        plugintools.log("matches_dia= "+matches_dia)
        matches = plugintools.find_multiple_matches(matches_dia, '<a href="(.*?)</a>')
        for entry in matches:
            plugintools.log("entry= "+entry)
            url_partido = entry.split('"')
            url_partido = url_partido[0]
            url_partido = url_partido.strip()
            plugintools.log("url_partido= "+url_partido)
            hora = plugintools.find_single_match(entry, 'hora_partido_otras_competiciones\">(.*?)</span>')
            plugintools.log("hora= "+hora)
            local = plugintools.find_single_match(entry, 'equipo_local_otras_competiciones\">(.*?)</span>')
            visitante = plugintools.find_single_match(entry, 'equipo_visitante_otras_competiciones\">(.*?)</span>')
            plugintools.log("local= "+local)
            plugintools.log("viistante= "+visitante)
            plugintools.add_item(action="adelante_geturl" , title = '[COLOR lightyellow][B](' + hora + ')[/B][/COLOR][COLOR white] ' + local + ' - ' + visitante + ' [/COLOR]' , url = url_partido , thumbnail = params.get("thumbnail") , folder = False , isPlayable = True)       
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 get_program(horas, eventos, url):
    epg_channel = []
    body = gethttp_noref(url)
    arena1 = plugintools.find_multiple_matches(body, '<td class=\'text-center strong \'>(.*?)</td>')
    event = plugintools.find_multiple_matches(body, '<td class=\'\'>(.*?)</td></tr>')
    evento_ahora = plugintools.find_single_match(body, '<td class=\'bg-warning\'>(.*?)</td></tr>')
    next_matches = plugintools.find_single_match(body, evento_ahora+'(.*?)</div>')
    evento_luego = plugintools.find_single_match(next_matches, '<td class=\'\'>(.*?)</td></tr>')
    hora_luego = plugintools.find_single_match(next_matches, '<td class=\'text-center strong \'>(.*?)</td>')
    hora_ahora = plugintools.find_single_match(body, 'class=\'text-center strong bg-warning\'>(.*?)</td><td class=\'bg-warning\'>'+evento_ahora)

    epg_channel = hora_ahora,evento_ahora,hora_luego,evento_luego
    return epg_channel    
Example #10
0
def lista_capis(params):
    plugintools.log('[%s %s] Linker SeriesFlv %s' % (addonName, addonVersion, repr(params)))

    plugintools.add_item(action="",url="",title="[COLOR lightblue][B]Linker SeriesFlv"+version+"[/B][COLOR lightblue]"+sc4+"[I] *** PLD.VisionTV  ***[/I]"+ec4,thumbnail=thumbnail,fanart=fanart,folder=False,isPlayable=False)
    
    url = params.get("url")
    data = jump_cloudflare(url)
    
    logo = plugintools.find_single_match(data,'<img title=".*?src="([^"]+)"')
    if logo =="": logo = thumbnail  
    title = plugintools.find_single_match(data,'<h1 class="off">([^<]+)</h1>').replace('\\','') 
    votos = plugintools.find_single_match(data,'<span id="reviewCount">(.*?)<')
    if votos =="": votos = 'N/D'
    punt = plugintools.find_single_match(data,'<meta itemprop="ratingValue" content="([^"]+)"')
    if punt =="": punt = 'N/D'
    year = plugintools.find_single_match(data,'<td>Año.*?<td>(.*?)</td>')
    if year =="": year = 'N/D'
    bloq_temp =plugintools.find_single_match(data,'<div class="temporadas m1">(.*?)<div id="lista" class="color1 ma1">')
    n_temp = plugintools.find_multiple_matches(bloq_temp,'<a class="color1 on ma1 font2".*?">Temporada(.*?)<')
    n_temp = n_temp[-1].strip()
    if n_temp =="": n_temp = 'N/D'
    bloq_genr = plugintools.find_single_match(data,'<td>Géneros(.*?)</tr>')
    n_genr = plugintools.find_multiple_matches(bloq_genr,'href=".*?">(.*?)<')
    genr = seriesflv_genr(n_genr)
    bloq_pais = plugintools.find_single_match(data,'<td>País </td>(.*?)/td>')
    pais = plugintools.find_multiple_matches(bloq_pais,'<img src=".*?">(.*?)<')
    try:
        pais = pais[-1].strip()
    except: pais = 'N/D'
    sinopsis = plugintools.find_single_match(data,'<p class="color7">(.*?)</p>').replace('\&quot;','"')
    if sinopsis =="": sinopsis = 'N/D'

    datamovie = {
    'season': sc3+'[B]Temporadas Disponibles: [/B]'+ec3+sc+str(n_temp)+', '+ec,
    'votes': sc3+'[B]Votos: [/B]'+ec3+sc+str(votos)+', '+ec,
    'rating': sc3+'[B]Puntuación: [/B]'+ec3+sc+str(punt)+', '+ec,
    'genre': sc3+'[B]Género: [/B]'+ec3+sc+str(genr)+', '+ec,
    'year': sc3+'[B]Año: [/B]'+ec3+sc+str(year)+', '+ec,
    'country': sc3+'[B]País: [/B]'+ec3+sc+str(pais)+'[CR]'+ec,
    'sinopsis': sc3+'[B]Sinopsis: [/B]'+ec3+sc+str(sinopsis)+ec}
    
    datamovie["plot"]=datamovie["season"]+datamovie["votes"]+datamovie["rating"]+datamovie["genre"]+datamovie["year"]+datamovie["country"]+datamovie["sinopsis"]

    plugintools.add_item(action="",url="",title=sc5+"[B]"+title+"[/B]"+ec5,info_labels=datamovie,thumbnail=thumbnail,fanart=fanart,folder=False,isPlayable=False)

    patron_temp = '<a class="color1 on ma1 font2"(.*?)/a>'
    item_temp = re.compile(patron_temp,re.DOTALL).findall(data)
    for temp in item_temp:
        url = plugintools.find_single_match(temp,'href="([^"]+)"')
        name_temp = plugintools.find_single_match(temp,'.html">(.*?)<')
        plugintools.addPeli(action="seriesflv_linker_capit",url=url,title=sc2+name_temp+' >>'+ec2,info_labels=datamovie,thumbnail=logo,fanart=fanart,folder=True,isPlayable=False)
def nfo_reader(title, url):
    data=gethttp_referer_headers(url,referer="")
    datamovie={}
    title=plugintools.find_single_match(data, '<title>([^<]+)')
    datamovie["Title"] = title
    imdb_rating=plugintools.find_single_match(data, '<rating>([^<]+)')
    datamovie["Rating"] = imdb_rating
    top = plugintools.find_single_match(data, '<top250>([^<]+)')
    datamovie["Top250"]=top
    year=plugintools.find_single_match(data, '<year>([^<]+)')
    datamovie["Year"] = year
    votes=plugintools.find_single_match(data, '<votes>([^<]+)')
    datamovie["Votes"] = votes
    sinopsis=plugintools.find_single_match(data, '<plot>([^<]+)')
    datamovie["Plot"] = sinopsis
    tagline=plugintools.find_single_match(data, '<tagline>([^<]+)')
    datamovie["Tagline"] = tagline
    duration=plugintools.find_single_match(data, '<runtime>([^<]+)')
    datamovie["Duration"] = duration
    fanart_matches=plugintools.find_single_match(data, '<fanart>(.*?)</fanart>')
    fanart=plugintools.find_single_match(fanart_matches, '<thumb[^>]+([^<]+)').replace(">", "").strip()
    datamovie["Fanart"] = fanart
    thumbnail=plugintools.find_single_match(data, '<thumb[^>]+([^<]+)').replace(">", "").strip()
    datamovie["Poster"] = thumbnail
    genres=plugintools.find_multiple_matches(data, '<genre>([^<]+)')
    genre_final = []
    for genre in genres:
        genre_final.append(genre)
    datamovie["Genre"] = genre_final
    dir=plugintools.find_single_match(data, '<director>([^<]+)')
    datamovie["Director"] = dir
    trailer=plugintools.find_single_match(data, '<trailer>([^<]+)')
    datamovie["Trailer"] = trailer
    duration=plugintools.find_single_match(data, '<runtime>([^<]+)')
    datamovie["Duration"] = duration
    cast_item=plugintools.find_multiple_matches(data, '<actor>(.*?)</actor>')
    cast_final = []
    for item in cast_item:
        #plugintools.log("item= "+item)
        actor=plugintools.find_single_match(item, '<name>(.*?)</name>')
        cast_final.append(actor)
    datamovie["Cast"]=cast_final
    studio=plugintools.find_single_match(data, '<studio><thumb preview="([^<]+)')
    datamovie["Studio"]=studio
    writers=plugintools.find_multiple_matches(data, '<credits>(.*?)</credits>')
    writers_final=[]
    for item in writers:
        writers_final.append(item)
    datamovie["Writer"]=writers_final
    return datamovie
def serie_capis(params):
    plugintools.log('[%s %s] serie_capis %s' % (addonName, addonVersion, repr(params)))  
    
    datamovie={}
    if params.get("plot") != "":
        datamovie["Plot"]=params.get("plot")  # Cargamos sinopsis de la serie... (si existe)
    else:
        datamovie["Plot"]="."
        
    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"            
    print show
    plugintools.modo_vista(show)
    
    url = params.get("url")
    referer = 'http://www.seriesyonkis.sx/'
    data = gethttp_referer_headers(url,referer,show)
    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)      
    #plugintools.log("data= "+data)
    
    #Carátula
    cover = plugintools.find_single_match(data, '<img src="([^"]+)')
    match_temporadas = plugintools.find_single_match(data, '<div id="section-content">(.*?)</ul>')
    temps = plugintools.find_multiple_matches(match_temporadas, '<h3 class="season"(.*?)</li>')
    
    for entry in temps:
        capis = plugintools.find_multiple_matches(entry, '<td class="episode-title">(.*?)</td>')
        for entri in capis:
            url_cap = plugintools.find_single_match(entri, '<a href="([^"]+)')
            url_cap = 'http://www.seriesyonkis.sx'+url_cap
            plugintools.log("url_cap= "+url_cap)
            num_cap = plugintools.find_single_match(entri, '<strong>(.*?)</strong>')
            num_cap = num_cap.strip()
            plugintools.log("num_cap= "+num_cap)
            title_cap = plugintools.find_single_match(entri, '</strong>(.*?)</a>')
            title_cap = title_cap.strip()
            plugintools.log("title_cap= "+title_cap)
            title_capi = '[COLOR orange][B]'+num_cap+'[/B][COLOR white]'+title_cap+'[/COLOR]'.strip()
            title_fixed = num_cap + title_cap
            title_fixed = title_fixed.strip()
            plugintools.add_item(action="enlaces_capi", title=title_capi, url = url_cap, thumbnail = cover , plot = datamovie["Plot"], info_labels = datamovie , fanart = fanart, folder = True, page = show, extra = title_fixed , isPlayable = False)
def seriesblanco0(params):
    plugintools.log("[%s %s] SeriesBlanco0 %s" % (addonName, addonVersion, repr(params)))

    show = plugintools.get_setting("series_id")
    if show == "":
        show = "tvshows"
        plugintools.modo_vista(show)
        plugintools.log("show= " + show)

    sinopsis = params.get("plot")
    datamovie = {}
    datamovie["Plot"] = sinopsis

    thumbnail = params.get("thumbnail")
    if thumbnail == "":
        thumbnail = "http://seriesblanco.com/imags_estilos/logoblanconavidad2.png"
    fanart = "http://socialgeek.co/wp-content/uploads/2013/06/series-TV-Collage-television-10056729-2560-1600.jpg"

    url = params.get("url")
    referer = url
    data = gethttp_referer_headers(url, referer, show)
    # plugintools.log("data= "+data)

    seasons = plugintools.find_multiple_matches(data, "<h2 style='cursor: hand; cursor: pointer;'><u>(.*?)</table>")
    for entry in seasons:
        # plugintools.log("entry= "+entry)
        title_temp = plugintools.find_single_match(entry, "(.*?)</u></h2>")
        chapter = plugintools.find_multiple_matches(entry, "<tr><td>(.*?)</td>")
        for entri in chapter:
            # plugintools.log("entri= "+entri)
            url_chapter = plugintools.find_single_match(entri, "<a href='([^']+)")
            url_chapter = "http://www.seriesblanco.com" + url_chapter
            title_chapter = plugintools.find_single_match(entri, "'>(.*?)</a>")
            plugintools.log("title_chapter=" + title_chapter)
            plugintools.log("url_chapter=" + url_chapter)
            if title_chapter.find("x00") < 0:
                plugintools.add_item(
                    action="seriesblanco1",
                    title=title_chapter,
                    url=url_chapter,
                    thumbnail=thumbnail,
                    info_labels=datamovie,
                    extra=show,
                    page=show,
                    plot=sinopsis,
                    fanart=fanart,
                    folder=True,
                    isPlayable=False,
                )
Example #14
0
def YOUTUBE_CHANNELS(url):
    find_url=url.find('?')+1
    keep_url=url[:find_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()

    # Extract items from feed
    pattern = ""
    matches = plugintools.find_multiple_matches(link,"<entry>(.*?)</entry>")
    
    for entry in matches:
        
        # Not the better way to parse XML, but clean and easy
        title = plugintools.find_single_match(entry,"<titl[^>]+>([^<]+)</title>").replace("&amp;","&")
        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\=([^\&]+)\&").replace("&amp;","&")
        play_url = "plugin://plugin.video.youtube/?path=/root/video&action=play_video&videoid="+video_id

        plugintools.add_item( action="play" , title=title , plot=plot , url=play_url ,thumbnail=thumbnail , folder=True )
    
    # Calculates next page URL from actual URL
    start_index = int( plugintools.find_single_match( link ,"start-index=(\d+)") )
    max_results = int( plugintools.find_single_match( link ,"max-results=(\d+)") )
    next_page_url = keep_url+"start-index=%d&max-results=%d" % ( start_index+max_results , max_results)

    addDir(">> Next page",next_page_url,13,"")
Example #15
0
def torrentone(params):
    plugintools.log("[PalcoTV-0.3.0].Playlist Sport Channels Torrent1( "+repr(params))
    plugintools.add_item(action="", title = '[B][I][COLOR lightyellow]1torrent.tv Acestream Sports Playlist[/B][/I][/COLOR]', url = "", thumbnail = 'http://1torrent.tv/images/header_logo.png' , fanart = 'http://hdwallpappers.com/images/wallpapers/Allianz-Arena-Stadium-wallpaper.jpg' , folder = True, isPlayable = False)    

    url = params.get("url")
    thumbnail = params.get("thumbnail")
    fanart = params.get("fanart")
    title = params.get("title")
    plugintools.log("title= "+title)
    data = plugintools.read(url)
    plugintools.log("data= "+data)
    match = plugintools.find_single_match(data, 'tcon_6(.*?)</a></div></div></div></div>')
    plugintools.log("match sports= "+match)
    matches = plugintools.find_multiple_matches(match, '<a href="(.*?)</a>(.*?)</a>')

    for winy, xiny in matches:
        plugintools.log("winy= "+winy)
        plugintools.log("xiny= "+xiny)
        winy = winy.split("><")
        url = 'http://1torrent.tv' + winy[0]
        url = url.replace('"', "")
        thumbnail = 'http://1torrent.tv/images/header_logo.png'
        title = xiny.split(">")
        title = title[3]
        plugintools.log("title= "+title)
        plugintools.log("url= "+url)
        plugintools.log("thumbnail= "+thumbnail)
        plugintools.add_item(action="gethash_torrentone" , title = title, url = url , thumbnail = thumbnail , fanart = 'http://hdwallpappers.com/images/wallpapers/Allianz-Arena-Stadium-wallpaper.jpg' , isPlayable = True, folder = False)
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
Example #17
0
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,
        )
Example #18
0
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 tumi(params):
    plugintools.log("[Movies-Online[0.0.1].Tumi "+repr(params))

    data = plugintools.read(params.get("url"))
    
    if "Video is processing now" in data:
        xbmc.executebuiltin("Notification(%s,%s,%i,%s)" % ('Movies-Online', "El archivo está en proceso", 3 , art+'icon.png'))       
    else:
        # Vamos a buscar el ID de la página embebida
        matches = plugintools.find_multiple_matches(data, 'add_my_acc=(.*?)\"')
        for entry in matches:
            print 'match',entry
            # http://tumi.tv/embed-i9l4mr7jph1a.html
            url = 'http://tumi.tv/embed-' + entry + '.html'
            
            # Petición HTTP de esa URL
            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",params.get("url")])
            body,response_headers = plugintools.read_body_and_headers(url, headers=request_headers)
            plugintools.log("body= "+body)
            video_url= plugintools.find_single_match(body, 'file\: \"(.*?)\"')
            plugintools.log("video_url= "+video_url)
            plugintools.add_item(action="play", title= "hola" , url = video_url , folder = False , isPlayable = True)
            plugintools.play_resolved_url(video_url)
Example #20
0
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 )
Example #21
0
def tvshow_seasons(params):
    plugintools.log("movie4k.tvshow_seasons "+repr(params))

    #plugintools.set_view(plugintools.LIST)

    body,response_headers = read_body_and_headers(params.get("url"))

    '''
    <TR>
    <TD id="tdmovies" width="538"><a href="tvshows-episode-1-Arrow.html">Arrow          , Season: 1                     </a></TD>
    <TD id="tdmovies"><img border=0 src="http://img.movie4k.to/img/us_ger_small.png" width=24 height=14></TD>
    </TR>
    '''
    pattern  = '<TR[^<]+'
    pattern += '<TD id="tdmovies" width="\d+"><a href="([^"]+)">([^<]+)</a></TD[^<]+'
    pattern += '<TD id="tdmovies"><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()
        title=title + get_language_from_flag_img(flag)
        thumbnail = ""
        plot = ""
        plugintools.log("movie4k.tvshow_seasons title="+title+", url="+url+", thumbnail="+thumbnail)

        plugintools.add_item( action="tvshow_episodes", title=title, url=url, thumbnail=thumbnail , plot=plot, fanart=thumbnail , folder=True )
Example #22
0
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 )
Example #23
0
def tvshows_featured(params):
    plugintools.log("movie4k.tvshows_featured "+repr(params))

    #plugintools.set_view(plugintools.MOVIES)

    body,response_headers = read_body_and_headers(params.get("url"))
    pattern  = '<div style="float.left"[^<]+'
    pattern += '<a href="([^"]+)"><img src="([^"]+)".*?'
    pattern += '<h2[^<]+<a[^<]+<font[^>]+>([^<]+)</a[^<]+<img src="([^"]+)".*?'
    matches = plugintools.find_multiple_matches(body,pattern)

    for scrapedurl, scrapedthumbnail, scrapedtitle, flag in matches:
        
        url = urlparse.urljoin(params.get("url"),scrapedurl)
        url = MAIN_URL+"tvshows-season-"+plugintools.find_single_match(url,MAIN_URL+"([A-Za-z0-9\-]+)-watch-tvshow-\d+.html")+".html"

        title = scrapedtitle
        if title.strip().endswith(":"):
            title = title.strip()[:-1]
        title=title + get_language_from_flag_img(flag)
        thumbnail = urlparse.urljoin(params.get("url"),scrapedthumbnail)
        plot = ""
        plugintools.log("movie4k.tvshows_featured title="+title+", url="+url+", thumbnail="+thumbnail)

        plugintools.add_item( action="tvshow_seasons", title=title, url=url, thumbnail=thumbnail , plot=plot, fanart=thumbnail , folder=True )
Example #24
0
def genres(params):
    plugintools.log("movie4k.genres "+repr(params))

    #plugintools.set_view(plugintools.LIST)

    body,response_headers = read_body_and_headers(params.get("url"))

    '''
    <TR>
    <TD id="tdmovies" width="155"><a href="movies-genre-59-Reality-TV.html">Reality-TV</a></TD>
    <TD id="tdmovies" width="50">30</TD>
    </TR>
    '''
    pattern  = '<TR[^<]+'
    pattern += '<TD id="tdmovies" width="\d+"><a href="('+params.get("extra")+'-[^"]+)">([^<]+)</a></TD[^<]+'
    pattern += '<TD id="tdmovies" width="\d+">(\d+)</TD[^<]+'
    pattern += '</TR>'
    matches = plugintools.find_multiple_matches(body,pattern)

    for scrapedurl, scrapedtitle, counter in matches:
        
        url = urlparse.urljoin(params.get("url"),scrapedurl)
        title = scrapedtitle.strip()+" ("+counter+" movies)"
        thumbnail = ""
        plot = ""
        plugintools.log("movie4k.genres title="+title+", url="+url+", thumbnail="+thumbnail)

        if params.get("extra") == "tvshows-genre":
            plugintools.add_item( action="tvshows_all", title=title, url=url, thumbnail=thumbnail , plot=plot, fanart=thumbnail , folder=True )
        else:
            plugintools.add_item( action="movies_all", title=title, url=url, thumbnail=thumbnail , plot=plot, fanart=thumbnail , folder=True )
Example #25
0
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 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            
Example #27
0
def main_list(params):
    plugintools.log("MelodyEntInc.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 )
Example #28
0
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 )
Example #29
0
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("&ntilde;", "ñ")
        #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)
Example #30
0
def tvshow_episodes(params):
    plugintools.log("movie4k.tvshow_episodes "+repr(params))

    #plugintools.set_view(plugintools.LIST)
    body,response_headers = read_body_and_headers_cached(params.get("url"))

    pattern  = '<TR[^<]+'
    pattern += '<TD id="tdmovies" width="\d+"[^<]+'
    pattern += '<a href="([^"]+)">([^<]+)</a></TD[^<]+'
    pattern += '<TD id="tdmovies" width="\d+"[^<]+'
    pattern += '<img[^>]+>([^<]+)</TD[^<]+'
    pattern += '.*?<img border=0 src="([^"]+)"'
    matches = plugintools.find_multiple_matches(body,pattern)

    for scrapedurl, scrapedtitle, mirrorname, flag in matches:
        url = urljoin(params.get("url"),scrapedurl)
        title = html_unescape(scrapedtitle).strip()
        if title.strip().endswith(":"):
            title = title.strip()[:-1]
        title = title + " ("+mirrorname.strip().replace("watch on ","")+")"
        title = title + "  (" + get_language_from_flag_img(flag) + ")"
        plugintools.log("movie4k.tvshow_episodes title="+title+", url="+url)

        for hoster in HOSTERS_BLACKLIST:
            #plugintools.log("<<<<<"+hoster+">>>>> IN <<<<<<"+title.lower()+">>>>>>")
            if hoster in title.lower():
                break;
        else:
            plugintools.add_item( action="play", title=title, url=url, fanart=FANART, folder=True )