.vscode | ||
.gitignore | ||
README.md | ||
TimeToTrackt.py |
TV Time to Trakt (Import Script)
A quick Python script to import TV Time tracked episode data into Trakt.TV - using data provided by Whip Media Company via a GDPR request.
Issues
They'll be a few! If you come across anything then let me know in the 'Issue' section, and I'll provide help where possible.
Notes
- 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.
- A delay of 5 seconds is added between each episode to ensure fair use of Trakt's servers - especially with my import of 6,500 episodes. You should adjust this for your own import.
- Episodes which have been processed will be saved to a TinyDB file
localStorage.json
- then 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. So, 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!
- Copy the template provided by www.datarequests.org into an email.
- Send it to support@tvtime.com
- Wait a few working days to process the request
- Extract the data somewhere safe.
Register API Access at Trakt
- Go to "Settings" under your profile
- Select "Your API Applications"
- Select "New Application"
- Provide a name into "Name" e.g John Smith Import from TV Time
- Paste "urn:ietf:wg:oauth:2.0:oob" into "Redirect uri:"
- Click "Save App"
- Make note of your details to be used later.
Setup Script
Install Required Libraries
Install the following frameworks via Pip:
- trakt
- tinydb
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"
}
Then, execute the program using ./python3 TimeToTrakt.py
- make sure to pop back during a long import to provide the correct Trakt TV Show selections.