Script for importing ratings and watched movies from MovieLens to Trakt.
Steps for running the script:
- Download movielens-ratings.csv and movielens-logs.csv from https://movielens.org/profile/settings/import-export by clicking "export ratings" and "export activity logs"
- Change the RATINGS_CSV and LOGS_CSV variables in secrets.py to point to the paths of the downloaded files
- Change the ACCESS_TOKEN and CLIENT_ID variables to your Trakt API access token and client ID (see steps below)
- Run the Python script
Steps to get Trakt API access token and client ID:
- Create a new app trakt.tv/oauth/applications/new
- Name it and set
urn:ietf:wg:oauth:2.0:oob
as the redirect uri.- Get your client_id, and go here, then either click on "Switch to Console" or "Try". Select body and replace the string here with your own client_id, send the query with "Call Resource"
- Go to trakt.tv/activate and use the
user_code
from the 200 response from the previous query- Go to trakt.docs.apiary.io/#reference/authentication-devices/get-token/poll-for-the-access_token?console=1 and use the
device_code
from the previous query alongside theclient_id
andclient_secret
from your app to finally fetch theaccess_token
(Source: josh/imdb-trakt-sync#8 (comment))
License: MIT