示例#1
0
def peliculas(item):
    itemlist = []
    if not item.args:
        json_file =loadjs(item.url + 'channel/10005/last/')
        support.logger.debug(json_file)
        make_itemlist(itemlist, item, json_file)

    elif ('=' not in item.args) and ('=' not in item.url):
        json_file=loadjs(item.url + item.args)
        make_itemlist(itemlist, item, json_file)

    elif '=' in item.args:
        json_file = current_session.get(item.url + 'channels', headers=headers, params=payload).json()
        Filter = support.match(item.args, patron=r'\?([^=]+)=').match
        keys = [i[Filter] for i in json_file['data'] if Filter in i][0]
        for key in keys:
            if key not in ['1','2']:
                itemlist.append(
                    item.clone(title = support.typo(key.upper() if Filter == 'filter' else key['name'], 'bold'),
                               url =  item.url + item.args + (key if Filter == 'filter' else str(key['id'])),
                               action = 'peliculas',
                               args = 'filters'))

    else :
        json_file=loadjs(item.url)
        make_itemlist(itemlist, item, json_file)
    if 'category' in item.args:
        support.thumb(itemlist,genre=True)
    elif not 'filter' in item.args:
        if item.contentType != 'movie': autorenumber.renumber(itemlist)
        tmdb.set_infoLabels_itemlist(itemlist, seekTmdb=True)
    return itemlist
示例#2
0
def peliculas(item):
    support.info()
    itemlist = []

    page = item.page if item.page else 0
    item.args['offset'] = page * 30

    order = support.config.get_setting('order', item.channel)
    if order:
        order_list = [ "Standard", "Lista A-Z", "Lista Z-A", "Popolarità", "Valutazione" ]
        item.args['order'] = order_list[order]

    payload = json.dumps(item.args)
    records = requests.post(host + '/archivio/get-animes', headers=headers, data=payload).json()['records']
    # js = []
    # support.info(records)
    # for record in records:
    #     js += record
    for it in records:
        lang = support.match(it['title'], patron=r'\(([It][Tt][Aa])\)').match
        title = support.re.sub(r'\s*\([^\)]+\)', '', it['title'])

        if 'ita' in lang.lower(): language = 'ITA'
        else: language = 'Sub-ITA'

        itm = item.clone(title=support.typo(title,'bold') + support.typo(language,'_ [] color kod') + (support.typo(it['title_eng'],'_ ()') if it['title_eng'] else ''))
        itm.contentLanguage = language
        itm.type = it['type']
        itm.thumbnail = it['imageurl']
        itm.plot = it['plot']

        if it['episodes_count'] == 1:
            itm.contentType = 'movie'
            itm.fulltitle = itm.show = itm.contentTitle = title
            itm.contentSerieName = ''
            itm.action = 'findvideos'
            itm.url = it['episodes'][0]['link']

        else:
            itm.contentType = 'tvshow'
            itm.contentTitle = ''
            itm.fulltitle = itm.show = itm.contentSerieName = title
            itm.action = 'episodios'
            itm.episodes = it['episodes'] if 'episodes' in it else it['link']
            itm.url = ''

        itemlist.append(itm)

    autorenumber.renumber(itemlist)
    if len(itemlist) >= 30:
        itemlist.append(item.clone(title=support.typo(support.config.get_localized_string(30992), 'color kod bold'), thumbnail=support.thumb(), page=page + 1))

    return itemlist
示例#3
0
def episodios(item):
    def load_more(url):
        second_url = host if url.startswith('/') else '' + url.replace('\u002F','/').replace('%5C','/')
        new_data = support.match(host + second_url).data
        match = support.scrapertools.decodeHtmlentities(support.match(new_data, headers=headers, patron=r'"items":([^\]]+])').match.replace('\x01','l').replace('\x02','a'))
        return jsontools.load(match)

    itemlist = []
    data = []
    page_data = support.match(item.url).data
    seasons = support.match(page_data, patron=r'href="([^"]+)"[^>]+>Stagione\s*\d+').matches
    more = support.match(page_data, patron=r'loadingTitle":[^,]+,"url":"([^"]+)"').match
    data = jsontools.load(support.scrapertools.decodeHtmlentities(support.match(page_data, patron=r'"isEpisodes":[^,]+,"items":(.*?),"as"').match))

    if data:
        if more:
            data += load_more(more)
        if seasons:
            for url in seasons:
                new_data = support.match(host + url).data
                data += jsontools.load(support.scrapertools.decodeHtmlentities(support.match(new_data, patron=r'isEpisodes":[^,]+,"items":(.*?),"as"').match.replace('\x01','l').replace('\x02','a')))
                match = support.match(new_data, patron=r'loadingTitle":[^,]+,"url":"([^"]+)"').match
                if match and match != load_more:
                    data += load_more(match)

        for it in data:
            if 'text' in it['meta']['header']['title']:
                se = it['meta']['header']['title']['text']
                s = support.match(se, patron=r'S\s*(?P<season>\d+)').match
                e = support.match(se, patron=r'E\s*(?P<episode>\d+)').match
                if not e: e = support.match(it['meta']['subHeader'], patron=r'(\d+)').match
                title = support.typo((s + 'x' if s else 'Episodio ') + e.zfill(2) + ' - ' + it['meta']['subHeader'],'bold')
            else:
                s = e = '0'
                title = support.typo(it['meta']['header']['title'],'bold')
            itemlist.append(
                item.clone(title=title,
                        season=int(s) if s else '',
                        episode=int(e),
                        url=host + it['url'] if it['url'].startswith('/') else it['url'],
                        thumbnail=it['media']['image']['url'],
                        fanart=it['media']['image']['url'],
                        plot=it['meta']['description'],
                        contentType='episode',
                        action='findvideos'))

    itemlist.sort(key=lambda item: (item.season, item.episode))
    autorenumber.renumber(itemlist, item, 'bold')
    return support.videolibrary(itemlist, item)
