Beispiel #1
0
def findvideos(item):
    support.info(item)
    itemlist = []

    if 'adf.ly' in item.url:
        from servers.decrypters import adfly
        url = adfly.get_long_url(item.url)

    elif 'bit.ly' in item.url:
        url = support.httptools.downloadpage(item.url, only_headers=True, follow_redirects=False).headers.get("location")

    else:
        url = host
        for u in item.url.split('/'):
            if u and 'animeforce' not in u and 'http' not in u:
                url += '/' + u

        if 'php?' in url:
            url = support.httptools.downloadpage(url, only_headers=True, follow_redirects=False).headers.get("location")
            url = support.match(url, patron=r'class="button"><a href=(?:")?([^" ]+)', headers=headers).match
        else:
            if item.data: url = item.data
            url = support.match(url, patron=r'data-href="([^"]+)" target').match
            if not url: url = support.match(url, patron=[r'<source src=(?:")?([^" ]+)',r'name="_wp_http_referer" value="([^"]+)"']).match
        if url.startswith('//'): url = 'https:' + url
        elif url.startswith('/'): url = 'https:/' + url
        if 'vvvvid' in url: itemlist.append(item.clone(action="play", title='VVVVID', url=url, server='vvvvid'))
        else: itemlist.append(item.clone(action="play", title=support.config.get_localized_string(30137), url=url, server='directo'))

    return support.server(item, itemlist=itemlist)
Beispiel #2
0
def play(item):
    logger.info()
    itemlist = []

    if item.server == "linkbucks":
        logger.info("Es linkbucks")

        # Averigua el enlace
        from servers.decrypters import linkbucks
        location = linkbucks.get_long_url(item.url)
        logger.info("location=" + location)

        # Extrae la URL de saltar el anuncio en adf.ly
        if location.startswith("http://adf"):
            # Averigua el enlace
            from servers.decrypters import adfly
            location = adfly.get_long_url(location)
            logger.info("location=" + location)

        from core import servertools
        itemlist = servertools.find_video_items(data=location)
        for videoitem in itemlist:
            videoitem.channel = item.channel
            videoitem.folder = False

    else:
        itemlist.append(item)

    return itemlist
Beispiel #3
0
def play(item):
    logger.info("[somosmovies.py] play(item.url="+item.url+")")
    itemlist=[]

    if "bit.ly" in item.url:
        logger.info("Acortador bit.ly")
        location = scrapertools.get_header_from_response(item.url,header_to_get="location")
        logger.info("[somosmovies.py] location="+location)
        item.url = location
        return play(item)

    if "goo.gl" in item.url:
        logger.info("Acortador goo.gl")
        location = scrapertools.get_header_from_response(item.url,header_to_get="location")
        item.url = location
        return play(item)

    #adf.ly
    elif "j.gs" in item.url:
        logger.info("Acortador j.gs (adfly)")
        from servers.decrypters import adfly
        location = adfly.get_long_url(item.url)
        item.url = location
        return play(item)

    else:
        from core import servertools
        itemlist=servertools.find_video_items(data=item.url)
        for videoitem in itemlist:
            videoitem.channel=item.channel
            videoitem.folder=False

    return itemlist
Beispiel #4
0
def findvideos(item):
    logger.info("streamondemand.animeforce findvideos")

    itemlist = []

    if item.extra:
        data = httptools.downloadpage(item.url, headers=headers).data

        blocco = scrapertools.get_match(data, r'%s(.*?)</tr>' % item.extra)
        scrapedurl = scrapertools.find_single_match(
            blocco, r'<a href="([^"]+)"[^>]+>')
        url = scrapedurl
    else:
        url = item.url

    if 'adf.ly' in url:
        url = adfly.get_long_url(url)
    elif 'bit.ly' in url:
        url = httptools.downloadpage(
            url, only_headers=True,
            follow_redirects=False).headers.get("location")

    if 'animeforce' in url:
        headers.append(['Referer', item.url])
        data = httptools.downloadpage(url, headers=headers).data
        itemlist.extend(servertools.find_video_items(data=data))

        for videoitem in itemlist:
            videoitem.title = item.title + videoitem.title
            videoitem.fulltitle = item.fulltitle
            videoitem.show = item.show
            videoitem.thumbnail = item.thumbnail
            videoitem.channel = __channel__

        url = url.split('&')[0]
        data = httptools.downloadpage(url, headers=headers).data
        patron = """<source\s*src=(?:"|')([^"']+?)(?:"|')\s*type=(?:"|')video/mp4(?:"|')>"""
        matches = re.compile(patron, re.DOTALL).findall(data)
        headers.append(['Referer', url])
        for video in matches:
            itemlist.append(
                Item(channel=__channel__,
                     action="play",
                     title=item.title,
                     url=video + '|' + urllib.urlencode(dict(headers)),
                     folder=False))
    else:
        itemlist.extend(servertools.find_video_items(data=url))

        for videoitem in itemlist:
            videoitem.title = item.title + videoitem.title
            videoitem.fulltitle = item.fulltitle
            videoitem.show = item.show
            videoitem.thumbnail = item.thumbnail
            videoitem.channel = __channel__

    return itemlist
