The Movie Database-ondersteuning

How can I get only the logo of the movies and tv I only want the logo like this => https://www.themoviedb.org/t/p/original/izvZm6zHyidvhktODSGjnOFldKu.png

4 antwoorden (op pagina 1 van 1)

Jump to last post

Hi @elmanci2, are you asking about this on the API?

Yes

Ok, I've moved this post into the API forum.

You can get the logos by calling the /images method, and looking at the returned logos filed.

Make sure to read the docs around images:

Hi! This is my solution for this problem, coded in Vue, but it's basically the same as any other js file :

const getImages = (movie_id) => {
            const images = ref([]);
            const main_logo = ref("");
            const xhr = new XMLHttpRequest();
            xhr.open("GET", `https://api.themoviedb.org/3/movie/${movie_id}/images?api_key=${env.apikey}`);
            xhr.onload = () => {
                images.value = JSON.parse(xhr.responseText).logos;          // will return an array of logos in many different languages
                const en_logos = images.value.filter((logo) => {                   // takes only the English logo
                    return logo.iso_639_1 == "en"
                })
                main_logo.value = "https://image.tmdb.org/t/p/original/" + en_logos[0].file_path;
            }
            xhr.send();
            return main_logo;
        }

// Sample Function Call
        const main_logo = getImages("945961");

        watchEffect(() => {
            console.log(main_logo.value);
        });

Film of tv-serie niet gevonden? Meld je aan om deze toe te voegen.

Wereldwijd

s focus op zoekbalk
p open profielmenu
esc sluit een open venster
? open sneltoetsen venster

Op media pagina's

b ga terug (of ga naar bovenliggend item)
e ga naar beweken

Op tv-seizoenspagina's

(rechter pijl) ga naar volgende seizoen
(linker pijl) ga naar vorig seizoen

Op pagina's met tv-series

(rechter pijl) ga naar volgende aflevering
(linker pijl) ga naar vorige aflevering

Op alle afbeeldingspagina's

a open venster afbeelding toevoegen

Op alle bewerkte pagina's

t open vertaalmenu
ctrl+ s verstuur formulier

Op discussiepagina's

n start nieuwe discussie
w Verander kijk status
p privé of openbaar
c schakelen sluiten/openen
a open activiteit
r beantwoord discussie
l ga naar laatste antwoord
ctrl+ enter verstuur uw bericht
(rechter pijl) volgende pagina
(linker pijl) vorige pagina

Instellingen

Want to rate or add this item to a list?

Inloggen