def videos_in_search(search_str): path1 = path('"search"', '"' + search_str + '"', from_to(0,99), video_infos1) path2 = path('"search"', '"' + search_str + '"', from_to(0,99), video_infos2) path3 = path('"search"', '"' + search_str + '"', from_to(0,99), video_infos3) path4 = path('"search"', '"' + search_str + '"', from_to(0,99), video_infos4) ret = req_path(path1, path2, path3, path4) filter_empty(ret) search = child('search', ret) search_node = child(search_str, search) rets = [] for video_ref in search_node: video_id, vjsn = deref(search_node[video_ref], ret) parsed = video_parser.parse_video(None, vjsn, None, video_id) rets.append(parsed) return rets
def videos_in_search(search_str): path1 = path('"search"', '"' + search_str + '"', from_to(0,99), video_infos1) path2 = path('"search"', '"' + search_str + '"', from_to(0,99), video_infos2) path3 = path('"search"', '"' + search_str + '"', from_to(0,99), video_infos3) path4 = path('"search"', '"' + search_str + '"', from_to(0,99), video_infos4) ret = req_path(path1, path2, path3, path4) filter_empty(ret) search = child('search', ret) search_node = child(search_str, search) rets = [] for video_ref in search_node: video_id, vjsn = deref(search_node[video_ref], ret) parsed = video_parser.parse_video(None, vjsn, None, video_id) rets.append(parsed) return rets
def videos_in_search(search_str): path1 = path('"search"', '"' + search_str + '"', '"titles"', from_to(0,99), video_infos1) path2 = path('"search"', '"' + search_str + '"', '"titles"', from_to(0,99), video_infos2) path3 = path('"search"', '"' + search_str + '"', '"titles"', from_to(0,99), video_infos3) path4 = path('"search"', '"' + search_str + '"', '"titles"', from_to(0,99), video_infos4) ret = req_json_path(path1, path2, path3, path4) filter_empty(ret) rets = [] if 'search' in ret: search = ret['search'] search_node = child(search_str, search) for video_ref in search_node['titles']: if search_node['titles'][video_ref][0] == 'videos': parsed = video_parser.parse_video(ret['videos'][search_node['titles'][video_ref][1]], search_node['titles'][video_ref][1]) rets.append(parsed) return rets
def videos_in_genre(genre_to_browse, page): items_per_page = int(generic_utility.get_setting('items_per_page')) off_from = page * items_per_page off_to = off_from + items_per_page - 2 path1 = path('"genres"', '"' + genre_to_browse + '"', '"su"', from_to(off_from, off_to), video_infos1) path2 = path('"genres"', '"' + genre_to_browse + '"', '"su"', from_to(off_from, off_to), video_infos2) path3 = path('"genres"', '"' + genre_to_browse + '"', '"su"', from_to(off_from, off_to), video_infos3) path4 = path('"genres"', '"' + genre_to_browse + '"', '"su"', from_to(off_from, off_to), video_infos4) ret = req_path(path1, path2, path3, path4) filter_empty(ret) gnrs = child('genres', ret) gnre = child(genre_to_browse, gnrs) sus = child('su', gnre) rets = [] for ref in sus: video_id, vjsn = deref(sus[ref], ret) parsed = video_parser.parse_video(None, vjsn, None, video_id) rets.append(parsed) return rets
def videos_in_list(list_to_browse, page): items_per_page = int(generic_utility.get_setting('items_per_page')) off_from = page * items_per_page off_to = off_from + items_per_page - 2 path1 = path('"lists"', '"' + list_to_browse + '"', from_to(off_from, off_to), video_infos1) path2 = path('"lists"', '"' + list_to_browse + '"', from_to(off_from, off_to), video_infos2) path3 = path('"lists"', '"' + list_to_browse + '"', from_to(off_from, off_to), video_infos3) path4 = path('"lists"', '"' + list_to_browse + '"', from_to(off_from, off_to), video_infos4) ret = req_path(path1, path2, path3, path4) filter_empty(ret) lists = child('lists', ret) list = child(list_to_browse, lists) rets = [] for ref in list: video_id, vjsn = deref(list[ref], ret) parsed = video_parser.parse_video(None, vjsn, None, video_id) rets.append(parsed) return rets
def videos_in_genre(genre_to_browse, page): items_per_page = int(generic_utility.get_setting('items_per_page')) off_from = page * items_per_page off_to = off_from + items_per_page - 2 path1 = path('"genres"', '"' + genre_to_browse + '"', '"su"', from_to(off_from, off_to), video_infos1) path2 = path('"genres"', '"' + genre_to_browse + '"', '"su"', from_to(off_from, off_to), video_infos2) path3 = path('"genres"', '"' + genre_to_browse + '"', '"su"', from_to(off_from, off_to), video_infos3) path4 = path('"genres"', '"' + genre_to_browse + '"', '"su"', from_to(off_from, off_to), video_infos4) ret = req_path(path1, path2, path3, path4) filter_empty(ret) gnrs = child('genres', ret) gnre = child(genre_to_browse, gnrs) sus = child('su', gnre) rets = [] for ref in sus: video_id, vjsn = deref(sus[ref], ret) parsed = video_parser.parse_video(None, vjsn, None, video_id) rets.append(parsed) return rets
def videos_in_list(list_to_browse, page): items_per_page = int(generic_utility.get_setting('items_per_page')) off_from = page * items_per_page off_to = off_from + items_per_page - 2 path1 = path('"lists"', '"' + list_to_browse + '"', from_to(off_from, off_to), video_infos1) path2 = path('"lists"', '"' + list_to_browse + '"', from_to(off_from, off_to), video_infos2) path3 = path('"lists"', '"' + list_to_browse + '"', from_to(off_from, off_to), video_infos3) path4 = path('"lists"', '"' + list_to_browse + '"', from_to(off_from, off_to), video_infos4) ret = req_path(path1, path2, path3, path4) filter_empty(ret) lists = child('lists', ret) list = child(list_to_browse, lists) rets = [] for ref in list: video_id, vjsn = deref(list[ref], ret) parsed = video_parser.parse_video(None, vjsn, None, video_id) rets.append(parsed) return rets
def videos_in_search(search_str): path1 = path('"search"', '"byTerm"', '"|' + search_str + '"', '"titles"', '99', from_to(0, 99), '"reference"', video_infos1) path2 = path('"search"', '"byTerm"', '"|' + search_str + '"', '"titles"', '99', from_to(0, 99), '"reference"', video_infos2) path3 = path('"search"', '"byTerm"', '"|' + search_str + '"', '"titles"', '99', from_to(0, 99), video_infos3) path4 = path('"search"', '"byTerm"', '"|' + search_str + '"', '"titles"', '99', from_to(0, 99), '"reference"', video_infos4) ret = req_json_path(path1, path2, path3, path4) filter_empty(ret) rets = [] if 'search' in ret: search = ret['search'] for video_ref in ret[u'videos']: parsed = video_parser.parse_video(ret['videos'][video_ref], video_ref) rets.append(parsed) return rets
def lists(root_list, size=99): return path('"%s"' % root_list, from_to(0, size), '"displayName"')
def lists(root_list, size = 99): return path('"%s"' % root_list, from_to(0, size), '"displayName"')