def resolve_event(event, quality = None, format = None): if quality not in QUALITY: quality = get_set_quality() if format not in FORMATS: format = get_set_format() data = None try: data = http.fetch_data('events/' + event)['recordings'] except http.FetchError: return want = recording_list(data, quality, format) if len(want) > 0: http.count_view(event, want[0].url) setResolvedUrl(plugin.handle, True, ListItem(path=want[0].url))
def show_conference(conf): data = None try: data = http.fetch_data('conferences/' + conf, wants_insecure()) except http.FetchError: return setContent(plugin.handle, 'movies') aspect = calc_aspect(maybe_json(data, 'aspect_ratio', '16:9')) for event in sorted(data['events'], key=operator.itemgetter('title')): item = ListItem(event['title']) item.setThumbnailImage(event['thumb_url']) item.setProperty('IsPlayable', 'true') info = { 'cast': maybe_json(event, 'persons', []), 'credits': ", ".join(maybe_json(event, 'persons', [])), 'genre': " / ".join(maybe_json(event, 'tags', [])), 'plot': maybe_json(event, 'description', ''), 'tagline': maybe_json(event, 'subtitle', '') } json_date_to_info(event, 'date', info) item.setInfo('video', info) streamInfo = {} length = maybe_json(event, 'length', 0) if length > 0: streamInfo['duration'] = length if aspect: streamInfo['aspect'] = aspect item.addStreamInfo('video', streamInfo) url = plugin.url_for(resolve_event, event=event['url'].rsplit('/', 1)[1]) addDirectoryItem(plugin.handle, url, item, False) endOfDirectory(plugin.handle)
def show_conference(conf): data = None try: data = http.fetch_data('conferences/' + conf) except http.FetchError: return setContent(plugin.handle, 'movies') aspect = calc_aspect(maybe_json(data, 'aspect_ratio', '16:9')) for event in sorted(data['events'], key=operator.itemgetter('title')): item = ListItem(event['title']) item.setArt({'thumb': event['thumb_url']}) item.setProperty('IsPlayable', 'true') info = { 'cast': maybe_json(event, 'persons', []), 'credits': ", ".join(maybe_json(event, 'persons', [])), 'genre': " / ".join(maybe_json(event, 'tags', [])), 'plot': maybe_json(event, 'description', ''), 'tagline': maybe_json(event, 'subtitle', '') } json_date_to_info(event, 'date', info) item.setInfo('video', info) streamInfo = {} length = maybe_json(event, 'length', 0) if length > 0: streamInfo['duration'] = length if aspect: streamInfo['aspect'] = aspect item.addStreamInfo('video', streamInfo) url = plugin.url_for(resolve_event, event=event['url'].rsplit('/', 1)[1]) addDirectoryItem(plugin.handle, url, item, False) endOfDirectory(plugin.handle)
def show_conference(conf): data = None try: data = http.fetch_data('conferences/' + conf)['events'] except http.FetchError: return for event in sorted(data, key=operator.itemgetter('title')): item = ListItem(event['title']) item.setThumbnailImage(event['thumb_url']) item.setProperty('IsPlayable', 'true') item.setInfo('video', { 'cast': event['persons'], 'plot': event['description'], 'tagline': event['subtitle'] }) item.addStreamInfo('video', { 'duration': event['length'] }) addDirectoryItem(plugin.handle, plugin.url_for(resolve_event, event = event['url'].rsplit('/', 1)[1]), item, False) endOfDirectory(plugin.handle)
def get_index_data(): return http.fetch_data('conferences', wants_insecure())['conferences']
def get_index_data(): return http.fetch_data('conferences')['conferences']