And how can i increase the maximum data per api request? if i want to get the description the data is cut off in the middle. that results in an err
For better understanding here ist the pull process (shorted):
def movie_db_post_request(url):
headers = {
"accept": "application/json",
"Authorization": f"Bearer {tmdb_key}"
}
return requests.get(url, headers=headers)
language = "de-DE"
movie_id = "Star Wars"
basis_url = 'https://api.themoviedb.org/3/search/movie?'
url = f'{basis_url}query={movie_id}&language={language}&page=1'
response = movie_db_post_request(url)
data = response.json()
print("DATA respponse.json():", data)
first_movie = data["results"][0]
element = {
"id": index,
"title": first_movie ["original_title"],
"description": first_movie ["overview"],
"rating": first_movie ["runtime"],
"image": f'https://image.tmdb.org/t/p/w500{first_movie ["poster_path"]}',
"videoUrl": f'https://www.youtube.com/results?search_query={first_movie ["original_title"]}'
}
Kan du inte hitta en film eller tv-serie? Logga in för att skapa den.
Vill du betygsÀtta denna artikel eller lÀgga till den i en lista?
Inte medlem?
Svar frÄn wired87
den 12 januari 2024 vid 3:00 PM
For example looks like this: 2024-01-12 19:43:21 DATA response.json(): {'page': 1, 'results': [{'adult': False, 'backdrop_path': '/6t8ES1d12OzWyCGxBeDYLHoaDrT.jpg', 'genre_ids': [28, 12, 878], 'id': 330459, 'original_language': 'en', 'original_title': 'Rogue One: A Star Wars Story', 'overview': 'Die mehrfach verurteilte Jyn Erso passt gut ins Anforderungsprofil fĂŒr die Rebellion gegen das galaktische Imperium. Sie ist hart, kompromisslos und steht auĂerhalb der Gesellschaft. Aber es gibt noch einen weiteren, ganz speziellen Grund fĂŒr ihre Anheuerung. Ihr Vater wurde vor Jahren von dem imperialen Karrieristen Krennic dazu gezwungen, fĂŒr den Imperator eine neue Superwaffe zu entwickeln: den Todesstern. Dabei hat er heimlich eine Schwachstelle eingebaut und diese mit einem Hilferuf an die Rebellenallianz geschickt. Um diese SchwĂ€che ausnĂŒtzen zu können, bedarf es allerdings der genauen BauplĂ€ne der Waffe. Zusammen mit dem Spion Cassian Andor und einer Schar unerschrockener KĂ€
Svar frĂ„n ticao2 đ§đ· pt-BR
den 12 januari 2024 vid 5:05 PM
What language is specified in "&language=" in the API Request?
de-DE (Germany) or de-AT (Austria)?
Problems with API Request
In order for someone to help you with API Request questions,
it is critical that you post here the API Request you are sending to the TMDb server.
Remember to replace your Key with MY_KEY , YOUR_KEY , THE_KEY , or something like that.
Not the programming code/script you used to build the API Request.
But the API Request that is sent to the TMDb server.
Or the API Request you would like to send.
Svar frÄn wired87
den 13 januari 2024 vid 5:15 AM
Alright, i have updated it. (there may are some spelling errors because i was typing it here in the box but in my IDE i dont ahve any Synthax errors)
Svar frĂ„n ticao2 đ§đ· pt-BR
den 13 januari 2024 vid 4:24 PM
I tested using my Firefox browser.
https://api.themoviedb.org/3/search/movie?api_key=THE_KEY&query=Star%20Wars&language=de-DE&page=1
Could you test the same using the API Request above in a new tab in your browser?
And also again your Request to check if the answers are different?
I believe I received the correct answer, the entire text.