Suporte do The Movie Database

First of all I presume adult = porn films in the API docs? If so when I set this boolean to false it does not stop these kinds of films pulling through, even when it is set to true in the request url it still pulls through? How do I stop showing porn in my API results?

11 respostas (na página 1 de 1)

Jump to last post

Just to be sure it's not a definition error, can you give an example of such a movie?

(Or never mind, I read it incorrectly. You are seeing entries set to adult:true coming through, when they should not. Ignore my question then! Someone else can hopefully help you out.)

Hi @SomeT,

What's an example request that is returning some adult items?

Here is my full code: JsFiddle link

Basically it would be good to only show common and popular films as well but I can't quite work that out, the issue is, if I use latest then it shows stuff shown in cinema and such, I need just popular films (e.g. gravity which was released years ago but is still popular) and latest released films and NOT to show any porn films (it takes a few runs by the way for it to show a porn film poster etc...)

Adult items are not shown by default, so I'll need a specific URL to see the items that are being returned.

All items have an adult field, is the adult field set to true or false on the items that are coming back? I suspect false...

It is set to false. It is on line 4 of the Jsfiddle link in my previous post. However it is: https://api.themoviedb.org/3/movie/?language=en-US&include_adult=false&api_key=REDACTED" then a few things after:

var rng = (Math.floor(Math.random() * 520271) + 1); var APIurl = baseUrl + rng + apiKey; console.log("Url it is loading the data from: " + APIurl);// for testing / debugging fetch(new Request(APIurl))

It is best to look at the code I linked.

So an example request you're making that is returning an adult item is an actual movie "get details" call? Ie:

https://api.themoviedb.org/3/movie/550?api_key=###

If so, there's no way to filter adult items with a param, you're requesting the full movie data in that case. What you'll need to do is get the response and check the adult field. If it's true, head off and request another until you get an item that has the adult field set to false.

Ah good idea, as an alternative what would work better to display more relevant and 'popular' films not JUST latest releases? I can't figure out how from the docs but I believe this would be a good way around it.

/discover/movie is your best bet in that case and discover does have a proper adult filter (which is enabled by default) so you don't need to worry about anything in that case.

Discover has over 25 different filters and sort options and you can build all kinds of crazy queries with it. There's some examples here.

Many thanks!

@travisbell I am now trying to load just one movie like I was doing previously with a movie id, I want to do something similar with discover:

So firstly I have took the discover url and I can see via cURL it returns thousands of results via: https://api.themoviedb.org/3/discover/movie/?page=1&include_video=false&include_adult=false&sort_by=popularity.desc&language=en-US&api_key=REDACTED

It is returning thousands of results, so I look at the discover docs, https://developers.themoviedb.org/3/discover/movie-discover the query strings listed on this page do not have ID, so overall how would I specify the request url to only do one movie? I noticed it has page = 1 but I have no idea what this means...?

Basically @travisbell I just want to obtain one movie from the API using discover.

Não consegue encontrar um certo Filme ou Série? Inicie Sessão e adicione-o.

Geral

s focus the search bar
p abrir menu do perfil
esc close an open window
? open keyboard shortcut window

Em páginas de Média

b go back (or to parent when applicable)
e ir para a página de edição

Em Páginas de Temporadas de Séries

(seta para a direita) ir para a próxima temporada
(seta para a esquerda) ir para a temporada anterior

Em Páginas de Episódios de Séries

(seta para a direita) ir para o próximo episódio
(seta para a esquerda) ir para o episódio anterior

Em Todas as Páginas de Imagens

a abrir janela para adicionar imagem

Em Todas as Páginas de Edição

t open translation selector
ctrl+ s submit form

Em Páginas de Discussão

n criar uma nova discussão
w toggle watching status
p toggle public/private
c toggle close/open
a abrir actividade
r reply to discussion
l ir para a última resposta
ctrl+ enter submit your message
(seta para a direita) página seguinte
(seta para a esquerda) página anterior

Definições

Deseja classificar ou adicionar este item a uma lista?

Iniciar Sessão

Ainda não é um membro?

Crie uma Conta e Adere a Comunidade