Beispiel #1
0
def play(item):
    logger.info()
    itemlist = []

    if item.url:
        data = do_downloadpage(item.url)
        # ~ logger.debug(data)
        url = scrapertools.find_single_match(data, '<a id="link" href="([^"]+)')
        if url: 
            itemlist.append(item.clone( url=servertools.normalize_url(item.server, url) ))

    else:
        post = urllib.urlencode( {'action': 'doo_player_ajax', 'post': item.dpost, 'nume': item.dnume, 'type': item.dtype} )
        data = httptools.downloadpage(host + 'wp-admin/admin-ajax.php', post=post, headers={'Referer':item.referer}).data
        # ~ logger.debug(data)
        url = scrapertools.find_single_match(data, "src='([^']+)")
        if not url: url = scrapertools.find_single_match(data, 'src="([^"]+)')
        if url: 
            if 'jwplayer' in url and 'source=' in url: # Ej: https://www.dospelis.online/jwplayer-2/?source=https%3A%2F%2Fyoutu.be%2Fzcn89lxhEWk&id=71977&type=mp4
                url = urllib.unquote(scrapertools.find_single_match(url, "source=([^&']+)"))
            elif 'streamcrypt.net/' in url: # Ej: https://streamcrypt.net/embed/streamz.cc/...
                url = scrapertools.decode_streamcrypt(url)

            if not url: return itemlist
            servidor = servertools.get_server_from_url(url)
            if servidor and servidor != 'directo':
                url = servertools.normalize_url(servidor, url)
                itemlist.append(item.clone( url=url, server=servidor ))

    return itemlist
def findvideos(item):
    logger.info()
    itemlist = []

    data = do_downloadpage(item.url)
    # ~ logger.debug(data)
    dict_data = jsontools.load(data)

    if 'title' not in dict_data: return itemlist

    elementos = []
    if 'episodeNumber=' in item.url and 'season' in dict_data[
            'title'] and 'episodes' in dict_data['title']['season']:
        for epi in dict_data['title']['season']['episodes']:
            if epi['season_number'] == item.contentSeason and epi[
                    'episode_number'] == item.contentEpisodeNumber and 'videos' in epi:
                elementos = epi['videos']
                break
    if len(elementos) == 0:
        elementos = dict_data['title']['videos']

    for element in elementos:
        if '/z' in element['name'] and 'clicknupload' not in element['url']:
            continue  # descartar descargas directas (menos clicknupload)
        if 'youtube.com/' in element['url']: continue  # descartar tráilers
        # ~ logger.debug(element)

        url = element['url']
        if url.startswith('https://goo.gl/'):  # acortador de google
            url = httptools.downloadpage(url,
                                         follow_redirects=False,
                                         only_headers=True).headers.get(
                                             'location', '')
            if not url: continue
        elif 'streamcrypt.net/' in url:  # acortador
            url = scrapertools.decode_streamcrypt(url)
            if not url: continue

        #TODO? Mostrar info de positive_votes, negative_votes, reports

        itemlist.append(
            Item(
                channel=item.channel,
                action='play',
                title=item.title,
                url=url,
                language=_extraer_idioma(element['name']),
                quality=element['quality'],
                quality_num=puntuar_calidad(element['quality'])  #, other = url
            ))

    itemlist = servertools.get_servers_itemlist(itemlist)

    return itemlist
Beispiel #3
0
def play(item):
    logger.info()
    itemlist = []

    if 'streamcrypt.net/' in item.url:  # Ej: https://streamcrypt.net/[embed/]flashx.tv/...
        url = scrapertools.decode_streamcrypt(item.url)

        if not url: return itemlist
        servidor = servertools.get_server_from_url(url)
        if servidor and servidor != 'directo':
            url = servertools.normalize_url(servidor, url)
            itemlist.append(item.clone(url=url, server=servidor))
    else:
        itemlist.append(item.clone())

    return itemlist