Axuda de The Movie Database

Hi there..

Im having problems pulling backdrop related data...

I do OK when searching for showID=1400

url = requests.get('http://api.themoviedb.org/3/tv/1400/images?api_key=........&language=en')


data = url.json()


data_results = data['backdrops']



list = []


for i in data_results:

           list.append(i['file_path'])

  print(list)

 ['/8BF7AHKs5GPbKTzIk8f7SUXETD4.jpg', '/s6pU3p3PB87XkIzcG7QZAB7u163.jpg', '/5JeASo9lYlVFi1WQ3KV7fyhXDkx.jpg']

I get empty list when searching for showID=688

url = requests.get('http://api.themoviedb.org/3/tv/688/images?api_key=........&language=en')


data = url.json()


data_results = data['backdrops']


list = []


for i in data_results:


    list.append(i['file_path'])



print(list)

[ ]

Why is 688 coming up empty when is really not?

2 respostas (na páxina 1 de 1)

Jump to last post

Hi rootraid,

It's because of the language param you are using which is filtering the results. Take a read through the "image languages" section of the docs: http://docs.themoviedb.apiary.io/

You can add a include_image_language param to solve this. You're looking for:

https://api.themoviedb.org/3/tv/688/images?api_key=###&language=en&include_image_language=null,en

Now, you can do this and the primary TV show data in one call by using append_to_response:

https://api.themoviedb.org/3/tv/688?api_key=###&append_to_response=images&language=en&include_image_language=null,en

Cheers.

Fantastic. Thanks for the help!

Non podes atopar unha película ou serie? Inicia sesión para creala.

Global

s amosar a barra de procura
p abrir menú do perfil
esc pechar e abrir xanela
? abrir xanela de atallos do teclado

En páxinas de medios

b atrás (ou á principal se aplica)
e ir a editar páxina

En páxinas de tempadas de televisión

(flecha dereita) ir á tempada seguinte
(flecha esquerda) ir á tempada anterior

En páxinas de episodios de televisión

(flecha dereita) ir ao episodio seguinte
(flecha esquerda) ir ao episodio anterior

En todas as páxinas de imaxe

a abrir a xanela de engadir imaxe

En todas as páxinas de edición

t abrir selector de traducións
ctrl+ s enviar formulario

Nas páxinas de debate

n crear un novo debate
w amosar o estado do seguimento
p mudar público/privado
c mudar abrir/pechar
a abrir actividade
r responder no debate
l ir á última resposta
ctrl+ enter eviar a túa mensaxe
(flecha dereita) páxina seguinte
(flecha esquerda) ir á páxina anterior

Configuración

Queres valorar ou engadir o elemento a unha listaxe?

Iniciar sesión