دعم الموقع

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 ردود (على هذه الصفحة 1 من 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.

لم تجد الفلم أو المسلسل ؟ سجل دخولك و انشئها

عام

s ركز شريط البحث
p افتح قائمة الملف الشخصي
esc اغلق النافذة المفتوحة
? افتح نافذة اختصارات لوحة المفاتيح

على كافة صفحات الوسائط

b ارجع للخلف (او للصفحة الام عند التطبيق)
e انتقل لصفحة التعديل

على كافة صفحات موسم المسلسل

(السهم الايمن) انتقل للموسم التالي
(السهم الايسر) انتقل للموسم السابق

على كافة صفحات حلقة المسلسل

(السهم الايمن) انتقل للحلقة التالية
(السهم الايسر) انتقل للحلقة السابقة

على كافة صفحات الصور

a افتح صفحة اضافة الصورة

على كافة صفحات التعديل

t افتح محدد الترجمة
ctrl+ s ارسال النموذج

على صفحات المناقشة

n انشى نقاش جديد
w تبديل حالة المتابعة
p تبديل عام / خاص
c تبديل اغلاق / فتح
a افتح الانشطة
r رد على النقاش
l انتقل لأخر رد
ctrl+ enter أرسل رسالتك
(السهم الايمن) الصفحة التالية
(السهم الايسر) الصفحة السابقة

الاعدادات

هل تريد تقييم او اضافة هذا العنصر للقائمة؟

تسجيل الدخول