def show_video_category_episodes(self, path): category = path.split('/')[-2] joined_url = self._VRTNU_SEARCH_URL + category response = requests.get(joined_url) programs = response.json() menu_items = [] for program in programs: title = program['title'] plot = BeautifulSoup(program['description'], 'html.parser').text thumbnail = statichelper.replace_double_slashes_with_https( program['thumbnail']) metadata_creator = metadatacreator.MetadataCreator() metadata_creator.plot = plot video_dictionary = metadata_creator.get_video_dictionary() #cut vrtbase url off since it will be added again when searching for episodes (with a-z we dont have the # full url) link_to_video = statichelper.replace_double_slashes_with_https( program['targetUrl']).replace(self._VRT_BASE, '') item = helperobjects.TitleItem(title, { 'action': actions.LISTING_VIDEOS, 'video': link_to_video }, False, thumbnail, video_dictionary) menu_items.append(item) self._kodi_wrapper.show_listing(menu_items, sortmethod.ALPHABET)
def show_video_category_episodes(self, path): category = path.split('/')[-2] joined_url = self._VRTNU_SEARCH_URL + category response = requests.get(joined_url) programs = response.json() menu_items = [] for program in programs: title = program["title"] plot = BeautifulSoup(program["description"], "html.parser").text thumbnail = statichelper.replace_double_slashes_with_https(program["thumbnail"]) metadata_creator = metadatacreator.MetadataCreator() metadata_creator.plot = plot video_dictionary = metadata_creator.get_video_dictionary() #cut vrtbase url off since it will be added again when searching for episodes (with a-z we dont have the # full url) link_to_video = statichelper.replace_double_slashes_with_https(program["targetUrl"]).replace(self._VRT_BASE, "") item = helperobjects.TitleItem(title, {'action': actions.LISTING_VIDEOS, 'video': link_to_video}, False, thumbnail, video_dictionary) menu_items.append(item) self._kodi_wrapper.show_listing(menu_items, sortmethod.ALPHABET)
def __format_category_image_url(element): raw_thumbnail = element.find( class_='nui-tile--image')['data-responsive-image'] return statichelper.replace_double_slashes_with_https(raw_thumbnail)
def __format_image_url(element): raw_thumbnail = element.find('img')['srcset'].split('1x,')[0] return statichelper.replace_double_slashes_with_https(raw_thumbnail)
def __format_image_url(element): raw_thumbnail = element.find("img")['srcset'].split('1x,')[0] return statichelper.replace_double_slashes_with_https(raw_thumbnail)