def peliculas(item): log() itemlist = [] blacklist = ['top 10 anime da vedere'] matches, data = support.match(item, r'<a class="[^"]+" href="([^"]+)" title="([^"]+)"><img[^s]+src="([^"]+)"[^>]+') for url, title, thumb in matches: title = scrapertoolsV2.decodeHtmlentities(title.strip()).replace("streaming", "") lang = scrapertoolsV2.find_single_match(title, r"((?:SUB ITA|ITA))") videoType = '' if 'movie' in title.lower(): videoType = ' - (MOVIE)' if 'ova' in title.lower(): videoType = ' - (OAV)' cleantitle = title.replace(lang, "").replace('(Streaming & Download)', '').replace('( Streaming & Download )', '').replace('OAV', '').replace('OVA', '').replace('MOVIE', '').strip() if not videoType : contentType="tvshow" action="episodios" else: contentType="movie" action="findvideos" if not title.lower() in blacklist: itemlist.append( Item(channel=item.channel, action=action, contentType=contentType, title=support.typo(cleantitle + videoType, 'bold') + support.typo(lang,'_ [] color kod'), fulltitle=cleantitle, show=cleantitle, url=url, thumbnail=thumb)) tmdb.set_infoLabels_itemlist(itemlist, seekTmdb=True) autorenumber.renumber(itemlist) support.nextPage(itemlist, item, data, r'<a class="next page-numbers" href="([^"]+)">') return itemlist
def findvideos(item): support.log('findvideos ->', item) itemlist = [] patronBlock = '<div class="entry-content">(?P<block>.*)<footer class="entry-footer">' patron = r'<a href="([^"]+)">' html = support.match(item, patron=patron, patronBlock=patronBlock, headers=headers) matches = html.matches data = html.data if item.args != 'episodios': item.infoLabels['mediatype'] = 'episode' for scrapedurl in matches: if 'is.gd' in scrapedurl: resp = httptools.downloadpage(scrapedurl, follow_redirects=False) data += resp.headers.get("location", "") + '\n' itemlist += support.server(item, data) data = support.match(item.url).data patron = r'>Posted in <a href="https?://fastsubita.com/serietv/([^/]+)/(?:[^"]+)?"' series = scrapertools.find_single_match(data, patron) titles = support.typo(series.upper().replace('-', ' '), 'bold color kod') goseries = support.typo("Vai alla Serie:", ' bold color kod') itemlist.append( Item( channel=item.channel, title=goseries + titles, fulltitle=titles, show=series, contentType='tvshow', contentSerieName=series, url=host + "/serietv/" + series, action='episodios', contentTitle=titles, plot="Vai alla Serie " + titles + " con tutte le puntate", )) return itemlist
def discover_list(item): from platformcode import unify itemlist = [] result = tmdb.discovery(item) tvshow = False logger.debug(item) for elem in result: elem['tmdb_id'] = elem['id'] if 'title' in elem: title = unify.normalize(elem['title']).capitalize() elem['year'] = scrapertools.find_single_match( elem['release_date'], '(\d{4})-\d+-\d+') else: title = unify.normalize(elem['name']).capitalize() tvshow = True new_item = Item(channel='search', title=title, infoLabels=elem, action='do_search', extra=title, category=config.get_localized_string(70695), context='') if tvshow: new_item.contentSerieName = title else: new_item.contentTitle = title itemlist.append(new_item) tmdb.set_infoLabels_itemlist(itemlist, seekTmdb=True) if item.page != '' and len(itemlist) > 0: next_page = str(int(item.page) + 1) #if not 'similar' in item.list_type: # itemlist.append(item.clone(title='Pagina Siguente', page=next_page)) #else: itemlist.append( Item(channel=item.channel, action='discover_list', title=typo(config.get_localized_string(30992), 'color kod bold'), search_type=item.search_type, list_type=item.list_type, type=item.type, page=next_page)) return itemlist
def renumber(self): if not self.item.renumber and self.itemlist: for item in self.itemlist: if not match(item.title, patron=r'[Ss]?(\d+)(?:x|_|\s+)[Ee]?[Pp]?(\d+)').match: number = match(item.title, patron=r'(\d+)').match.lstrip('0') if number: if not number in self.episodes: self.makelist() item.title = '{} - {}'.format(typo(self.episodes[number], 'bold'), item.title) item.contentSeason = int(self.episodes[number].split('x')[0]) item.contentEpisodeNumber = int(self.episodes[number].split('x')[1]) else: self.makelist()
def renumber(self): if not self.item.renumber and self.itemlist: if '|' in self.Season: season = int(self.Season.split('|')[0]) addNumber = int(self.Season.split('|')[-1]) - 1 else: season = int(self.Season) addNumber = 0 for item in self.itemlist: if not match(item.title, patron=r'[Ss]?(\d+)(?:x|_|\s+)[Ee]?[Pp]?(\d+)').match: number = match(item.title, patron=r'(\d+)').match.lstrip('0') if number: if number in self.Episodes: if season > 0: item.title = typo(self.Episodes[number] + ' - ', 'bold') + item.title else: item.title = typo('0x%s - ' % str(int(number) + addNumber), 'bold') + item.title else: self.makelist() if season > 0: item.title = typo(self.Episodes[number] + ' - ', 'bold') + item.title else: item.title = typo('0x%s - ' % str(int(number) + addNumber), 'bold') + item.title else: self.makelist()
def years(item): support.info() itemlist = [] from datetime import datetime current_year = datetime.today().year oldest_year = int(support.match(response.text, patron='anime_oldest_date="([^"]+)').match) for year in list(reversed(range(oldest_year, current_year + 1))): item.args['year']=year itemlist.append(item.clone(title=support.typo(year,'bold'), action='peliculas')) return itemlist
def dirette(item): support.log() itemlist = [] json = current_session.get(item.url).json()['dirette'] onAir = current_session.get(onair).json()['on_air'] for i, key in enumerate(json): itemlist.append( support.Item( channel=item.channel, title=support.typo(key['channel'], 'bold'), fulltitle=key['channel'], show=key['channel'], thumbnail=key['transparent-icon'].replace( "[RESOLUTION]", "256x-"), forcethumb=True, fanart=getUrl(onAir[i]['currentItem']['image']), url=key['video']['contentUrl'], plot=support.typo(onAir[i]['currentItem']['name'], 'bold') + '\n\n' + onAir[i]['currentItem']['description'], action='play')) return itemlist
def itemHook(item): if 'sub-ita' in item.url: if item.args != 'newest': item.title = item.title + support.typo('Sub-ITA', '_ [] color kod') item.contentLanguage = 'Sub-ITA' if item.args == 'newest': url = support.match( item, '<a href="([^"]+)" title="[^"]+" target="[^"]+" class="btn', headers=headers)[0] item.url = url[0] if url else '' delete = support.scrapertools.find_single_match( item.fulltitle, r'( Episodi.*)') episode = support.scrapertools.find_single_match( item.title, r'Episodi(?:o)? (?:\d+÷)?(\d+)') item.title = support.typo(episode + ' - ', 'bold') + item.title.replace(delete, '') item.fulltitle = item.show = item.title.replace(delete, '') item.episode = episode return item
def itInfo(n, key, item): logger.debug() item.forcethumb = True episode = 0 season = 0 if key.get('titolo', ''): key = requests.get(getUrl(key['path_id'])).json()['program_info'] info = requests.get(getUrl( key['info_url'])).json() if 'info_url' in key else {} details = info.get('details', {}) for detail in details: if detail['key'] == 'season': s = scrapertools.find_single_match(detail['value'], '(\d+)') if s: season = int(s) if detail['key'] == 'episode': e = scrapertools.find_single_match(detail['value'], '(\d+)') if e: episode = int(e) images = info.get('images', {}) fanart = images.get('landscape', '') thumb = images.get('portrait_logo', '') if not thumb: thumb = fanart title = key.get('name', '') if key.get('episode_title'): title = key.get('episode_title') if episode: title = '{:02d}. {}'.format(episode, title) if season: title = '{}x{}'.format(season, title) it = item.clone(title=support.typo(title, 'bold'), data='', fulltitle=title, show=title, thumbnail=getUrl(thumb), fanart=getUrl(fanart), url=getUrl(key.get('weblink', '')), video_url=getUrl(key['path_id']), season=season, episode=episode, plot=info.get('description', ''), order=n) if 'Genere' not in key.get('sub_type', '') and ('layout' not in key or key['layout'] == 'single'): it.action = 'findvideos' it.contentTitle = it.fulltitle else: it.action = 'episodios' it.contentSerieName = it.fulltitle return it
def itemlistHook(itemlist): itemlist.pop(0) itemlist.append( support.Item(channel=item.channel, title=support.typo('Cerca...', 'bold color kod'), contentType='music', url=item.url, action='search', thumbnail=support.thumb('search'))) support.channel_config(item, itemlist) return itemlist
def mainlist(item): itemlist = [] item.action = 'peliculas' js = httptools.downloadpage(api_url.format('brands')).json for it in js.get('features', []): itemlist.append( item.clone(url='{}/{}'.format(host, it.get('canonical_url', '')), title=support.typo(it['name'], 'italic') + support.typo(it.get('channels', ''), '_ [] color kod'))) for it in js.get('brands', []): itemlist.append( item.clone(url='{}/{}'.format(host, it.get('canonical_url', '')), title=support.typo(it['name'], 'bullet bold') + support.typo(it.get('channels', ''), '_ [] color kod'))) itemlist.append( item.clone(title=support.typo('Cerca...', 'bold color kod'), action='search', thumbnail=support.thumb('search'))) support.channel_config(item, itemlist) return itemlist
def epmenu(item): support.info() itemlist = [] entries = current_session.get('https://feed.entertainment.tv.theplatform.eu/f/PR1GhC/mediaset-prod-all-brands?byCustomValue={brandId}{' + item.urls + '}').json()['entries'] for entry in entries: if 'mediasetprogram$subBrandId' in entry: itemlist.append( item.clone(action='episodios', title=support.typo(entry['description'], 'bold'), url=entry['mediasetprogram$subBrandId'])) if len(itemlist) == 1: return episodios(itemlist[0]) return itemlist
def learning(item): support.info() itemlist = [] json = current_session.get(item.url).json()['contents'] for key in json: itemlist.append( item.clone(title=support.typo(key['name'], 'bold'), fulltitle=key['name'], show=key['name'], url=key['contents'], action='peliculas')) return itemlist
def itemHook(item): item.contentType = 'episode' delete = support.scrapertoolsV2.find_single_match( item.fulltitle, r'( Episodio.*)') number = support.scrapertoolsV2.find_single_match( item.title, r'Episodio (\d+)') item.title = support.typo(number + ' - ', 'bold') + item.title.replace(delete, '') item.fulltitle = item.show = item.title.replace(delete, '') item.url = item.url.replace('-episodio-' + number, '') item.number = number return item
def replay(item): support.log() itemlist = [] json = current_session.get( item.url).json()[item.fulltitle][0]['palinsesto'][0]['programmi'] for key in json: support.log('KEY=', key) if key and key['pathID']: itemlist.append( support.Item(channel=item.channel, thumbnail=getUrl(key['images']['landscape']), fanart=getUrl(key['images']['landscape']), url=getUrl(key['pathID']), title=support.typo(key['timePublished'], 'color kod bold') + support.typo(' | ' + key['name'], ' bold'), fulltitle=key['name'], show=key['name'], plot=key['testoBreve'], action='findvideos')) return itemlist
def menu(item): support.info() itemlist = [ item.clone(title=support.typo(item.args[0], 'bullet bold'), url='', action='peliculas') ] if item.url: json = get_from_id(item) for it in json: if 'uxReference' in it: itemlist.append( item.clone(title=support.typo(it['title'], 'submenu'), url=it['uxReference'], args='', action='peliculas')) itemlist.append( item.clone(title=support.typo('Cerca...', 'submenu bold'), url='', action='search')) return itemlist
def search_movie_by_genre(item): support.info() itemlist = [] data = support.match(item.url, headers=headers).data json_object = jsontools.load(data) for genre in json_object['hydra:member']: itemlist.append( item.clone(action="peliculas", title=support.typo(genre['name'],'bold'), contentType='movie', url="%s/api/movies?genres.id=%s" %(host,genre['id']))) return support.thumb(itemlist, True)
def episodios(item): support.info() itemlist = [] if type(item.url) in [list, dict] and len(item.url) > 1 and ('name' in item.url[0] and 'stagione' not in item.url[0]['name'].lower()): for key in item.url: itemlist.append(item.clone(title = support.typo(key['name'], 'bold'), url = getUrl(key['path_id']), contentType = 'tvshow', action = 'episodios')) elif type(item.url) in [list, dict]: with futures.ThreadPoolExecutor() as executor: itlist = [executor.submit(load_episodes, key, item) for key in item.url] for res in futures.as_completed(itlist): if res.result(): itemlist += res.result() if itemlist and itemlist[0].VL: # itemlist.reverse() itemlist = sorted(itemlist, key=lambda it: it.order) support.videolibrary(itemlist, item) else: itemlist = sorted(itemlist, key=lambda it: it.title) else: if type(item.url) in [list, dict]: item.url = getUrl(item.url[0]['path_id']) json = current_session.get(item.url).json()['items'] for key in json: ep = support.match(key['subtitle'], patron=r'(?:St\s*(\d+))?\s*Ep\s*(\d+)').match if ep: season = '1' if not ep[0] else ep[0] episode = ep[1].zfill(2) title = support.re.sub(r'(?:St\s*\d+)?\s*Ep\s*\d+','',key['subtitle']) title = season + 'x' + episode + (' - ' + title if not title.startswith(' ') else title if title else '') else: title = key['subtitle'].strip() # title = key['subtitle'].strip() if not title: title = key['name'] itemlist.append(item.clone(title = support.typo(title, 'bold'), action = 'findvideos', VL=True if ep else False, plot = key['description'], fanart = getUrl(key['images']['landscape']), url = key['video_url'], contentType = 'episode')) if itemlist and itemlist[0].VL: support.videolibrary(itemlist, item) return itemlist
def get_title(item): support.log("ITEM NEWEST ->", item) if item.contentSerieName: # Si es una serie title = item.contentSerieName #title = re.compile("\[.*?\]", re.DOTALL).sub("", item.contentSerieName) if not scrapertools.get_season_and_episode( title) and item.contentEpisodeNumber: if not item.contentSeason: item.contentSeason = '1' title = "%s - %sx%s" % (title, item.contentSeason, str(item.contentEpisodeNumber).zfill(2)) elif item.contentTitle: # Si es una pelicula con el canal adaptado title = item.contentTitle elif item.fulltitle: # Si el canal no esta adaptado title = item.fulltitle else: # Como ultimo recurso title = item.title # Limpiamos el titulo de etiquetas de formato anteriores ## title = re.compile("\[/*COLO.*?\]", re.DOTALL).sub("", title) ## title = re.compile("\[/*B\]", re.DOTALL).sub("", title) ## title = re.compile("\[/*I\]", re.DOTALL).sub("", title) title = '[B]' + title + '[/B]' if item.contentLanguage == '': pass elif type(item.contentLanguage) == list and len(item.contentLanguage) == 1: title += support.typo(item.contentLanguage[0], '_ [] color kod') elif type(item.contentLanguage) != '': title += support.typo(item.contentLanguage, '_ [] color kod') elif type(item.contentLanguage) == list: title += item.contentLanguage if item.quality: title += support.typo(item.quality, '_ [] color kod') return title
def __init__(self, itemlist, item=None): self.item = item self.itemlist = itemlist self.auto = False self.dictSeries = load( self.itemlist[0]) if self.itemlist else load(item) if item else {} self.Episodes = {} self.sp = False if self.item: self.auto = config.get_setting('autorenumber', item.channel) self.title = self.item.fulltitle.strip() if match(self.itemlist[0].title, patron=r'[Ss]?(\d+)(?:x|_|\s+)[Ee]?[Pp]?(\d+)').match: item.exit = True return elif self.item.channel in self.item.channel_prefs and TVSHOW_RENUMERATE in self.item.channel_prefs[ item.channel] and self.title not in self.dictSeries: from core.videolibrarytools import check_renumber_options from specials.videolibrary import update_videolibrary check_renumber_options(self.item) update_videolibrary(self.item) if self.title in self.dictSeries and ID in self.dictSeries[ self.title] and self.dictSeries[self.title][ID] != '0': self.id = self.dictSeries[self.title][ID] self.Episodes = b64(self.dictSeries[self.title][EPISODE], 'decode') if EPISODE in self.dictSeries[ self.title] else {} self.Season = self.dictSeries[self.title][SEASON] self.Mode = self.dictSeries[self.title].get(MODE, False) self.Type = self.dictSeries[self.title].get(TYPE, False) if self.item.renumber: self.config() else: self.renumber() elif self.auto or self.item.renumber: self.Episodes = {} self.config() else: for item in self.itemlist: item.context = [{ "title": typo(config.get_localized_string(70585), 'bold'), "action": "start", "channel": "autorenumber", "from_channel": item.channel, "from_action": item.action }]
def episodios(item): log() itemlist = [] if item.args == 'anime': return anime(item) data = httptools.downloadpage(item.url).data # Check if is series check = scrapertoolsV2.find_single_match( data.replace('\t', '').replace('\n', ''), r'<div class="category-film"><h3>([^<]+)<\/h3>') if 'serie tv' not in check.lower(): return findvideos(item) elif 'anime' in check.lower(): return findvideos(item) patron = r'<iframe src="([^"]+)" scrolling="no" frameborder="0" width="626" height="550" allowfullscreen="true" webkitallowfullscreen="true" mozallowfullscreen="true">' url = scrapertoolsV2.find_single_match(data, patron) log('URL =', url) seasons = support.match( item, r'<a href="([^"]+)"\s*>\s*<i[^>]+><\/i>\s*(\d+)<\/a>', r'Stagioni<\/a>.*?<ul class="nav navbar-nav">(.*?)<\/ul>', headers=headers, url=url)[0] for season_url, season in seasons: season_url = urlparse.urljoin(url, season_url) episodes = support.match( item, r'<a href="([^"]+)"\s*>\s*<i[^>]+><\/i>\s*(\d+)<\/a>', r'Episodio<\/a>.*?<ul class="nav navbar-nav">(.*?)<\/ul>', headers=headers, url=season_url)[0] for episode_url, episode in episodes: episode_url = urlparse.urljoin(url, episode_url) title = season + "x" + episode.zfill(2) itemlist.append( Item(channel=item.channel, action="findvideos", contentType=item.contentType, title=support.typo(title + ' - ' + item.fulltitle, 'bold'), url=episode_url, fulltitle=title + ' - ' + item.show, show=item.show, thumbnail=item.thumbnail)) support.videolibrary(itemlist, item, 'color kod bold') return itemlist
def last(item): support.log() itemlist = [] infoLabels = {} quality = '' PERPAGE = 20 page = 1 if item.page: page = item.page if item.contentType == 'tvshow': matches = support.match(item, r'<a href="([^">]+)".*?>([^(:(|[)]+)([^<]+)<\/a>', '<article class="sequex-post-content.*?</article>', headers)[0] else: matches = support.match(item, r'<a href=([^>]+)>([^(:(|[)]+)([^<]+)<\/a>', r'<strong>Ultimi 100 film Aggiornati:<\/a><\/strong>(.*?)<td>', headers)[0] for i, (url, title, info) in enumerate(matches): if (page - 1) * PERPAGE > i: continue if i >= page * PERPAGE: break add = True title = title.rstrip() if item.contentType == 'tvshow': for i in itemlist: if i.url == url: # togliamo i doppi add = False else: infoLabels['year'] = scrapertoolsV2.find_single_match(info, r'\(([0-9]+)\)') quality = scrapertoolsV2.find_single_match(info, r'\[([A-Z]+)\]') if quality: longtitle = title + support.typo(quality,'_ [] color kod') else: longtitle = title if add: itemlist.append( Item(channel=item.channel, action='findvideos' if item.contentType == 'movie' else 'episodios', contentType=item.contentType, title=longtitle, fulltitle=title, show=title, quality=quality, url=url, infoLabels=infoLabels ) ) support.pagination(itemlist, item, page, PERPAGE) tmdb.set_infoLabels_itemlist(itemlist, seekTmdb=True) return itemlist
def episodios(item): ## import web_pdb; web_pdb.set_trace() support.log("episodios") itemlist = [] # Carica la pagina data = httptools.downloadpage(item.url).data #======== if 'clicca qui per aprire' in data.lower(): item.url = scrapertoolsV2.find_single_match(data, '"go_to":"([^"]+)"') item.url = item.url.replace("\\", "") # Carica la pagina data = httptools.downloadpage(item.url).data elif 'clicca qui</span>' in data.lower(): item.url = scrapertoolsV2.find_single_match( data, '<h2 style="text-align: center;"><a href="([^"]+)">') # Carica la pagina data = httptools.downloadpage(item.url).data #========= patron = r'(?:<\/span>\w+ STAGIONE\s\d+ (?:\()?(ITA|SUB ITA)(?:\))?<\/div>'\ '<div class="su-spoiler-content su-clearfix" style="display:none">|'\ '(?:\s|\Wn)?(?:<strong>)?(\d+&#.*?)(?:|–)?<a\s(.*?)<\/a><br\s\/>)' ## '(?:<\/span>\w+ STAGIONE\s\d+ (?:\()?(ITA|SUB ITA)(?:\))?'\ ## '<\/div><div class="su-spoiler-content su-clearfix" style="display:none">|'\ ## '(?:\s|\Wn)?(?:<strong>)?(\d[&#].*?)(?:–|\W)?<a\s(.*?)<\/a><br\s\/>)' ## '(?:<\/span>\w+ STAGIONE\s\d+ (?:\()?(ITA|SUB ITA)(?:\))?<\/div>'\ ## '<div class="su-spoiler-content su-clearfix" style="display:none">|'\ ## '\s(?:<strong>)?(\d[&#].*?)–<a\s(.*?)<\/a><br\s\/>)' listGroups = ['lang', 'title', 'url'] itemlist = support.scrape(item, data=data, patron=patron, listGroups=listGroups, action='findvideos') # Permette la configurazione della videoteca senza andare nel menu apposito # così si possono Attivare/Disattivare le impostazioni direttamente dalla # pagina delle puntate itemlist.append( Item( channel='setting', action="channel_config", title=support.typo("Configurazione Videoteca color lime"), plot= 'Filtra per lingua utilizzando la configurazione della videoteca.\ Escludi i video in sub attivando "Escludi streams... " e aggiungendo sub in Parole', config='videolibrary', #item.channel, folder=False, thumbnail=channelselector.get_thumb('setting_0.png'))) itemlist = filtertools.get_links(itemlist, item, list_language) return itemlist
def peliculas(item): itemlist = [] if not item.args: json_file = current_session.get(item.url + 'channels', headers=headers, params=payload).json() names = [i['filter'] for i in json_file['data'] if 'filter' in i][0] for name in names: url = item.url + 'channel/10003/last/?filter=' + str(name) json_file = current_session.get(url, headers=headers, params=payload).json() if 'data' in json_file: json_file = current_session.get(url, headers=headers, params=payload).json() make_itemlist(itemlist, item, json_file) elif ('=' not in item.args) and ('=' not in item.url): json_file = current_session.get(item.url + item.args, headers=headers, params=payload).json() 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, r'\?([^=]+)=')[0][0] 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( channel=item.channel, 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', contentType=item.contentType)) else: json_file = current_session.get(item.url, headers=headers, params=payload).json() make_itemlist(itemlist, item, json_file) if item.contentType != 'movie': autorenumber.renumber(itemlist) tmdb.set_infoLabels_itemlist(itemlist, seekTmdb=True) return itemlist
def findvideos(item): support.log() if item.contentType == 'movie': return support.server(item, headers=headers) else: if item.args != 'update': return support.server(item, item.url) else: itemlist = [] item.infoLabels['mediatype'] = 'episode' data = httptools.downloadpage(item.url, headers=headers).data data = re.sub('\n|\t', ' ', data) data = re.sub(r'>\s+<', '> <', data) #support.log("DATA - HTML:\n", data) url_video = scrapertools.find_single_match( data, r'<tr><td>(.+?)</td><tr>', -1) url_serie = scrapertools.find_single_match( data, r'<link rel="canonical" href="([^"]+)"\s?/>') goseries = support.typo("Vai alla Serie:", ' bold') series = support.typo(item.contentSerieName, ' bold color kod') itemlist = support.server(item, data=url_video) itemlist.append( Item( channel=item.channel, title=goseries + series, fulltitle=item.fulltitle, show=item.show, contentType='tvshow', contentSerieName=item.contentSerieName, url=url_serie, action='episodios', contentTitle=item.contentSerieName, plot=goseries + series + "con tutte le puntate", )) return itemlist
def get_season(item, seas_url, seasonNumber): support.info() itemlist = [] data = support.match(seas_url, headers=headers).data json_object = jsontools.load(data) for episode in json_object['hydra:member']: itemlist.append( item.clone(action='findvideos', contentType='episode', title=support.typo(str(seasonNumber)+"x"+str("%02d"%episode['episodeNumber']), 'bold'), url=seas_url, extra=str(len(json_object['hydra:member'])-episode['episodeNumber']))) return itemlist[::-1]
def itemlistHook(itemlist): if item.nextpage: item.nextpage += 1 else: item.nextpage = 2 if page and item.nextpage < int(page): itemlist.append( item.clone(title=support.typo( support.config.get_localized_string(30992), 'color kod bold'), url='{}&page={}'.format( item.url, item.nextpage), infoLabels={}, thumbnail=support.thumb())) return itemlist
def mainlist(item): logger.debug() if config.get_setting('new_search'): itemlist = [Item(channel='globalsearch', title=config.get_localized_string(70276), action='Search', mode='all', thumbnail=get_thumb("search.png"), folder=False), Item(channel='globalsearch', title=config.get_localized_string(70741) % config.get_localized_string(30122), action='Search', mode='movie', thumbnail=get_thumb("search_movie.png"),folder=False), Item(channel='globalsearch', title=config.get_localized_string(70741) % config.get_localized_string(30123), action='Search', mode='tvshow', thumbnail=get_thumb("search_tvshow.png"), folder=False), Item(channel='globalsearch', title=config.get_localized_string(70741) % config.get_localized_string(70314), action='Search', page=1, mode='person', thumbnail=get_thumb("search_star.png"), folder=False)] else: itemlist = [Item(channel=item.channel, title=config.get_localized_string(70276), action='new_search', mode='all', thumbnail=get_thumb("search.png")), Item(channel=item.channel, title=config.get_localized_string(70741) % config.get_localized_string(30122), action='new_search', mode='movie', thumbnail=get_thumb("search_movie.png")), Item(channel=item.channel, title=config.get_localized_string(70741) % config.get_localized_string(30123), action='new_search', mode='tvshow', thumbnail=get_thumb("search_tvshow.png")), Item(channel=item.channel, title=config.get_localized_string(70741) % config.get_localized_string(70314), action='new_search', page=1, mode='person', thumbnail=get_thumb("search_star.png"))] itemlist += [Item(channel=item.channel, title=config.get_localized_string(59995), action='saved_search', thumbnail=get_thumb('search.png')), Item(channel=item.channel, title=config.get_localized_string(60420), action='sub_menu', thumbnail=get_thumb('search.png')), Item(channel="tvmoviedb", title=config.get_localized_string(70274), action="mainlist", thumbnail=get_thumb("search.png")), Item(channel=item.channel, title=typo(config.get_localized_string(59994), 'color kod bold'), action='setting_channel_new', thumbnail=get_thumb('setting_0.png'),folder=False), Item(channel='shortcuts', title=typo(config.get_localized_string(70286), 'color kod bold'), action='SettingOnPosition', category=5, setting=1, thumbnail=get_thumb('setting_0.png'),folder=False)] itemlist = set_context(itemlist) return itemlist
def context(exist): if access(): modify = config.get_localized_string(70714) if exist else '' _context = [{ "title": typo(modify + config.get_localized_string(70585), 'bold'), "action": "semiautomatic_config_item", "channel": "autorenumber" }] return _context
def show_channels(item): support.log() itemlist = [] # add context menu context = [{"title": config.get_localized_string(50005), "action": "remove_channel", "channel": "community"}] # read json json = load_and_check(item) itemlist.append(Item(channel=item.channel, title=support.typo(config.get_localized_string(70676),'bold color kod'), action='add_channel', thumbnail=get_thumb('add.png'))) for key, channel in json['channels'].items(): path = filetools.dirname(channel['path']) # relative path channel_json = load_json(channel['path']) # read channel json # retrieve information from json thumbnail = relative('thumbnail', channel_json, path) if not thumbnail: thumbnail = item.thumbnail fanart = relative('fanart', channel_json, path) plot = channel_json['plot'] if 'plot' in channel_json else '' itemlist.append(Item(channel=item.channel, title=support.typo(channel['channel_name'],'bold'), url=channel['path'], thumbnail=thumbnail, fanart=fanart, plot=plot, action='show_menu', channel_id = key, context=context, path=path)) autoplay.show_option(item.channel, itemlist) support.channel_config(item, itemlist) return itemlist