humza7656 commited on
Commit
2c55c1f
·
verified ·
1 Parent(s): c9e3950

Update actor_info.py

Browse files
Files changed (1) hide show
  1. actor_info.py +4 -2
actor_info.py CHANGED
@@ -17,7 +17,9 @@ def actor_it(id:int):
17
  data=response.json()
18
  gender_get='Male' if data.get('gender')==2 else 'Female'
19
  movies = data.get("movie_credits", {}).get("cast", [])
20
- print(len(movies))
 
 
21
  work_list=[
22
  {
23
  'Id':movie.get('id'),
@@ -32,7 +34,7 @@ def actor_it(id:int):
32
  )
33
 
34
  }
35
- for movie in movies]
36
  data_list.append({
37
  'Name':data.get('name'),
38
  'Profile_pic':f"https://image.tmdb.org/t/p/w500{data.get('profile_path')}",
 
17
  data=response.json()
18
  gender_get='Male' if data.get('gender')==2 else 'Female'
19
  movies = data.get("movie_credits", {}).get("cast", [])
20
+ movie_length=len(movies)
21
+ if movie_length>8:
22
+ movie_length=8
23
  work_list=[
24
  {
25
  'Id':movie.get('id'),
 
34
  )
35
 
36
  }
37
+ for movie in range(movie_length)]
38
  data_list.append({
39
  'Name':data.get('name'),
40
  'Profile_pic':f"https://image.tmdb.org/t/p/w500{data.get('profile_path')}",