Coder Social home page Coder Social logo

tvtimetotrakt's Introduction

TV Time to Trakt - Import Script

A Python script to import TV Time tracked episode data into Trakt.TV - using data export provided by TV Time through a GDPR request.

Issues

They'll be a few! This was quickly put together within a few hours or so for personal usage. If you come across anything then let me know in the 'Issue' section, and I'll provide support where possible.

Notes

  1. The script is using limited data provided from a GDPR request - so the accuracy isn't 100%. But you will be prompted to manually pick the Trakt show, when it can't be determined automatically.
  2. A delay of 1 second is added between each episode to ensure fair use of Trakt's API server. You can adjust this for your own import, but make sure it's at least 0.75 second to remain within the rate limit: https://trakt.docs.apiary.io/#introduction/rate-limiting
  3. Episodes which have been processed will be saved to a TinyDB file localStorage.json - when you restart the script, the program will skip those episodes which have been marked 'imported'.

Setup

Get your Data

TV Time's API is not open. In order to get access to your personal data, you will have to request it from TV Time's support via a GDPR request - or maybe just ask for it, whatever works, it's your data.

  1. Copy the template provided by www.datarequests.org into an email
  2. Send it to [email protected]
  3. Wait a few working days for their team to process your request
  4. Extract the data somewhere safe on your local system

Register API Access at Trakt

  1. Go to "Settings" under your profile
  2. Select "Your API Applications"
  3. Select "New Application"
  4. Provide a name into "Name" e.g John Smith Import from TV Time
  5. Paste "urn:ietf:wg:oauth:2.0:oob" into "Redirect uri:"
  6. Click "Save App"
  7. Make note of your details to be used later.

Setup Script

Install Required Libraries

Install the following frameworks via Pip:

python -m pip install -r requirements.txt

Setup Configuration

Create a new file named config.json in the same directory of TimeToTrakt.py, using the below JSON contents (replace the values with your own).

{
    "CLIENT_ID": "YOUR_CLIENT_ID",
    "CLIENT_SECRET": "YOUR_CLIENT_SECRET",
    "GDPR_WORKSPACE_PATH": "DIRECTORY_OF_YOUR_GDPR_REQUEST_DATA",
    "TRAKT_USERNAME": "YOUR_TRAKT_USERNAME"
}

Once the config is in place, execute the program using python TimeToTrakt.py. The process isn't 100% automated - you will need to pop back, especially with large imports, to check if the script requires a manual user input.

Credit

City vector created by freepik - www.freepik.com

tvtimetotrakt's People

Contributors

baprx avatar lukearran avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.