Created
May 1, 2022 04:43
-
-
Save russkel/8d5926ec190ae300e772d9886915fa1a to your computer and use it in GitHub Desktop.
TMDB list to CSV for import on Letterboxd
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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