Spaces:
Running
Running
from imdb import IMDb | |
ia = IMDb() | |
def search_imdb(title): | |
results = ia.search_movie(title) | |
if not results: | |
return "No results found" | |
top = results[0] | |
ia.update(top) | |
return { | |
"Title": top.get("title"), | |
"Year": top.get("year"), | |
"Rating": top.get("rating"), | |
"Genres": top.get("genres"), | |
"Plot": top.get("plot")[0] if top.get("plot") else "No plot available" | |
} | |