The Movie Database Support

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 replies (on page 1 of 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.

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