Пример #1
0
def episodios(item):
    support.info()
    itemlist = []

    js = json.loads(
        support.match(item.url,
                      patron=r'seasons="([^"]+)').match.replace('"', '"'))
    support.info(js)

    for episodes in js:
        for it in episodes['episodes']:
            support.info(it)
            itemlist.append(
                support.Item(channel=item.channel,
                             title=support.typo(
                                 str(episodes['number']) + 'x' +
                                 str(it['number']).zfill(2) + ' - ' +
                                 it['name'], 'bold'),
                             episode=it['number'],
                             season=episodes['number'],
                             thumbnail='https://image.tmdb.org/t/p/w1280' +
                             it['images'][0]['url'],
                             fanart='https://image.tmdb.org/t/p/w1280' +
                             it['images'][0]['url'],
                             plot=it['plot'],
                             action='findvideos',
                             contentType='episode',
                             url=host + '/watch/' + str(episodes['title_id']) +
                             '?e=' + str(it['id'])))

    support.videolibrary(itemlist, item)
    support.download(itemlist, item)
    return itemlist
Пример #2
0
def episodios(item):
    # getHeaders()
    logger.debug()
    itemlist = []

    js = json.loads(
        support.match(item.url,
                      patron=r'seasons="([^"]+)').match.replace('"', '"'))

    for episodes in js:
        for it in episodes['episodes']:
            itemlist.append(
                support.Item(
                    channel=item.channel,
                    title=support.typo(
                        str(episodes['number']) + 'x' +
                        str(it['number']).zfill(2) + ' - ' + it['name'],
                        'bold'),
                    episode=it['number'],
                    season=episodes['number'],
                    thumbnail=it['images'][0]['original_url'] if 'images' in it
                    and 'original_url' in it['images'][0] else item.thumbnail,
                    fanart=item.fanart,
                    plot=it['plot'],
                    action='findvideos',
                    contentType='episode',
                    contentSerieName=item.fulltitle,
                    url=host + '/watch/' + str(episodes['title_id']),
                    episodeid='?e=' + str(it['id'])))

    support.videolibrary(itemlist, item)
    support.download(itemlist, item)
    return itemlist
Пример #3
0
def episodios(item):
    support.info()
    itemlist = []
    data = support.match(item.url, headers=headers).data
    json_object = jsontools.load(data)
    for season in json_object['seasons']:
        seas_url=host+season['@id']+'/releases'
        itemlist_season=get_season(item, seas_url, season['seasonNumber'])
        if(len(itemlist_season)>0):
            itemlist.extend(itemlist_season)

    support.videolibrary(itemlist, item, 'color kod bold')
    support.download(itemlist, item)

    return itemlist
Пример #4
0
def get_seasons(item):
    logger.debug()
    itemlist = []
    infoLabels = item.infoLabels
    json = item.url if type(item.url) == dict else item.url
    if 'seasons_list' in json:
        json = json['seasons_list']
    elif 'tvshows_list' in json:
        return show_menu(item)
    for option in json:
        infoLabels['season'] = option['season']
        title = config.get_localized_string(60027) % option['season']
        extra = set_extra_values(item, option, item.path)
        # url = relative('link', option, item.path)

        itemlist.append(
            Item(channel=item.channel,
                 title=set_title(title),
                 fulltitle=item.fulltitle,
                 show=item.show,
                 thumbnail=extra.thumb,
                 filterseason=int(option['season']),
                 url=extra.url,
                 action='episodios',
                 contentSeason=option['season'],
                 infoLabels=infoLabels,
                 contentType='season' if show_seasons else 'tvshow',
                 path=extra.path))

    if inspect.stack()[2][3] in [
            'add_tvshow', 'get_episodes', 'update', 'find_episodes',
            'get_newest'
    ] or show_seasons == False:
        itlist = []
        for item in itemlist:
            itlist = episodios(item)
        itemlist = itlist
        if inspect.stack()[2][3] not in [
                'add_tvshow', 'get_episodes', 'update', 'find_episodes',
                'get_newest'
        ] and defp and not item.disable_pagination:
            itemlist = pagination(item, itemlist)

    # if show_seasons:
    support.videolibrary(itemlist, item)
    support.download(itemlist, item)
    return itemlist
