Automatic sync from IMDb to Trakt (watchlist, lists, ratings and history) using GitHub actions

sync

imdb-trakt-sync

GoLang app that can sync IMDb and Trakt user data - watchlist, ratings and lists.
For its data needs, the app is communicating with the IMDb and Trakt APIs directly.
The app can be set up to run on a custom schedule (default: once every 3 hours) through GitHub Actions.

Usage

The application can be 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.

GitHub Actions

  1. Fork this repository to your account
  2. Configure your GitHub repository secrets using the .env.example file as reference:
    1. Retrieve the at-main and ubid-main cookies by logging into your IMDb account and inspecting the cookies using your favourite web browser
    2. Create Trakt API app
    3. Retrieve a Trakt access token:
      1. Get a Trakt code by opening the Trakt API app that you created in the previous step and click the Authorize button
      2. Using the code from the previous step together with your Trakt API app's client id & client secret, replace the values in this request:
      curl --include \
      --request POST \
      --header "Content-Type: application/json" \
      --data-binary "{
      \"code\": \"fd0847dbb559752d932dd3c1ac34ff98d27b11fe2fea5a864f44740cd7919ad0\",
      \"client_id\": \"9b36d8c0db59eff5038aea7a417d73e69aea75b41aac771816d2ef1b3109cc2f\",
      \"client_secret\": \"d6ea27703957b69939b8104ed4524595e210cd2e79af587744a7eb6e58f5b3d2\",
      \"redirect_uri\": \"urn:ietf:wg:oauth:2.0:oob\",
      \"grant_type\": \"authorization_code\"
      }" \
      'https://api.trakt.tv/oauth/token'
    4. Create repository secrets: Settings > Secrets > Actions > New repository secret
  3. Enable GitHub Actions for the fork repository
  4. Enable the sync workflow, as scheduled workflows are disabled by default in fork repositories
  5. 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

Run the application locally

  1. Clone this repo to your machine
  2. Make a copy of the .env.example file and name it .env
  3. Populate all the environment variables in that file using the existing values as reference:
    1. Retrieve the at-main and ubid-main cookies by logging into your IMDb account and inspecting the cookies using your favourite web browser
    2. Create Trakt API app
    3. Retrieve a Trakt access token:
      1. Get a Trakt code by opening the Trakt API app that you created in the previous step and click the Authorize button
      2. Using the code from the previous step together with your Trakt API app's client id & client secret, replace the values in this request:
      curl --include \
      --request POST \
      --header "Content-Type: application/json" \
      --data-binary "{
      \"code\": \"fd0847dbb559752d932dd3c1ac34ff98d27b11fe2fea5a864f44740cd7919ad0\",
      \"client_id\": \"9b36d8c0db59eff5038aea7a417d73e69aea75b41aac771816d2ef1b3109cc2f\",
      \"client_secret\": \"d6ea27703957b69939b8104ed4524595e210cd2e79af587744a7eb6e58f5b3d2\",
      \"redirect_uri\": \"urn:ietf:wg:oauth:2.0:oob\",
      \"grant_type\": \"authorization_code\"
      }" \
      'https://api.trakt.tv/oauth/token'
  4. Make sure you have GoLang installed on your machine
  5. Open a terminal window in the repository folder and run the application using this command go run .
Comments
  • Error running sync action:

    Error running sync action: "error scraping trakt pin code: pin code not found"

    I followed the instructions in the README about setting up the environment variables for GitHub Actions in a forked repository. When manually running the "sync" action in GitHub on my forked repository, I get the following output:

    Run go run cmd/imdb-trakt-sync/main.go
    go: downloading github.com/joho/godotenv v1.4.0
    go: downloading github.com/PuerkitoBio/goquery v1.8.0
    go: downloading github.com/andybalholm/cascadia v1.3.1
    go: downloading golang.org/x/net v0.0.0-20210916014120-12bc252f5db8
    2022/11/08 19:30:56 error scraping trakt pin code: pin code not found
    exit status 1
    Error: Process completed with exit code 1.
    
  • Cant get your imdb-trakt sync repo to run

    Cant get your imdb-trakt sync repo to run

    I created the Trakt Api-App with the recommended "urn:ietf:wg:oauth:2.0:oob" url and get a Code like one if i'm about to add a new device. I added this code to the reqbin.com/veotsc62 Snippet and got an access token which I added in the template of the branch secret action (also I added all other Values from IBMD and Trakt). I'm totally new to github and only got here, because I wanted to sync my imdb records with the one of trakt. :-)

    Im always getting an sync error: Process completed with exit code 1.

    Currently I'm out of options and would kindly ask for some help.

    I'm not sure this is the right way, or place to do so, but i didn't find a "contact" form of any kind.

    Thanks in advance Sky

  • Sync movie ratings and add to watched history

    Sync movie ratings and add to watched history

    Hey, I just stumbled across your project and it works amazing. I only got one little feature request:

    Would it be possible to mark a movie as watched on Trakt when the rating from IMDb is synced? I now only got the rating synced but it's not in the history.

    Best Regards

    Nico

  • TRAKT_ACCESS_TOKEN retrieval

    TRAKT_ACCESS_TOKEN retrieval

    Could you verify the steps provided in the README?

    I was unable to locate the correct value to use as the TRAKT_ACCESS_TOKEN environment variable through their site. I had to resort to this random website to pull the token for me.

  • Sync failing

    Sync failing

    Hello, The repository and many other forks are getting this error while syncing.

    imagem

    This problem is due to the Trakt website being down. Anyone with this problem can track the Trakt status on https://status.trakt.tv

