I have the movie ID, tried to do themoviedb.org/ {id} doesn't exist, i tried using themoviedb.org/tv/ {id} and got the right page. But then i realize some need to use themoviedb.org/movie/ {id} to get the right page.
is there any way to get the right URL redirecting to tmdb?
找不到电影或节目?登录并创建它吧。
ticao2 🇧🇷 pt-BR 的回复
于 2020 年 12 月 16 日 8:00上午
There are no two Movies with the same ID.
But there may be a TV Show with the same ID. Or a person.
The list of IDs are separate, different for each type (movie, tv, person, network and company).
So, for each type you must use the corresponding Base URL.
For example, ID 500:
CahyoNurHikari 的回复
于 2020 年 12 月 16 日 10:54上午
is there any way to get base url (the /movie/ or /tv/) from the API?
Travis Bell 的回复
于 2020 年 12 月 16 日 11:15上午
Hi @CahyoNurHikari, no. They are static, and since you know what item you're requesting you can map them client side.
Skorpjun 的回复
于 2023 年 02 月 21 日 2:44下午
Hi, I would like to know if there is currently a way to get the TMDB URL from the TMDB ID. I read the posts above, but what do you mean 'map them client side'? How is there a way to know the URL client side if the 'GET /movie/{movie_id} ' command does not return any info on whether it is a movie or a TV show, while TMDB URL's differentiate between movies and TV shows? Thnx
ticao2 🇧🇷 pt-BR 的回复
于 2023 年 02 月 21 日 5:17下午
If you only know the TMDb ID but don't know what type of item it belongs to, then NO.
Just testing all possible URLs.
But, if you received that ID in an API Request response then YES.
Every response contains in each item in addition to the ID also more data including the type of item.
Movie, TV, Person, Network or Company.
If you post here an API Request you made, and you can't find that information, it will be easier to explain where the data is.
Skorpjun 的回复
于 2023 年 02 月 22 日 11:20上午
Hi ticao2, Imagine an API movie search request using "api.themoviedb.org/3/search/movie?query=TITLE". The JSON result would contains a lot of things, but as far as I could find no information about the type (Movie, TV, etc). See https://developers.themoviedb.org/3/search/search-movies Thnx
Travis Bell 的回复
于 2023 年 02 月 22 日 11:37上午
Hi @Skorpjun, if you're making a request to
/search/movie
you know you're only going to get movies back. This is the same for all searches to individual media types. If you decide to use/search/multi
however, you'll see themedia_type
field returned.