Пример #5
0
def episodios(item):
    # getHeaders()
    logger.debug()
    itemlist = []

    js = json.loads(
        support.match(item.url,
                      patron=r'seasons="([^"]+)').match.replace('"', '"'))

    for episodes in js:
        logger.debug(jsontools.dump(js))
        for it in episodes['episodes']:

            itemlist.append(
                item.clone(
                    title=support.typo(
                        str(episodes['number']) + 'x' +
                        str(it['number']).zfill(2) + ' - ' +
                        support.cleantitle(it['name']), 'bold'),
                    episode=it['number'],
                    season=episodes['number'],
                    contentSeason=episodes['number'],
                    contentEpisodeNumber=it['number'],
                    thumbnail=it['images'][0]['original_url'] if 'images' in it
                    and 'original_url' in it['images'][0] else item.thumbnail,
                    contentThumbnail=item.thumbnail,
                    fanart=item.fanart,
                    contentFanart=item.fanart,
                    plot=it['plot'],
                    action='findvideos',
                    contentType='episode',
                    contentSerieName=item.fulltitle,
                    url=host + '/watch/' + str(episodes['title_id']),
                    episodeid='?e=' + str(it['id'])))

    if config.get_setting('episode_info') and not support.stackCheck(
        ['add_tvshow', 'get_newest']):
        support.tmdb.set_infoLabels_itemlist(itemlist, seekTmdb=True)
    support.check_trakt(itemlist)
    support.videolibrary(itemlist, item)
    support.download(itemlist, item)
    return itemlist
Пример #6
0
def episodios(item):
    support.info()
    itemlist = []
    title = 'Parte ' if item.type.lower() == 'movie' else 'Episodio '
    for it in item.episodes:
        itemlist.append(
            support.Item(channel=item.channel,
                         title=support.typo(title + it['number'], 'bold'),
                         episode=it['number'],
                         fulltitle=item.title,
                         show=item.title,
                         contentTitle='',
                         contentSerieName=item.contentSerieName,
                         thumbnail=item.thumbnail,
                         plot=item.plot,
                         action='findvideos',
                         contentType='episode',
                         url=it['link']))

    autorenumber.start(itemlist, item)
    support.videolibrary(itemlist, item)
    support.download(itemlist, item)
    return itemlist
Пример #7
0
def episodios(item):
    support.info()
    itemlist = []
    title = 'Parte ' if item.type.lower() == 'movie' else 'Episodio '
    for it in item.episodes:
        itemlist.append(
            item.clone(title=support.typo(title + it['number'], 'bold'),
                       episode=it['number'],
                       fulltitle=item.title,
                       show=item.title,
                       contentTitle='',
                       contentSerieName=item.contentSerieName,
                       thumbnail=item.thumbnail,
                       plot=item.plot,
                       action='findvideos',
                       contentType='episode',
                       scws_id=it.get('scws_id', ''),
                       video_url=it.get('link', '')))

    if inspect.stack()[1][3] not in ['find_episodes']:
        autorenumber.start(itemlist, item)
    support.videolibrary(itemlist, item)
    support.download(itemlist, item)
    return itemlist
Пример #8
0
def episodios(item, json='', key='', itemlist=[]):
    logger.debug()
    infoLabels = item.infoLabels
    itm = item

    if type(item.url) == dict:
        if 'seasons_list' in item.url:
            return get_seasons(item)
        elif 'tvshows_list' in item.url:
            return peliculas(item, item.url, 'tvshows_list')
        else:
            json = {}
            json = item.url['episodes_list']
    else:
        json = load_json(item)
        if 'episodes_list' in json:
            json = json['episodes_list']
        elif 'seasons_list' in json:
            item.url = json['seasons_list']
            return get_seasons(item)
        elif 'tvshows_list' in json:
            return peliculas(item, json, 'tvshows_list')

    # set variable
    ep = 1
    season = infoLabels[
        'season'] if 'season' in infoLabels else item.contentSeason if item.contentSeason else 1

    if inspect.stack()[1][3] not in [
            'add_tvshow', 'get_episodes', 'update', 'find_episodes', 'search'
    ] and not show_seasons:
        Pagination = int(defp) if defp.isdigit() else ''
    else:
        Pagination = ''
    pag = item.page if item.page else 1

    # make items
    for i, option in enumerate(json):
        if Pagination and (pag - 1) * Pagination > i: continue  # pagination
        if Pagination and i >= pag * Pagination: break
        # build numeration of episodes
        numeration = option['number'] if 'number' in option else option['title']
        match = support.match(numeration,
                              patron=r'(?P<season>\d+)x(?P<episode>\d+)').match
        if match:
            episode_number = match[1]
            ep = int(match[1]) + 1
            season_number = int(match[0])
        else:
            season_number = option[
                'season'] if 'season' in option else season if season else 1
            episode_number = option['number'] if 'number' in option else option[
                'episode'] if 'episode' else ''
            if type(episode_number) == int:
                pass
            elif not episode_number.isdigit():
                episode_number = support.match(
                    option['title'], patron=r'(?P<episode>\d+)').match
            ep = int(episode_number) if episode_number else ep
            if not episode_number:
                episode_number = str(ep).zfill(2)
                ep += 1

        infoLabels['season'] = season_number
        infoLabels['episode'] = episode_number
        title = ' - ' + option['title'] if 'title' in option else ''
        title = '%sx%s%s' % (season_number, episode_number, title)
        extra = set_extra_values(item, option, item.path)
        if not item.filterseason or season_number == int(item.filterseason):
            itemlist.append(
                Item(channel=item.channel,
                     title=set_title(title, extra.language, extra.quality),
                     fulltitle=item.fulltitle,
                     show=item.show,
                     url=option,
                     action='findvideos',
                     plot=extra.plot,
                     thumbnail=extra.thumb if extra.thumb else item.thumbnail,
                     fanart=extra.fanart,
                     contentSeason=season_number,
                     contentEpisode=episode_number,
                     infoLabels=infoLabels,
                     contentType='episode',
                     path=item.path))

    # if showseason
    if inspect.stack()[1][3] not in [
            'add_tvshow', 'get_episodes', 'update', 'find_episodes',
            'get_newest', 'search'
    ]:
        if show_seasons and not item.filterseason:
            itm.contentType = 'season'
            season_list = []
            for item in itemlist:
                if item.contentSeason not in season_list:
                    season_list.append(item.contentSeason)
            itemlist = []
            for season in season_list:
                itemlist.append(
                    Item(channel=item.channel,
                         title=set_title(
                             config.get_localized_string(60027) % season),
                         fulltitle=itm.fulltitle,
                         show=itm.show,
                         thumbnails=itm.thumbnails,
                         url=itm.url,
                         action='episodios',
                         contentSeason=season,
                         contentType='episode',
                         infoLabels=infoLabels,
                         filterseason=str(season),
                         path=item.path))

            support.videolibrary(itemlist, item)
            support.download(itemlist, item)

        elif defp and inspect.stack()[1][3] not in [
                'get_seasons'
        ] and not item.disable_pagination:
            if Pagination and len(itemlist) >= Pagination:
                if inspect.stack()[1][3] != 'get_newest':
                    item.title = support.typo(
                        config.get_localized_string(30992), 'color kod bold')
                    item.page = pag + 1
                    item.thumbnail = support.thumb()
                    itemlist.append(item)

        if inspect.stack()[1][3] not in ['get_seasons'] and not show_seasons:
            support.videolibrary(itemlist, item)
            support.download(itemlist, item)
    return itemlist
