Assistance de TMDB

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 réponses (sur la page 1 sur 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.

Un film, une émission télévisée ou un artiste est introuvable ? Connectez-vous afin de créer une nouvelle fiche.

Général

s Mettre le curseur dans la barre de recherche
p Ouvrir le menu du profil
esc Fermer une fenêtre ouverte
? Ouvrir la fenêtre des raccourcis clavier

Sur les pages des médias

b Retour (ou vers le parent si faisable)
e Afficher la page de modification

Sur les pages des saisons des émissions télévisées

Afficher la saison suivante (flèche droite)
Afficher la saison précédente (flèche gauche)

Sur les pages des épisodes des émissions télévisées

Afficher l'épisode suivant (flèche droite)
Afficher l'épisode précédent (flèche gauche)

Sur toutes les pages des images / photos

a Ouvrir la fenêtre d'ajout d'image / photo

Sur toutes les pages de modifications

t Ouvrir le sélecteur de traduction
ctrl+ s Envoyer le formulaire

Sur les pages des discussions

n Créer une nouvelle discussion
w Basculer le statut de suivi
p Basculer publique / privée
c Basculer fermer / ouvrir
a Ouvrir l'activité
r Répondre à la discussion
l Afficher la dernière réponse
ctrl+ enter Envoyer votre message
Page suivante (flèche droite)
Page précédente (flèche gauche)

Paramètres

Vous souhaitez évaluer ou ajouter cet élément à une liste ?

Connexion