The Movie Database Support

How can I use movie trailer module in TMDB api? The movie trailer module uses data from TMDB but I cannot get access to the youtube videos that are in TMDB from movie trailer module. I tried to use TMDB movie id in movie trailer module to get the video from the youtube. Can anyone help me with this?

11 replies (on page 1 of 1)

Jump to last post

@shresritik said:
how to use movie trailer module with TMDB api
How can I use movie trailer module in TMDB api?
The movie trailer module uses data from TMDB but I cannot get access to the youtube videos that are in TMDB from movie trailer module.
I tried to use TMDB movie id in movie trailer module to get the video from the youtube.
Can anyone help me with this?

Who is this "movie trailer module"? What module is it from?

It is one of the npm packages which is used to get YouTube urls. Here is the link: https://www.npmjs.com/package/movie-trailer

I think it will be easier for you to get help on Github from the developers.
https://github.com/npm/rfcs

Ok But I just want to get the YouTube movie trailer url from the TMDB movies Is this possible?

@shresritik said:

Ok But I just want to get the YouTube movie trailer url from the TMDB movies Is this possible?

Yes, https://developers.themoviedb.org/3/movies/get-movie-videos, you just need to get a key and merge it with youtube link. Example key from the api: h6hZkvrFIj0. Full url would look like this: https://www.youtube.com/watch?v=h6hZkvrFIj0

@shresritik said:

Ok
But I just want to get the YouTube movie trailer url from the TMDB movies
Is this possible?

I didn't understand that that was the problem in your first comment.
Yes, I even have a ready answer:

Trailer URL

When you make an API Request requesting Videos, in the response you will receive something like this:

videos  
results 
0   
id  "57e6bf38925141414600bbe1"
iso_639_1   "pt"
iso_3166_1  "BR"
key "eBKvlCf0B4g"
name    "Clube da Luta | 1999 | Trailer Legendado | Fight Club"
site    "YouTube"
size    480
type    "Trailer"

Just add the Key in the respective URL:

YouTube: https://www.youtube.com/watch?v=  
Vimeo: https://vimeo.com/  

For example:
Youtube: https://www.youtube.com/watch?v=eBKvlCf0B4g
Youtube: https://www.youtube.com/watch?v=hzfvYSIIgyc
Vimeo: https://vimeo.com/282875052

Travis Bell - 2020-09-19
Hi @user, we only support YouTube and Vimeo right now.

Thank you very much @ticao2 and @kironet your suggestions worked and I didn't even have to use movie-trailer module.

HI, i have a question, when you have the key and the link of youtube in the code, how do i show the video? using any html tag in specific? i try with video and media and doesnt work...

Hi @lucaselbestprogramer, your best bet is to read through YouTube's documentation.

if i only want to get the videos with TYPE trailer how can i do that?

@mariaxx9 said:
if i only want to get the videos with TYPE trailer how can i do that?

When a Video API Request is made in the response in each item, it is specified what type it is.
I believe that an answer is not possible with only trailers, without the other types.
You, on your side, must filter what interests you.
For example:
https://api.themoviedb.org/3/movie/634649/videos?api_key=THE_KEY
Look:

