Axuda de The Movie Database

Hello all, I'm currently learning to code and such. Something I am currently working on is a project to compare 2 different movies. To do so however, I want/need to be able to import first every movie ever and store it in an array in JS. Is there a way to do this with this API? It seems to me that you can only search for specific movies and pull those results but not search for every movie...

Thanks Aji

3 respostas (na páxina 1 de 1)

Jump to last post

Hi,

The only way to download all movies is to iterate through the list of all TMDb movie IDs and for each entry call movie API method. You can use our daily exports of valid TMDb IDs as a starting point. Just don't forget to properly attribute TMDb as the source of your data (you can read more about attribution requirements here and here).

talestalker

Hey Talestalker,

thanks for getting back to me. I Will definitely take into account the attribution requirements. I did an API call following the correct date format to pull data from the 29th (yesterday).

As per the instructions, I understand that every line of the file is itself a JSON. I selected one line and tried to console.log it but when doing so, I get a white question mark symbol with a black background.

I tried using JSON.parse() method (not that I need to though right? Since each line is already a JSON) also but when I do that, I get the following error Uncaught SyntaxError: Unexpected token � in JSON at position 0

Aji

get a white question mark symbol with a black background.

All file texts should be UTF-8 encoded and question marks seem to be replacement for unsupported or incorrectly decoded non-Latin characters. What do you see if you open the export in text editor? This is what I get in my notepad on Windows 10 (look at the movies TMDb ID 30-32).

I tried using JSON.parse() method (not that I need to though right? Since each line is already a JSON) also but when I do that, I get the following error Uncaught SyntaxError: Unexpected token � in JSON at position 0

I can only help you with python, but as I already said the problem is most likely caused by UTF-8 encoding. Try to decode the string first.

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