def _mirrors(url): mirrors = scrapers.mirrors(url) num_mirrors = len(mirrors) if num_mirrors > 0: di_list = [] for mirr_label, parts in mirrors: for part_label, part_url in parts: label = cleanstring.mirror(mirr_label, part_label) action_url = common.action_url('play_mirror', url=part_url) di_list.append(common.diritem(label, action_url, isfolder=False)) return di_list else: # if no mirror listing, try to resolve this page directly play_mirror(url) return []
def _mirrors(url): mirrors = scrapers.mirrors(url) num_mirrors = len(mirrors) if num_mirrors > 0: di_list = [] if (xbmcaddon.Addon().getSetting('auto_select_mirror') == 'true'): for mirr_label, parts in mirrors: if "Full" in parts[0][0]: if play_mirror(parts[0][1]): return [] else: for mirr_label, parts in mirrors: for part_label, part_url in parts: label = cleanstring.mirror(mirr_label, part_label) action_url = common.action_url('play_mirror', url=part_url) di_list.append(common.diritem(label, action_url, isfolder=False)) return di_list else: # if no mirror listing, try to resolve this page directly play_mirror(url) return []
def _mirrors(url): mirrors = scrapers.mirrors(url) num_mirrors = len(mirrors) if num_mirrors > 0: di_list = [] for mirr_label, parts in mirrors: for part_label, part_url in parts: label = cleanstring.mirror(mirr_label, part_label) action_url = common.action_url('play_mirror', url=part_url) di_list.append( common.diritem(label, action_url, isfolder=False)) if auto_select.settings_is_set('auto_select_first_mirror'): common.notify(heading="Other mirrors exists", message=", ".join( "{} (count: {})".format(mirr_label, len(parts)) for mirr_label, parts in mirrors), time=6000) play_mirror(url) return di_list else: # if no mirror listing, try to resolve this page directly play_mirror(url) return []