0

I have a project where I have to download a different backdrop(wide image) for each season of a series, I am using TMDB API, I went through their API Docs and used what I found however I end up with a single backdrop

my code

import requests
seriesname = 'Clarice'
seasnnumb = '1'
r = requests.get(f'https://api.themoviedb.org/3/search/tv? 
api_key=apikey&page=1&query={seriesname}')
response = r.json()
result = response.get('results')
print(result)

the response

[{'backdrop_path': '/eSVvx8xys2NuFhl8fevXt41wX7v.jpg',

'first_air_date': '2021-02-11',

'genre_ids': [80, 18],

'id': 103302,

'name': 'Clarice',

'origin_country': ['US'],

'original_language': 'en',

'original_name': 'Clarice',

'overview': 'In 1993, six months after the events of The Silence of the Lambs, FBI Agent Clarice 
 Starling returns to the field to pursue serial murderers and sexual predators while navigating the 
 high stakes political world of Washington, D.C.',

'popularity': 24.836,

'poster_path': '/7OFxU0bBO0HDL4klXmM1ahJPbv8.jpg',

'vote_average': 7.5,

'vote_count': 67}]

I tried the get Image method but it only returns posters

Amr
  • 119
  • 1
  • 10

1 Answers1

1

https://image.tmdb.org/t/p/original/

Append this to the backdrop/poster path. for example: 'backdrop_path': '/eSVvx8xys2NuFhl8fevXt41wX7v.jpg'

https://image.tmdb.org/t/p/original/eSVvx8xys2NuFhl8fevXt41wX7v.jpg //This is for original size

//You can also spicify size of the image to get like : https://image.tmdb.org/t/p/w{width}/eSVvx8xys2NuFhl8fevXt41wX7v.jpg for example: // To get image of size 500px you can use

https://image.tmdb.org/t/p/w500/eSVvx8xys2NuFhl8fevXt41wX7v.jpg //This is for width 500px size