GoLang app that can sync IMDb and Trakt user data - watchlist,
lists, ratings and history.
To achieve its goals the application is using the Trakt API and web scraping the IMDb website.
Keep in mind that this application is performing a one-way sync from IMDb to Trakt. This means that anything you change
in IMDb will be reflected on Trakt. However, anything you change in Trakt will be overwritten by the state you have in IMDb.
As much as I wanted to provide a two-way sync functionality, this will not be possible until IMDb decides to expose a public API.
The application can be setup to run automatically, based on a custom schedule (default: once every 3 hours) using
GitHub Actions
or locally on your machine. Follow the relevant section below, based on how you want to use the application.
- Fork the repository to your account
- Retrieve a Trakt access token:
- Create a Trakt API application
- Give it a name and use
urn:ietf:wg:oauth:2.0:oob
as redirect uri. The rest of the fields can be left empty - Get a Trakt code by opening the Trakt API app that you created in the previous step and click the
Authorize
button - Using the code from the previous step along with your Trakt API app's client id & client secret, replace the contents
in the request body (content menu) of this prepared http request - Execute the http request by clicking
Send
. If it was successful the status code will be200
. Any other status
code means something is wrong - ensure everything is properly formatted and nothing is missing - Fetch your access token from the response. The property is called
access_token
- Configure GitHub repository secrets:
- All the secrets (a.k.a. environment variables) are listed in the .env.example file
- Open the repository secrets dashboard of your fork
- Create repository secrets:
Settings
>Secrets
>Actions
>New repository secret
- Repeat the previous step for each secret individually
- The repository secrets dashboard should look similar to this:
- Enable GitHub Actions for the fork repository
- Enable the
sync
workflow, as scheduled workflows are disabled by default in fork repositories - The
sync
workflow can be triggered manually right away to test if it works. Alternatively, wait for GitHub actions
to automatically trigger it every 3 hours
- Clone the repository to your machine
- Retrieve a Trakt access token:
- Create a Trakt API application
- Give it a name and use
urn:ietf:wg:oauth:2.0:oob
as redirect uri. The rest of the fields can be left empty - Get a Trakt code by opening the Trakt API app that you created in the previous step and click the
Authorize
button - Using the code from the previous step along with your Trakt API app's client id & client secret, replace the contents
in the request body (content menu) of this prepared http request - Execute the http request by clicking
Send
. If it was successful the status code will be200
. Any other status
code means something is wrong - ensure everything is properly formatted and nothing is missing - Fetch your access token from the response. The property is called
access_token
- Make a copy of the .env.example file and name it
.env
- Populate all the environment variables in that file using the existing values as reference
- Make sure you have GoLang installed on your machine. If you do not have it, this is how you can install it.
- Open a terminal window in the repository folder and run the application using the command
go run .