The Movie Database Support Forum

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 Antworten (Seite 1 von 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);
        });

Es fehlt ein Film oder eine Serie? Logge dich ein zum Ergänzen.

Allgemein

s Fokus auf Suchfeld
p Profil öffnen
esc Fenster schließen
? Tastenkürzel anzeigen

Videos

b Zurück
e Bearbeiten

Staffeln

Nächste Staffel
Vorherige Staffel

Episoden

Nächste Episode
Vorherige Episode

Bilder

a Poster oder Hintergrundbild hinzufügen

Editieren

t Sprachauswahl öffnen
ctrl+ s Speichern

Diskussionen

n Neue Diskussion erstellen
w Beobachten an / aus
p Diskussion öffentlich / privat
c Diskussion öffnen / schließen
a Diskussionsverlauf anzeigen
r Auf Diskussion antworten
l Letzte Antwort anzeigen
ctrl+ enter Senden
Nächste Seite
Vorherige Seite

Einstellungen

Diesen Eintrag bewerten oder zu einer Liste hinzufügen?

Anmelden