def section(item): logger.info() itemlist = list() if item.title == "Generos": _filter = "genres" elif item.title == "Por País": _filter = "countries" else: _filter = "years" matches = alfaresolver.get_data_zw(host, item, section=True).get(_filter, []) for elem in matches: title = elem["label"] new_item = Item(channel=item.channel, title=title, action="list_all", start=0) if item.title == "Generos": new_item.genres = title elif item.title == "Por País": new_item.country = title else: new_item.year = title itemlist.append(new_item) return itemlist