Пример #9
0
def findvideos(item):
    support.log("ITEM ---->", item)
    itemlist = []

    data = httptools.downloadpage(item.url).data
    data = re.sub(r'\n|\t', ' ', data)
    data = re.sub(r'>\s\s*<', '><', data)
    patronBlock = r'LINK STREAMING(?P<block>.*?)LINK DOWNLOAD'
    patron = r'href="(.+?)"'
    block = scrapertools.find_single_match(data, patronBlock)
    urls = scrapertools.find_multiple_matches(block, patron)
    #support.regexDbg(item, patron, headers, data=data)

    for url in urls:
        titles = item.infoLabels['title']
        lang = ''
        if 'sub_ita' in url.lower():
            lang = 'Sub-ITA'
        else:
            lang = 'ITA'

        if 'keepem.online' in data:
            urls = scrapertools.find_multiple_matches(
                data, r'(https://keepem\.online/f/[^"]+)"')
            for url in urls:
                url = httptools.downloadpage(url).url
                itemlist += servertools.find_video_items(data=url)

        elif 'keepsetsu' in url.lower() or 'woof' in url.lower():
            if 'keepsetsu' in url.lower():
                support.log("keepsetsu url -> ", url)
                data = httptools.downloadpage(url).url
                support.log("LINK-DATA :", data)

            data = httptools.downloadpage(data).data
            support.log("LINK-DATA2 :", data)
            video_urls = scrapertools.find_single_match(
                data, r'<meta name="description" content="([^"]+)"')

        else:

            data = httptools.downloadpage(url).data
            #host_video = scrapertools.find_single_match(data, r'var thisPageUrl = "(http[s]\:\/\/[^\/]+).+?"')
            host_video = scrapertools.find_single_match(
                data, r'(?:let|var) thisPageUrl = "(http[s]\:\/\/[^\/]+).+?"')
            link = scrapertools.find_single_match(data,
                                                  r'<video src="([^"]+)"')
            video_urls = host_video + link

        title_show = support.typo(titles, '_ bold') + support.typo(
            lang, '_ [] color kod')

        itemlist.append(
            support.Item(
                channel=item.channel,
                action="play",
                contentType=item.contentType,
                title=title_show,
                fulltitle=item.fulltitle,
                show=item.fulltitle,
                url=link if 'http' in link else video_urls,
                infoLabels=item.infoLabels,
                thumbnail=item.thumbnail,
                contentSerieName=item.fulltitle,
                contentTitle=title_show,
                contentLanguage='ITA' if lang == [] else lang,
                args=item.args,
                server='directo',
            ))

    if item.contentType != 'episode' and int(item.nep) < 2:
        # Link Aggiungi alla Libreria
        if config.get_videolibrary_support(
        ) and len(itemlist) > 0 and item.extra != 'findservers':
            support.videolibrary(itemlist, item)
    # link per scaricare
    if config.get_setting('downloadenabled'):
        support.download(itemlist, item)
    return itemlist