xbgmsharp / trakt

Import CSV to Trakt.tv list and Export Trakt.tv list into CSV
GNU General Public License v3.0
284 stars 47 forks source link

Trakt.tv tools

Purpose

Requirements

You must use Python 3.x.

On Docker

To run Docker hub image

$ docker pull xbgmsharp/docker-trakt-tools
$ docker run -it --rm --name my-trakt-tools xbgmsharp/docker-trakt-tools python export_trakt.py -v
export_trakt.py 0.3

You might need to use the --privileged options on some case/

$ docker run --privileged -it --rm --name my-trakt-tools xbgmsharp/docker-trakt-tools python export_trakt.py -v
export_trakt.py 0.3

Create and edit default config

$ docker run -it --rm \
  --name my-trakt-tools \
  -v $(pwd):/trakt/export \
  -v $(pwd):/trakt/config \
  xbgmsharp/docker-trakt-tools \
  python export_trakt.py -c config/config.ini

Run export

$ docker run -it --rm \
  --name my-trakt-tools \
  -v $(pwd):/trakt/export \
  -v $(pwd):/trakt/config \
  xbgmsharp/docker-trakt-tools \
  python export_trakt.py -c config/config.ini -o export/export_movies_history.csv

my-trakt-tools is the container name.

xbgmsharp/docker-trakt-tools is the image name.

To build the image

$ docker build -t xbgmsharp/docker-trakt-tools .

To build the multi-arch image

$ ./multi-arch-docker-ci.sh

On Ubuntu/Debian Linux system

Ensure you are running Python 3

$ python -V
Python 3.5

Install need module dependencies, python3-openssl and jq are optional

$ apt-get install python3-dateutil python3-simplejson python3-requests python3-openssl jq

On Arch/Manjaro Linux system

Install dependencies with pacman, python-pyopenssl and jq are optional

$ pacman -S python python-dateutil python-simplejson python-requests python-pyopenssl jq 

On Windows system

Download the installer: https://www.python.org/downloads/windows/

Ensure you are running Python 3

<python dir>>python.exe -V
Python 3.5

Install need module dependencies

<python dir>\Scripts\pip3.exe install requests simplejson

On macOS system

Download the installer: https://www.python.org/downloads/mac-osx/

Append to PATH in ZSH

$ path=('/Library/Frameworks/Python.framework/Versions/3.8/bin' $path)

Ensure you are running Python 3

$ python3 -V
Python 3.8.5

Run Install Certificates.command

$ pip3 install certifi

Open a new Terminal session so that certificates will be available

Install need module dependencies, pyopenssl and jq are optional

$ pip3 install python-dateutil
$ pip3 install simplejson
$ pip3 install requests
$ pip3 install pyopenssl
$ pip3 install jq

Usage

$ python export_trakt.py
$ vim config.ini
$ python export_trakt.py

Configuration

Configuration sample

[TRAKT]
client_id = xxxxxxxxxxxxxxxxxxxxxxxxx
client_secret = xxxxxxxxxxxxxxxxxxxxxx
access_token =
refresh_token =
baseurl = https://api-v2launch.trakt.tv
[SETTINGS]
proxy = False
proxy_host = https://127.0.0.1
proxy_port = 3128

Configuration details

Developer documentation

$ pydoc `pwd`/import_trakt.py
$ pydoc `pwd`/export_trakt.py
$ pydoc `pwd`/sync_tmdb_trakt.py

Howto

Import

Import CSV into trakt.tv

Export

Export data from trakt.tv into CSV

Sync

Create trakt.tv list from TDMB discover with filter

Export data from Kodi

Export Movies or TVShows IDs from Kodi into CSV file format. Export data from Kodi

Export data from CouchPotato

Export Movies IDs from CouchPotato into CSV file format. Export data from CouchPotato

Support

To get support, please create new issue

Contribution

I'm happy to accept Pull Requests!

License

This script is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

See http://www.gnu.org/licenses/gpl.html.