The Movie Database-støtte

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 svar (på side 1 av 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);
        });

Can't find a movie or TV show? Login to create it.

Global

s focus the search bar
p åpne profilmenyen
esc lukk et åpent vindu
? open keyboard shortcut window

On media pages

b gå tilbake (eller til foreldresiden når mulig)
e go to edit page

On TV season pages

(right arrow) go to next season
(left arrow) go to previous season

On TV episode pages

(right arrow) go to next episode
(left arrow) go to previous episode

On all image pages

a open add image window

On all edit pages

t open translation selector
ctrl+ s submit form

On discussion pages

n create new discussion
w toggle watching status
p toggle public/private
c toggle close/open
a open activity
r reply to discussion
l go to last reply
ctrl+ enter submit your message
(right arrow) next page
(left arrow) previous page

Innstillinger

Vil du vurdere eller legge til dette elementet i en liste?

Logg inn