You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fromtmdbv3api.exceptionsimportTMDbExceptionfromtmdbv3apiimportTMDb, Moviefromlib.Globalsimporttmdb_api_keyimporttimedefscrape_from_tmdb_popular(max_pages=500):
tmdb=TMDb()
tmdb.api_key=tmdb_api_keytmdb_movie=Movie()
whileTrue:
forpageinrange(1, max_pages):
popular_movies=tmdb_movie.popular(page=page)
forpopular_movieinpopular_movies:
name, tmdb_id=popular_movie.get('original_title'), popular_movie.get('id')
print(name)
ifnotnameornottmdb_id:
print(f"Continuing due to no name or tmdb id")
continuetry:
imdb_id=tmdb_movie.external_ids(tmdb_id).get('imdb_id')
exceptTMDbException:
print(f"Continuing due to no name or imdb id")
continueexceptExceptionasE:
print(f"Continuing due to other error {E}")
continuetime.sleep(1)
scrape_from_tmdb_popular()
The text was updated successfully, but these errors were encountered:
The text was updated successfully, but these errors were encountered: