diff --git a/plugin.video.alfa/channels/search.py b/plugin.video.alfa/channels/search.py index 818bfeff..30d234e8 100644 --- a/plugin.video.alfa/channels/search.py +++ b/plugin.video.alfa/channels/search.py @@ -38,6 +38,9 @@ def mainlist(item): itemlist.append(Item(channel=item.channel, action="opciones", title="Opciones", thumbnail=get_thumb("search.png"))) + itemlist.append(Item(channel="tvmoviedb", action="mainlist", title="Busquèda alternativa", + thumbnail=get_thumb("search.png"))) + saved_searches_list = get_saved_searches() context2 = context[:] context2.append({"title": "Borrar búsquedas guardadas", diff --git a/plugin.video.alfa/channels/tvmoviedb.json b/plugin.video.alfa/channels/tvmoviedb.json index 6a09e799..f4e6108d 100755 --- a/plugin.video.alfa/channels/tvmoviedb.json +++ b/plugin.video.alfa/channels/tvmoviedb.json @@ -1,178 +1,178 @@ -{ - "id": "tvmoviedb", - "name": "TvMovieDB", - "active": true, - "adult": false, - "language": ["*"], - "thumbnail": "http://i.imgur.com/HA7fvgD.png", - "categories": [ - "movie", - "tvshow", - "anime" - ], - "settings": [ - { - "id": "tmdb", - "type": "list", - "label": "Idioma de búsqueda en TMDB", - "default": 7, - "enabled": true, - "visible": true, - "lvalues": [ - "Alemán", - "Francés", - "Portugués", - "Italiano", - "Español Latino", - "Catalán", - "Inglés", - "Castellano" - ] - }, - { - "id": "tmdb_alternativo", - "type": "list", - "label": "Idioma alternativo para TMDB (No sinopsis idioma principal)", - "default": 6, - "enabled": true, - "visible": true, - "lvalues": [ - "Alemán", - "Francés", - "Portugués", - "Italiano", - "Español Latino", - "Catalán", - "Inglés", - "Castellano" - ] - }, - { - "id": "imdb", - "type": "list", - "label": "Idioma de los títulos en IMDB", - "color": "0xFFE0F04B", - "default": 7, - "enabled": true, - "visible": true, - "lvalues": [ - "Alemán", - "Francés", - "Portugués", - "Italiano", - "Español Latino", - "Catalán", - "Inglés", - "Castellano" - ] - }, - { - "id": "label1", - "type": "label", - "label": "", - "enabled": false, - "visible": true - }, - { - "id": "filmaff", - "type": "list", - "label": "Sitio Web Filmaffinity", - "color": "0xFF25AA48", - "default": 5, - "enabled": true, - "visible": true, - "lvalues": [ - "Colombia", - "Chile", - "Argentina", - "México", - "US/UK", - "España" - ] - }, - { - "id": "usuariofa", - "type": "text", - "label": "Usuario Filmaffinity (Opcional)", - "color": "0xFFd50b0b", - "default": "", - "enabled": true, - "visible": true - }, - { - "id": "passfa", - "type": "text", - "label": "Contraseña Filmaffinity", - "color": "0xFFd50b0b", - "default": "", - "enabled": "!eq(-1,'')", - "hidden": true, - "visible": true - }, - { - "id": "orderfa", - "type": "list", - "label": "Ordenar listas personales de Filmaffinity por:", - "color": "0xFF25AA48", - "default": 0, - "enabled": "!eq(-1,'')", - "visible": true, - "lvalues": [ - "Posición", - "Título", - "Año", - "Voto", - "Nota media" - ] - }, - { - "id": "label2", - "type": "label", - "label": "", - "enabled": false, - "visible": true - }, - { - "id": "usuariomal", - "type": "text", - "label": "Usuario MyAnimeList (Opcional)", - "color": "0xFF25AA48", - "default": "", - "enabled": true, - "visible": true - }, - { - "id": "passmal", - "type": "text", - "label": "Contraseña MyAnimeList", - "color": "0xFF25AA48", - "default": "", - "enabled": "!eq(-1,'')", - "hidden": true, - "visible": true - }, - { - "id": "adult_mal", - "type": "bool", - "label": "Mostrar Hentais en MyAnimeList", - "color": "0xFFd50b0b", - "default": false, - "enabled": true, - "visible": true - }, - { - "id": "perfil", - "type": "list", - "label": "Perfil de color", - "default": 2, - "enabled": true, - "visible": true, - "lvalues": [ - "Perfil 3", - "Perfil 2", - "Perfil 1", - "Ninguno" - ] - } - ] +{ + "id": "tvmoviedb", + "name": "TvMovieDB", + "active": false, + "adult": false, + "language": ["*"], + "thumbnail": "http://i.imgur.com/HA7fvgD.png", + "categories": [ + "movie", + "tvshow", + "anime" + ], + "settings": [ + { + "id": "tmdb", + "type": "list", + "label": "Idioma de búsqueda en TMDB", + "default": 7, + "enabled": true, + "visible": true, + "lvalues": [ + "Alemán", + "Francés", + "Portugués", + "Italiano", + "Español Latino", + "Catalán", + "Inglés", + "Castellano" + ] + }, + { + "id": "tmdb_alternativo", + "type": "list", + "label": "Idioma alternativo para TMDB (No sinopsis idioma principal)", + "default": 6, + "enabled": true, + "visible": true, + "lvalues": [ + "Alemán", + "Francés", + "Portugués", + "Italiano", + "Español Latino", + "Catalán", + "Inglés", + "Castellano" + ] + }, + { + "id": "imdb", + "type": "list", + "label": "Idioma de los títulos en IMDB", + "color": "0xFFE0F04B", + "default": 7, + "enabled": true, + "visible": true, + "lvalues": [ + "Alemán", + "Francés", + "Portugués", + "Italiano", + "Español Latino", + "Catalán", + "Inglés", + "Castellano" + ] + }, + { + "id": "label1", + "type": "label", + "label": "", + "enabled": false, + "visible": true + }, + { + "id": "filmaff", + "type": "list", + "label": "Sitio Web Filmaffinity", + "color": "0xFF25AA48", + "default": 5, + "enabled": true, + "visible": true, + "lvalues": [ + "Colombia", + "Chile", + "Argentina", + "México", + "US/UK", + "España" + ] + }, + { + "id": "usuariofa", + "type": "text", + "label": "Usuario Filmaffinity (Opcional)", + "color": "0xFFd50b0b", + "default": "", + "enabled": true, + "visible": true + }, + { + "id": "passfa", + "type": "text", + "label": "Contraseña Filmaffinity", + "color": "0xFFd50b0b", + "default": "", + "enabled": "!eq(-1,'')", + "hidden": true, + "visible": true + }, + { + "id": "orderfa", + "type": "list", + "label": "Ordenar listas personales de Filmaffinity por:", + "color": "0xFF25AA48", + "default": 0, + "enabled": "!eq(-1,'')", + "visible": true, + "lvalues": [ + "Posición", + "Título", + "Año", + "Voto", + "Nota media" + ] + }, + { + "id": "label2", + "type": "label", + "label": "", + "enabled": false, + "visible": true + }, + { + "id": "usuariomal", + "type": "text", + "label": "Usuario MyAnimeList (Opcional)", + "color": "0xFF25AA48", + "default": "", + "enabled": true, + "visible": true + }, + { + "id": "passmal", + "type": "text", + "label": "Contraseña MyAnimeList", + "color": "0xFF25AA48", + "default": "", + "enabled": "!eq(-1,'')", + "hidden": true, + "visible": true + }, + { + "id": "adult_mal", + "type": "bool", + "label": "Mostrar Hentais en MyAnimeList", + "color": "0xFFd50b0b", + "default": false, + "enabled": true, + "visible": true + }, + { + "id": "perfil", + "type": "list", + "label": "Perfil de color", + "default": 2, + "enabled": true, + "visible": true, + "lvalues": [ + "Perfil 3", + "Perfil 2", + "Perfil 1", + "Ninguno" + ] + } + ] } \ No newline at end of file diff --git a/plugin.video.alfa/channels/tvmoviedb.py b/plugin.video.alfa/channels/tvmoviedb.py index 16d8e5bd..ef95c43a 100644 --- a/plugin.video.alfa/channels/tvmoviedb.py +++ b/plugin.video.alfa/channels/tvmoviedb.py @@ -730,11 +730,11 @@ def indices_tmdb(item): from datetime import datetime if "Géneros" in item.title: thumbnail = {} - url = ('http://api.themoviedb.org/3/genre/%s/list?api_key=f7f51775877e0bb6703520952b3c7840&language=%s' + url = ('http://api.themoviedb.org/3/genre/%s/list?api_key=a1ab8b8669da03637a4b98fa39c39228&language=%s' % (item.extra, langt)) + lista_generos = {} try: lista = jsontools.load(httptools.downloadpage(url, cookies=False).data)["genres"] - lista_generos = {} for l in lista: lista_generos[str(l["id"])] = l["name"] if "es" in langt: @@ -754,12 +754,10 @@ def indices_tmdb(item): sort_by = 'first_air_date.desc' param_year = 'air_date.lte' for key, value in lista_generos.items(): - new_item = item.clone() - new_item.title = value - new_item.thumbnail = thumbnail[key] - new_item.search = {'url': 'discover/%s' % item.extra, 'with_genres': key, 'sort_by': sort_by, - param_year: fecha, - 'language': langt, 'page': 1} + search = {'url': 'discover/%s' % item.extra, 'with_genres': key, 'sort_by': sort_by, + param_year: fecha, + 'language': langt, 'page': 1} + new_item = item.clone(title=value, thumbnail=thumbnail[key], action="listado_tmdb", search=search) itemlist.append(new_item) itemlist.sort(key=lambda item: item.title)