def __get_multiple_videos_episodes_list_id(self, soup): title_items = [] #some episodes have a different episodelist using class episodelist instead of id episode-list :/ episode_list_css = soup.find('div', {'class': 'episodeslist'}) episode_list = soup.find('div', {'id': 'episodes-list'}) if episode_list_css is not None: episode_list = episode_list_css.find( 'div', {'id': 'episodes-list-wrapper'}) for tile in episode_list.find_all('li'): thumbnail = VRTPlayer.__format_image_url(tile) found_element = tile.find(class_='vrtnu-list--item-meta') if found_element is not None: h_tag = found_element.find('h3') title = statichelper.replace_newlines_and_strip(h_tag.text) broadcast_date_tag = found_element.find( class_='vrtnu-list--item-meta__mobile') if broadcast_date_tag is not None: clean_date = VRTPlayer.__strip_date_from_unessecary_caracters( broadcast_date_tag.text) title = clean_date + ' ' + title path = tile.find('a')['href'] video_dictionary = self.metadata_collector.get_multiple_layout_episode_metadata( tile) title_items.append( helperobjects.TitleItem(title, { 'action': actions.PLAY, 'video': path }, True, thumbnail, video_dictionary)) return title_items
def __get_thumbnail_and_title(element): thumbnail = VRTPlayer.__format_image_url(element) found_element = element.find(class_="tile__title") title = "" if found_element is not None: title = statichelper.replace_newlines_and_strip(found_element.contents[0]) return thumbnail, title
def __get_multiple_videos(self, tiles): title_items = [] episode_list = tiles.find("div", {"id": "episodelist__slider"}) for tile in episode_list.find_all(class_="tile"): thumbnail = VRTPlayer.__format_image_url(tile) found_element = tile.find(class_="tile__title") if found_element is not None: title = statichelper.replace_newlines_and_strip( found_element.contents[0]) broadcast_date_tag = tile.find( class_="tile__broadcastdate--mobile") if broadcast_date_tag is not None: title = broadcast_date_tag.text + " " + title path = tile["href"] video_dictionary = self.metadata_collector.get_multiple_layout_episode_metadata( tile) title_items.append( helperobjects.TitleItem(title, { "action": actions.PLAY, "video": path }, True, thumbnail, video_dictionary)) return title_items
def __get_category_thumbnail_and_title(element): thumbnail = VRTPlayer.__format_category_image_url(element) found_element = element.find('h2') title = '' if found_element is not None: title = statichelper.replace_newlines_and_strip( found_element.contents[0]) return thumbnail, title
def __get_az_thumbnail_and_title(element): thumbnail = VRTPlayer.__format_image_url(element) found_element = element.find(class_='nui-tile--content') title = '' if found_element is not None: title_element = found_element.find('h3') title = statichelper.replace_newlines_and_strip(title_element.text) return thumbnail, title
def __get_thumbnail_and_title(element): thumbnail = VRTPlayer.__format_image_url(element) found_element = element.find(class_="tile__title") title = "" if found_element is not None: title = statichelper.replace_newlines_and_strip( found_element.contents[0]) return thumbnail, title
def __get_episodes(self, option_tags): """ This method gets all the episodes = seasons from the dropdownmenus on the vrt.nu website :param option_tags: :return: """ title_items = [] for option_tag in option_tags: title = statichelper.replace_newlines_and_strip(option_tag.text) if option_tag.has_attr('data-href'): path = option_tag['data-href'] title_items.append(helperobjects.TitleItem(title, {"action" : actions.LISTING_VIDEOS, 'video':path}, False)) return title_items
def __get_episodes(self, option_tags): """ This method gets all the episodes = seasons from the dropdownmenus on the vrt.nu website :param option_tags: :return: """ title_items = [] for option_tag in option_tags: title = statichelper.replace_newlines_and_strip(option_tag.text) if option_tag.has_attr('data-href'): path = option_tag['data-href'] title_items.append( helperobjects.TitleItem(title, { "action": actions.LISTING_VIDEOS, 'video': path }, False)) return title_items
def __get_multiple_videos(self, tiles): title_items = [] episode_list = tiles.find("div", {"id": "episodelist__slider"}) for tile in episode_list.find_all(class_="tile"): thumbnail = VRTPlayer.__format_image_url(tile) found_element = tile.find(class_="tile__title") if found_element is not None: title = statichelper.replace_newlines_and_strip(found_element.contents[0]) broadcast_date_tag = tile.find(class_="tile__broadcastdate--mobile") if broadcast_date_tag is not None: title = broadcast_date_tag.text + " " + title path = tile["href"] video_dictionary = self.metadata_collector.get_multiple_layout_episode_metadata(tile) title_items.append(helperobjects.TitleItem(title, {"action": actions.PLAY, "video": path}, True, thumbnail, video_dictionary)) return title_items
def __get_episodes(self, li_tags, original_path): ''' This method gets all the episodes = seasons from the tabmenus on the vrt.nu website :param option_tags: :return: ''' title_items = [] for li_tag in li_tags: a_tag = li_tag.find('a') if a_tag is not None and a_tag.has_attr('href'): title = a_tag.text path = a_tag['href'] stripped_title = statichelper.replace_newlines_and_strip(title) title_items.append( helperobjects.TitleItem(stripped_title, { 'action': actions.LISTING_VIDEOS, 'video': path }, False)) return title_items