The Movie Database 支持

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 回复(第 1 页,共 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"

找不到电影或剧集?登录并创建它吧。

全站通用

s 聚焦到搜索栏
p 打开个人资料菜单
esc 关闭打开的窗口
? 打开键盘快捷键窗口

在媒体页面

b 返回(或返回上级)
e 进入编辑页面

在电视季页面

(右箭头)下一季
(左箭头)前一季

在电视集页面

(右箭头)下一集
(左箭头)前一集

在所有图像页面

a 打开添加图片窗口

在所有编辑页面

t 打开翻译选择器
ctrl+ s 提交

在讨论页面

n 创建新讨论
w 切换关注状态
p 设为公开 / 私密讨论
c 关闭 / 开放讨论
a 打开活动页
r 回复讨论
l 跳转至最新回复
ctrl+ enter 发送信息
(右箭头)下一页
(左箭头)前一页

设置

想给这个条目评分或将其添加到片单中?

登录

还不是会员?

注册加入社区