Merge pull request #293 from MrTruth0/master

Moved TVMovieDB & Fix Genres
This commit is contained in:
Alfa
2018-06-09 16:46:01 -05:00
committed by GitHub
3 changed files with 186 additions and 185 deletions
+3
View File
@@ -38,6 +38,9 @@ def mainlist(item):
itemlist.append(Item(channel=item.channel, action="opciones", title="Opciones", itemlist.append(Item(channel=item.channel, action="opciones", title="Opciones",
thumbnail=get_thumb("search.png"))) 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() saved_searches_list = get_saved_searches()
context2 = context[:] context2 = context[:]
context2.append({"title": "Borrar búsquedas guardadas", context2.append({"title": "Borrar búsquedas guardadas",
+177 -177
View File
@@ -1,178 +1,178 @@
{ {
"id": "tvmoviedb", "id": "tvmoviedb",
"name": "TvMovieDB", "name": "TvMovieDB",
"active": true, "active": false,
"adult": false, "adult": false,
"language": ["*"], "language": ["*"],
"thumbnail": "http://i.imgur.com/HA7fvgD.png", "thumbnail": "http://i.imgur.com/HA7fvgD.png",
"categories": [ "categories": [
"movie", "movie",
"tvshow", "tvshow",
"anime" "anime"
], ],
"settings": [ "settings": [
{ {
"id": "tmdb", "id": "tmdb",
"type": "list", "type": "list",
"label": "Idioma de búsqueda en TMDB", "label": "Idioma de búsqueda en TMDB",
"default": 7, "default": 7,
"enabled": true, "enabled": true,
"visible": true, "visible": true,
"lvalues": [ "lvalues": [
"Alemán", "Alemán",
"Francés", "Francés",
"Portugués", "Portugués",
"Italiano", "Italiano",
"Español Latino", "Español Latino",
"Catalán", "Catalán",
"Inglés", "Inglés",
"Castellano" "Castellano"
] ]
}, },
{ {
"id": "tmdb_alternativo", "id": "tmdb_alternativo",
"type": "list", "type": "list",
"label": "Idioma alternativo para TMDB (No sinopsis idioma principal)", "label": "Idioma alternativo para TMDB (No sinopsis idioma principal)",
"default": 6, "default": 6,
"enabled": true, "enabled": true,
"visible": true, "visible": true,
"lvalues": [ "lvalues": [
"Alemán", "Alemán",
"Francés", "Francés",
"Portugués", "Portugués",
"Italiano", "Italiano",
"Español Latino", "Español Latino",
"Catalán", "Catalán",
"Inglés", "Inglés",
"Castellano" "Castellano"
] ]
}, },
{ {
"id": "imdb", "id": "imdb",
"type": "list", "type": "list",
"label": "Idioma de los títulos en IMDB", "label": "Idioma de los títulos en IMDB",
"color": "0xFFE0F04B", "color": "0xFFE0F04B",
"default": 7, "default": 7,
"enabled": true, "enabled": true,
"visible": true, "visible": true,
"lvalues": [ "lvalues": [
"Alemán", "Alemán",
"Francés", "Francés",
"Portugués", "Portugués",
"Italiano", "Italiano",
"Español Latino", "Español Latino",
"Catalán", "Catalán",
"Inglés", "Inglés",
"Castellano" "Castellano"
] ]
}, },
{ {
"id": "label1", "id": "label1",
"type": "label", "type": "label",
"label": "", "label": "",
"enabled": false, "enabled": false,
"visible": true "visible": true
}, },
{ {
"id": "filmaff", "id": "filmaff",
"type": "list", "type": "list",
"label": "Sitio Web Filmaffinity", "label": "Sitio Web Filmaffinity",
"color": "0xFF25AA48", "color": "0xFF25AA48",
"default": 5, "default": 5,
"enabled": true, "enabled": true,
"visible": true, "visible": true,
"lvalues": [ "lvalues": [
"Colombia", "Colombia",
"Chile", "Chile",
"Argentina", "Argentina",
"México", "México",
"US/UK", "US/UK",
"España" "España"
] ]
}, },
{ {
"id": "usuariofa", "id": "usuariofa",
"type": "text", "type": "text",
"label": "Usuario Filmaffinity (Opcional)", "label": "Usuario Filmaffinity (Opcional)",
"color": "0xFFd50b0b", "color": "0xFFd50b0b",
"default": "", "default": "",
"enabled": true, "enabled": true,
"visible": true "visible": true
}, },
{ {
"id": "passfa", "id": "passfa",
"type": "text", "type": "text",
"label": "Contraseña Filmaffinity", "label": "Contraseña Filmaffinity",
"color": "0xFFd50b0b", "color": "0xFFd50b0b",
"default": "", "default": "",
"enabled": "!eq(-1,'')", "enabled": "!eq(-1,'')",
"hidden": true, "hidden": true,
"visible": true "visible": true
}, },
{ {
"id": "orderfa", "id": "orderfa",
"type": "list", "type": "list",
"label": "Ordenar listas personales de Filmaffinity por:", "label": "Ordenar listas personales de Filmaffinity por:",
"color": "0xFF25AA48", "color": "0xFF25AA48",
"default": 0, "default": 0,
"enabled": "!eq(-1,'')", "enabled": "!eq(-1,'')",
"visible": true, "visible": true,
"lvalues": [ "lvalues": [
"Posición", "Posición",
"Título", "Título",
"Año", "Año",
"Voto", "Voto",
"Nota media" "Nota media"
] ]
}, },
{ {
"id": "label2", "id": "label2",
"type": "label", "type": "label",
"label": "", "label": "",
"enabled": false, "enabled": false,
"visible": true "visible": true
}, },
{ {
"id": "usuariomal", "id": "usuariomal",
"type": "text", "type": "text",
"label": "Usuario MyAnimeList (Opcional)", "label": "Usuario MyAnimeList (Opcional)",
"color": "0xFF25AA48", "color": "0xFF25AA48",
"default": "", "default": "",
"enabled": true, "enabled": true,
"visible": true "visible": true
}, },
{ {
"id": "passmal", "id": "passmal",
"type": "text", "type": "text",
"label": "Contraseña MyAnimeList", "label": "Contraseña MyAnimeList",
"color": "0xFF25AA48", "color": "0xFF25AA48",
"default": "", "default": "",
"enabled": "!eq(-1,'')", "enabled": "!eq(-1,'')",
"hidden": true, "hidden": true,
"visible": true "visible": true
}, },
{ {
"id": "adult_mal", "id": "adult_mal",
"type": "bool", "type": "bool",
"label": "Mostrar Hentais en MyAnimeList", "label": "Mostrar Hentais en MyAnimeList",
"color": "0xFFd50b0b", "color": "0xFFd50b0b",
"default": false, "default": false,
"enabled": true, "enabled": true,
"visible": true "visible": true
}, },
{ {
"id": "perfil", "id": "perfil",
"type": "list", "type": "list",
"label": "Perfil de color", "label": "Perfil de color",
"default": 2, "default": 2,
"enabled": true, "enabled": true,
"visible": true, "visible": true,
"lvalues": [ "lvalues": [
"Perfil 3", "Perfil 3",
"Perfil 2", "Perfil 2",
"Perfil 1", "Perfil 1",
"Ninguno" "Ninguno"
] ]
} }
] ]
} }
+6 -8
View File
@@ -730,11 +730,11 @@ def indices_tmdb(item):
from datetime import datetime from datetime import datetime
if "Géneros" in item.title: if "Géneros" in item.title:
thumbnail = {} 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)) % (item.extra, langt))
lista_generos = {}
try: try:
lista = jsontools.load(httptools.downloadpage(url, cookies=False).data)["genres"] lista = jsontools.load(httptools.downloadpage(url, cookies=False).data)["genres"]
lista_generos = {}
for l in lista: for l in lista:
lista_generos[str(l["id"])] = l["name"] lista_generos[str(l["id"])] = l["name"]
if "es" in langt: if "es" in langt:
@@ -754,12 +754,10 @@ def indices_tmdb(item):
sort_by = 'first_air_date.desc' sort_by = 'first_air_date.desc'
param_year = 'air_date.lte' param_year = 'air_date.lte'
for key, value in lista_generos.items(): for key, value in lista_generos.items():
new_item = item.clone() search = {'url': 'discover/%s' % item.extra, 'with_genres': key, 'sort_by': sort_by,
new_item.title = value param_year: fecha,
new_item.thumbnail = thumbnail[key] 'language': langt, 'page': 1}
new_item.search = {'url': 'discover/%s' % item.extra, 'with_genres': key, 'sort_by': sort_by, new_item = item.clone(title=value, thumbnail=thumbnail[key], action="listado_tmdb", search=search)
param_year: fecha,
'language': langt, 'page': 1}
itemlist.append(new_item) itemlist.append(new_item)
itemlist.sort(key=lambda item: item.title) itemlist.sort(key=lambda item: item.title)