github-actions-merger is github actions that merges pull request with commit message including pull request labels.

github-actions-merger github-actions-merger is github actions that merges pull request with commit message including pull request labels. Usage Write

Dec 7, 2022
A simple Go app and GitHub workflow that shows how to use GitHub Actions to test, build and deploy a Go app to Docker Hub

go-pipeline-demo A repository containing a simple Go app and GitHub workflow that shows how to use GitHub Actions to test, build and deploy a Go app t

Nov 17, 2021
grafana-sync Keep your grafana dashboards in sync.

grafana-sync Keep your grafana dashboards in sync. Table of Contents grafana-sync Table of Contents Installing Getting Started Pull Save all dashboard

Dec 14, 2022
A reverse engineered github actions compatible self-hosted runner using nektos/act to execute your workflow steps

github-act-runner A reverse engineered github actions compatible self-hosted runner using nektos/act to execute your workflow steps. Unlike the offici

Dec 24, 2022
Example goreleaser + github actions config with keyless signing and SBOM generation

supply-chain-example GoReleaser + Go Mod proxying + Cosign keyless signing + Syft SBOM generation example. How it works GoReleaser manages the entire

Nov 15, 2022
toghsh translates github actions workflows to shell scripts

togsh - extracts shell commands from github actions workflows toghsh is a helper tool to translate github action workflows into equivalent shell scrip

Nov 16, 2021
CI/CD with Jenkins, GitHub Actions, Travis CI etc

CI/CD with Jenkins, GitHub Actions, Travis CI etc This is a simple repository built using Golang with the main purpose to try out different CI/CD tool

Nov 11, 2021
Gophercon lab "Get Go-ing with GitHub Actions"

GitHub Action Using Go This is a starting point for a GitHub Action based in Go. This repo provides all the structure needed to build a robust GitHub

Dec 8, 2021
Jan 4, 2022
Generic inquiry tool to OPA server for CI process, such as GitHub Actions

opaq opaq is a generic inquiry tool to OPA server. A major purpose of this tool is for inquiry in GitHub Actions. Features Data formatting: OPA server

Jan 20, 2022
Download your Fitbit weight history and connect to InfluxDB and Grafana

WemonFit Weight monitoring for Fitbit, using InfluxDB and Grafana Generating a new certificate openssl req -new -newkey rsa:2048 -nodes -keyout lo

Oct 22, 2022
Lists some Kubernetes resources in cluster or at hosts.

k8s-native-app Containerized this: go build After building this we have binary files to dockerize. Create Dockerfile. docker build -t project-clientgo

Feb 12, 2022
Simple example using Git actions + Argo CD + K8S + Docker and GO lang

CICD-simple_example Simple example using Git actions + Argo CD + K8S + Docker and GO lang Intro Pre reqs Have an ArgoCD account and Installed. Docker

Oct 28, 2021
Container actions using Golang Docker SDK

container-go Prototyping continuous integration for microservices using only Gol

Dec 28, 2021
Create changelogs for Helm Charts, based on git history

helm-changelog Create changelogs for Helm Charts, based on git history. The application depends on the assumption that the helm chart is released on t

Nov 27, 2022
GitOops is a tool to help attackers and defenders identify lateral movement and privilege escalation paths in GitHub organizations by abusing CI/CD pipelines and GitHub access controls.
GitOops is a tool to help attackers and defenders identify lateral movement and privilege escalation paths in GitHub organizations by abusing CI/CD pipelines and GitHub access controls.

GitOops is a tool to help attackers and defenders identify lateral movement and privilege escalation paths in GitHub organizations by abusing CI/CD pipelines and GitHub access controls.

Jan 2, 2023
General-purpose actions for test and release in Go

go-actions This repository provides general-purpose actions for Go. setup This action runs actions/setup-go with actions/cache. For example, jobs: l

Nov 28, 2021
A Kubernetes operator that allows for automatic provisioning and distribution of cert-manager certs across namespaces

cached-certificate-operator CachedCertificate Workflow When a CachedCertificate is created or updated the operator does the following: Check for a val

Sep 6, 2022
Provider-generic-workflows - A generic provider which uses argo workflows to define the backend actions.

provider-generic-workflows provider-generic-workflows is a generic provider which uses argo workflows for managing the external resource. This will re

Jan 1, 2022