示例#4
0
def peliculas(item):
    itemlist = []
    if item.contentType == 'movie':
        Type = 'Movie'
        action = 'findvideos'
    else:
        Type = 'Series'
        action = 'episodios'
    if not item.page: item.page = 1
    pagination_values = [20, 40, 60, 80, 100]
    pagination = pagination_values[support.config.get_setting('pagination','paramount')]
    item.url = host + '/api/search?activeTab=' + Type + '&searchFilter=site&pageNumber=0&rowsPerPage=10000'
    data = jsontools.load(support.match(item).data)['response']['items']

    for it in data:
        title = it['meta']['header']['title']
        support.info(title, it)
        d = it['meta']['date'].split('/') if it['meta']['date'] else ['0000','00','00']
        date = int(d[2] + d[1] + d[0])
        if item.search.lower() in title.lower() \
            and 'stagione' not in it['url'] \
            and 'season' not in it['url'] \
            and title not in ['Serie TV']:
            itemlist.append(
                item.clone(title=support.typo(title,'bold'),
                           action=action,
                           fulltitle=title,
                           show=title,
                           contentTitle=title if it['type'] == 'movie' else '',
                           contentSerieName=title if it['type'] != 'movie' else '',
                           plot= it['meta']['description'] if 'description' in it['meta'] else '',
                           url=host + it['url'],
                           date=date,
                           thumbnail='https:' + it['media']['image']['url'] if 'url' in it['media']['image'] else item.thumbnail))
    itemlist.sort(key=lambda item: item.fulltitle)
    if not item.search:
        itlist = []
        for i, it in enumerate(itemlist):
            if pagination and (item.page - 1) * pagination > i and not item.search: continue  # pagination
            if pagination and i >= item.page * pagination and not item.search: break          # pagination
            itlist.append(it)
        if pagination and len(itemlist) >= item.page * pagination and not item.search:
            itlist.append(item.clone(channel=item.channel, action = 'peliculas', title=support.typo(support.config.get_localized_string(30992), 'color kod bold'), page=item.page + 1, thumbnail=support.thumb()))
        itemlist = itlist
    autorenumber.renumber(itemlist, item, 'bold')
    return itemlist
示例#5
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.renumber(itemlist, item, 'bold')
    support.videolibrary(itemlist, item)
    support.download(itemlist, item)
    return itemlist
示例#6
0
def episodios(item):
    itemlist = []
    json_file = current_session.get(item.url, headers=headers, params=payload).json()
    show_id = str(json_file['data'][0]['show_id'])
    season_id = str(json_file['data'][0]['season_id'])
    episodes = []
    support.info('SEASON ID= ',season_id)
    for episode in json_file['data']:
        episodes.append(episode['episodes'])
    for episode in episodes:
        for key in episode:
            if 'stagione' in encode(key['title']).lower():
                season = support.match(encode(key['title']), patron=r'[Ss]tagione\s*(\d+)').match
                episode = support.match(encode(key['title']), patron=r'[Ee]pisodio\s*(\d+)').match
                if season and episode:
                    title = season + 'x' + episode + ' - ' + item.fulltitle
                make_item = True
            elif int(key['season_id']) == int(season_id):
                try:
                    title = 'Episodio ' + key['number'] + ' - ' + key['title'].encode('utf8')
                except:
                    title = 'Episodio ' + key['number'] + ' - ' + key['title']
                make_item = True
            else:
                make_item = False
            if make_item == True:
                if type(title) == tuple: title = title[0]
                itemlist.append(
                    item.clone(title = title,
                               url=  host + show_id + '/season/' + str(key['season_id']) + '/',
                               action= 'findvideos',
                               video_id= key['video_id']))
    autorenumber.renumber(itemlist, item, 'bold')
    if autorenumber.check(item) == True \
        or support.match(itemlist[0].title, patron=r"(\d+x\d+)").match:
        support.videolibrary(itemlist,item)
    return itemlist