id  634649
results 
0   
iso_639_1   "en"
iso_3166_1  "US"
name    "Peter Ruins Runes Clip"
key "eH_QbFQFyMg"
site    "YouTube"
size    1080
type    "Clip"
official    true
published_at    "2021-12-28T17:00:22.000Z"
id  "61cb8a5ba097dc004280527d"
1   
iso_639_1   "en"
iso_3166_1  "US"
name    "Outed Clip"
key "3hshqAdwrnQ"
site    "YouTube"
size    1080
type    "Clip"
official    true
published_at    "2021-12-26T19:27:29.000Z"
id  "61cb89ede258600098841108"
2   
iso_639_1   "en"
iso_3166_1  "US"
name    "Cartoon Network Presents โ€˜Twas the Night Before"
key "N2G2CKudbeQ"
site    "YouTube"
size    1080
type    "Featurette"
official    true
published_at    "2021-12-24T20:00:04.000Z"
id  "61c6299befd3c20060909428"
3   
iso_639_1   "en"
iso_3166_1  "US"
name    "Who'd You Rather"
key "i6kAjYBKcgY"
site    "YouTube"
size    1080
type    "Featurette"
official    true
published_at    "2021-12-24T17:00:22.000Z"
id  "61cb89a53852020019a02d53"
4   
iso_639_1   "en"
iso_3166_1  "US"
name    "Ultimate Holiday Movie"
key "qPj9PSHPGm4"
site    "YouTube"
size    1080
type    "Featurette"
official    true
published_at    "2021-12-22T23:30:53.000Z"
id  "61cb88949b6e47009ddc3856"
5   
iso_639_1   "en"
iso_3166_1  "US"
name    "Check It Out"
key "xGjmWfbLPzQ"
site    "YouTube"
size    1080
type    "Teaser"
official    true
published_at    "2021-12-18T17:00:39.000Z"
id  "61c180412ac4990093d2e176"
6   
iso_639_1   "en"
iso_3166_1  "US"
name    "Cast Catch-Up"
key "Ylufh8C79BI"
site    "YouTube"
size    1080
type    "Featurette"
official    true
published_at    "2021-12-17T23:00:30.000Z"
id  "61bdcd960143250065da66c6"
7   
iso_639_1   "en"
iso_3166_1  "US"
name    "Imagine"
key "UV2ZWTSHjSs"
site    "YouTube"
size    1080
type    "Teaser"
official    true
published_at    "2021-12-12T13:00:27.000Z"
id  "61b68b940443c90087493d8e"
8   
iso_639_1   "en"
iso_3166_1  "US"
name    "Return of the Villains Vignette"
key "w5oVmO5kYEE"
site    "YouTube"
size    1080
type    "Featurette"
official    true
published_at    "2021-12-08T17:00:47.000Z"
id  "61b6eedc7d5f4b009125fa9b"
9   
iso_639_1   "en"
iso_3166_1  "US"
name    "Fame"
key "SzdyGglS4zM"
site    "YouTube"
size    1080
type    "Teaser"
official    true
published_at    "2021-12-03T16:18:50.000Z"
id  "61b68bc14cd912001aed534d"
10  
iso_639_1   "en"
iso_3166_1  "US"
name    "Dude"
key "22oiqgtV6hw"
site    "YouTube"
size    1080
type    "Teaser"
official    true
published_at    "2021-11-29T05:00:03.000Z"
id  "61a4c1ff180dea00988103ae"
11  
iso_639_1   "en"
iso_3166_1  "US"
name    "Together"
key "fx9miIKrvIo"
site    "YouTube"
size    1080
type    "Teaser"
official    true
published_at    "2021-11-27T17:19:35.000Z"
id  "61a4c190869e750093ed62ab"
12  
iso_639_1   "en"
iso_3166_1  "US"
name    "Strange"
key "I5Js6wam7e4"
site    "YouTube"
size    1080
type    "Teaser"
official    true
published_at    "2021-11-24T20:06:22.000Z"
id  "61a4c12905822400642693e9"
13  
iso_639_1   "en"
iso_3166_1  "US"
name    "Spider Bite"
key "M6ix8Q50OaM"
site    "YouTube"
size    1080
type    "Teaser"
official    true
published_at    "2021-11-23T00:47:32.000Z"
id  "61a4c0f30231f20061539241"
14  
iso_639_1   "en"
iso_3166_1  "US"
name    "Official IMAXยฎ Trailer"
key "pBvH8hvnJPk"
site    "YouTube"
size    1080
type    "Trailer"
official    true
published_at    "2021-11-18T23:27:29.000Z"
id  "61982e61e2ff32004371953a"
15  
iso_639_1   "en"
iso_3166_1  "US"
name    "Official Trailer"
key "JfVOs4VSpmA"
site    "YouTube"
size    1080
type    "Trailer"
official    true
published_at    "2021-11-17T01:30:05.000Z"
id  "61945b8a4da3d4002992d5a6"
16  
iso_639_1   "en"
iso_3166_1  "US"
name    "Official Teaser Trailer"
key "WgU7P6o-GkM"
site    "YouTube"
size    1080
type    "Trailer"
official    true
published_at    "2021-08-24T01:40:05.000Z"
id  "6124694a534661005cd0b8a7"
17  
iso_639_1   "en"
iso_3166_1  "US"
name    "The New Spider-Man Title isโ€ฆ"
key "iqyPvdsOWKk"
site    "YouTube"
size    1080
type    "Teaser"
official    true
published_at    "2021-02-24T17:44:20.000Z"
id  "60378fdcd132d60040a45d96"

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

Global

s focus the search bar
p open profile menu
esc close an open window
? open keyboard shortcut window

On media pages

b go back (or to parent when applicable)
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

Settings

Want to rate or add this item to a list?

Login