def play(item):
    logger.info()
    data = adfly.get_long_url(item.url)

    itemlist = servertools.find_video_items(data=data)

    for videoitem in itemlist:
        videoitem.title = item.show
        videoitem.fulltitle = item.fulltitle
        videoitem.show = item.show
        videoitem.thumbnail = item.thumbnail
        videoitem.channel = __channel__

    return itemlist
Beispiel #6
0
def findvideos(item):
    support.log(item)

    itemlist = []

    if item.episode:
        from lib import unshortenit
        url, c = unshortenit.unshorten(item.url)
        url = support.match(item,
                            r'<a href="([^"]+)"[^>]*>',
                            patronBlock=r'Episodio %s(.*?)</tr>' %
                            item.episode,
                            url=url)[0]
        item.url = url[0] if url else ''

    if 'vvvvid' in item.url:
        item.action = 'play'
        itemlist.append(item)

    if 'http' not in item.url:
        if '//' in item.url[:2]:
            item.url = 'http:' + item.url
        elif host not in item.url:
            item.url = host + item.url

    if 'adf.ly' in item.url:
        item.url = adfly.get_long_url(item.url)
    elif 'bit.ly' in item.url:
        item.url = support.httptools.downloadpage(
            item.url, only_headers=True,
            follow_redirects=False).headers.get("location")

    matches = support.match(item, r'button"><a href="([^"]+)"')[0]

    for video in matches:
        itemlist.append(
            support.Item(channel=item.channel,
                         action="play",
                         title='diretto',
                         url=video,
                         server='directo'))

    return support.server(item, itemlist=itemlist)
Beispiel #7
0
def findvideos(item):
    support.log(item)
    # try:
    #     from urlparse import urljoin
    # except:
    #     from urllib.parse import urljoin
    # support.dbg()
    itemlist = []
    if 'vvvvid' in item.url:
        import requests
        from lib import vvvvid_decoder

        if support.match(item.url, string=True, patron=r'(\d+/\d+)').match:
            item.action = 'play'
            itemlist.append(item)
        else:
            # VVVVID vars
            vvvvid_host = 'https://www.vvvvid.it/vvvvid/ondemand/'
            vvvvid_headers = {
                'User-Agent':
                'Mozilla/5.0 (X11; Linux x86_64; rv:62.0) Gecko/20100101 Firefox/62.0'
            }

            # VVVVID session
            current_session = requests.Session()
            login_page = 'https://www.vvvvid.it/user/login'
            conn_id = current_session.get(
                login_page, headers=vvvvid_headers).json()['data']['conn_id']
            payload = {'conn_id': conn_id}

            # collect parameters
            show_id = support.match(item.url, string=True,
                                    patron=r'(\d+)').match
            ep_number = support.match(item.title, patron=r'(\d+)').match
            json_file = current_session.get(vvvvid_host + show_id +
                                            '/seasons/',
                                            headers=vvvvid_headers,
                                            params=payload).json()
            season_id = str(json_file['data'][0]['season_id'])
            json_file = current_session.get(vvvvid_host + show_id +
                                            '/season/' + season_id + '/',
                                            headers=vvvvid_headers,
                                            params=payload).json()

            # select the correct episode
            for episode in json_file['data']:
                support.log('Number', int(episode['number']), int(ep_number))
                if int(episode['number']) == int(ep_number):
                    url = vvvvid_decoder.dec_ei(episode['embed_info']
                                                or episode['embed_info'])
                    if 'youtube' in url: item.url = url
                    item.url = url.replace('manifest.f4m',
                                           'master.m3u8').replace(
                                               'http://', 'https://').replace(
                                                   '/z/', '/i/')
                    if 'https' not in item.url:
                        url = support.match(
                            item,
                            url='https://or01.top-ix.org/videomg/_definst_/mp4:'
                            + item.url + '/playlist.m3u')[1]
                        url = url.split()[-1]
                        itemlist.append(
                            support.Item(
                                action='play',
                                url=
                                'https://or01.top-ix.org/videomg/_definst_/mp4:'
                                + item.url + '/' + url,
                                server='directo'))

    elif 'adf.ly' in item.url:
        from servers.decrypters import adfly
        url = adfly.get_long_url(item.url)

    elif 'bit.ly' in item.url:
        url = support.httptools.downloadpage(
            item.url, only_headers=True,
            follow_redirects=False).headers.get("location")

    else:
        url = host
        for u in item.url.split('/'):
            # support.log(i)
            if u and 'animeforce' not in u and 'http' not in u:
                url += '/' + u

        if 'php?' in url:
            url = support.httptools.downloadpage(
                url, only_headers=True,
                follow_redirects=False).headers.get("location")
            url = support.match(
                url,
                patron=r'class="button"><a href=(?:")?([^" ]+)',
                headers=headers).match
        else:
            url = support.match(url,
                                patron=[
                                    r'<source src=(?:")?([^" ]+)',
                                    r'name="_wp_http_referer" value="([^"]+)"'
                                ]).match
        if url.startswith('//'): url = 'https:' + url
        elif url.startswith('/'): url = 'https:/' + url

        itemlist.append(
            support.Item(channel=item.channel,
                         action="play",
                         title='Diretto',
                         url=url,
                         server='directo'))

    return support.server(item, itemlist=itemlist)