دعم الموقع

Hi!

The question is, I don't quite understand how to get all the movies that were released in the last 24 hours. I need the Premiere, Digital and Physical categories.

Can you tell me if I'm using the wrong API branch in the query?

How can I get the query to return me all movies and cartoons released in the last 24 hours in the above categories without sorting by popularity, but a simple list.

I've been struggling with this problem for a few days now and still can't win. Thank you!

Now my query looks like this and it's not correct:

def get_movies(category):
    # URL to query The Movie Database API
    url = 'https://api.themoviedb.org/3/discover/movie'
    url += '? api_key=' + tmdb_api_key
    url += '&sort_by=popularity.desc'
    url += '&include_adult=true'
    url += '&include_video=false'
    url += '&page=1'
    url += '&primary_release_date.gte=' + str(datetime.date.today() - datetime.timedelta(days=1))
    url += '&primary_release_date.lte=' + str(datetime.date.today())
    url += '&with_release_type='

8 ردود (على هذه الصفحة 1 من 1)

Jump to last post

@Chandz said:
Problem with API request
Hi!
The question is, I don't quite understand how to get all the movies that were released in the last 24 hours.
I need the Premiere, Digital and Physical categories.

Only in any of these categories: Premiere or Digital or Physical. That is 1|4|5
with_release_type
1 Premiere
2 Theatrical (limited)
3 Theatrical
4 Digital
5 Physical
6 TV

Can you tell me if I'm using the wrong API branch in the query?

Yes, Discover is correct.

How can I get the query to return me all movies and cartoons released in the last 24 hours
in the above categories without sorting by popularity, but a simple list.

If you don't specify sort_by, by default you will receive, if I'm not mistaken, by popularity.desc.
Maybe in your specific case original_title.desc is better.

I've been struggling with this problem for a few days now and still can't win. Thank you!

Now my query looks like this and it's not correct:

def get_movies(category):
    # URL to query The Movie Database API
    url = 'https://api.themoviedb.org/3/discover/movie'
    url += '? api_key=' + tmdb_api_key
    url += '&sort_by=popularity.desc'
    url += '&include_adult=true'
    url += '&include_video=false'
    url += '&page=1'
    url += '&primary_release_date.gte=' + str(datetime.date.today() - datetime.timedelta(days=1))
    url += '&primary_release_date.lte=' + str(datetime.date.today())
    url += '&with_release_type='

Apparently everything is correct.
I just don't see the specification of with_release_type in your API Request.
I think they should be &with_release_type=1|4|5.
And maybe you should specify &region=US or some other country.
That is, something like this:

https://api.themoviedb.org/3/discover/movie?api_key=THE_KEY&language=en-US&region=US&sort_by=original_title.desc&include_adult=true&include_video=false&page=1&primary_release_date.gte=2023-04-21&primary_release_date.lte=2023-04-21&with_release_type=1|4|5

What you didn't say is what the error was in the response.
Did movies come with the wrong release dates?

@ticao2 said:

@Chandz said:
Problem with API request
Hi!
The question is, I don't quite understand how to get all the movies that were released in the last 24 hours.
I need the Premiere, Digital and Physical categories.

Only in any of these categories: Premiere or Digital or Physical. That is 1|4|5
with_release_type
1 Premiere
2 Theatrical (limited)
3 Theatrical
4 Digital
5 Physical
6 TV

Can you tell me if I'm using the wrong API branch in the query?

Yes, Discover is correct.

How can I get the query to return me all movies and cartoons released in the last 24 hours
in the above categories without sorting by popularity, but a simple list.

If you don't specify sort_by, by default you will receive, if I'm not mistaken, by popularity.desc.
Maybe in your specific case original_title.desc is better.

I've been struggling with this problem for a few days now and still can't win. Thank you!

Now my query looks like this and it's not correct:

def get_movies(category):
    # URL to query The Movie Database API
    url = 'https://api.themoviedb.org/3/discover/movie'
    url += '? api_key=' + tmdb_api_key
    url += '&sort_by=popularity.desc'
    url += '&include_adult=true'
    url += '&include_video=false'
    url += '&page=1'
    url += '&primary_release_date.gte=' + str(datetime.date.today() - datetime.timedelta(days=1))
    url += '&primary_release_date.lte=' + str(datetime.date.today())
    url += '&with_release_type='

Apparently everything is correct.
I just don't see the specification of with_release_type in your API Request.
I think they should be &with_release_type=1|4|5.
And maybe you should specify ®ion=US or some other country.
That is, something like this:

https://api.themoviedb.org/3/discover/movie?api_key=THE_KEY&language=en-US®ion=US&sort_by=original_title.desc&include_adult=true&include_video=false&page=1&primary_release_date.gte=2023-04-21&primary_release_date.lte=2023-04-21&with_release_type=1|4|5

What you didn't say is what the error was in the response.
Did movies come with the wrong release dates?

Hi! I just get the wrong list of movies, and with this query it is also the same in three categories. There are no errors, everything works, just somewhat incorrectly:(

Here is an example of full function with corrected query.

def get_movies(category):
    # URL для запроса к API The Movie Database
    url = f'https://api.themoviedb.org/3/discover/movie?api_key={tmdb_api_key}&sort_by=original_title.desc&include_adult=true&include_video=false&page=1&primary_release_date.gte={datetime.date.today() - datetime.timedelta(days=1)}&primary_release_date.lte={datetime.date.today()}&with_release_type=3|4|5'

    # Отправляем запрос к API
    response = requests.get(url)
    data = response.json()
    results = data.get('results', [])
    movies = []

@Chandz said:

Here is an example of full function with corrected query.

Confirming, you got it working then?

@travisbell said:

@Chandz said:

Here is an example of full function with corrected query.

Confirming, you got it working then?

Unfortunately, no. Now I get the same lists for three categories in response. Comparing with the released movies on the site, the dates are incorrect:(

In any case, I was wonderfully guided in the right direction, I have a suspicion that my deltatime is not working correctly. I will try to look for the problem there, thank you very much!

The website uses localized dates when possible so there's no guarantee they'll match what you query on the website. You can however, try querying you're own region on the API with the region param.

I have a problem when testing app on physical device err 'certificate expired' occur on every image try to load

@aamer1986 said:
I have a problem when testing app on physical device err 'certificate expired' occur on every image try to load

I believe that your problem has no correlation with the original problem of this conversation.
I suggest that you create a new topic with your specific problem.
Including informing which APP you are talking about.

Do not forget to inform what is the error response sent by the TMDb server.
See the list here: https://developer.themoviedb.org/docs/errors

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

عام

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

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

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

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

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

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

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

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

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

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

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

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

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

الاعدادات

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

تسجيل الدخول