Skip to content

Instantly share code, notes, and snippets.

@russkel
Created May 1, 2022 04:43
Show Gist options
  • Save russkel/8d5926ec190ae300e772d9886915fa1a to your computer and use it in GitHub Desktop.
Save russkel/8d5926ec190ae300e772d9886915fa1a to your computer and use it in GitHub Desktop.
TMDB list to CSV for import on Letterboxd
import tmdbsimple as tmdb
import csv
tmdb.API_KEY = 'YOUR API KEY HERE'
list_id = ID OF THE LIST
movies = tmdb.Lists(list_id).info()['items']
movie_ids = [mov['id'] for mov in movies]
with open(f"tmdb_{list_id}.csv", "w") as f:
csvwriter = csv.writer(f)
csvwriter.writerow(['tmdbID'])
for mid in movie_ids:
csvwriter.writerow([mid])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment