Install pip modules using requirements.txt; Switch to 'python -m pip' to use the correct version of pip

This commit is contained in:
Baptiste Roux 2022-02-19 14:22:01 +01:00
parent f33b2bfb2e
commit b4e39be46b
No known key found for this signature in database
GPG Key ID: F2D53AA58807C6B5
1 changed files with 16 additions and 3 deletions

View File

@ -1,18 +1,23 @@
# TV Time to Trakt - Import Script # TV Time to Trakt - Import Script
![](https://loch.digital/image_for_external_apps/4342799-01.png) ![](https://loch.digital/image_for_external_apps/4342799-01.png)
A Python script to import TV Time tracked episode data into Trakt.TV - using data export provided by TV Time through a GDPR request. 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 # 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. 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 # 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. 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 5 seconds is added between each episode to ensure fair use of Trakt's API server. You should adjust this for your own import, but make sure it's at least 1 second to remain within the rate limit. 2. A delay of 5 seconds is added between each episode to ensure fair use of Trakt's API server. You should adjust this for your own import, but make sure it's at least 1 second to remain within the rate limit.
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'. 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 # Setup
## Get your Data ## 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. 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](https://www.datarequests.org/blog/sample-letter-gdpr-access-request/) into an email 1. Copy the template provided by [www.datarequests.org](https://www.datarequests.org/blog/sample-letter-gdpr-access-request/) into an email
@ -21,6 +26,7 @@ TV Time's API is not open. In order to get access to your personal data, you wil
4. Extract the data somewhere safe on your local system 4. Extract the data somewhere safe on your local system
## Register API Access at Trakt ## Register API Access at Trakt
1. Go to "Settings" under your profile 1. Go to "Settings" under your profile
2. Select ["Your API Applications"](https://trakt.tv/oauth/applications) 2. Select ["Your API Applications"](https://trakt.tv/oauth/applications)
3. Select "New Application" 3. Select "New Application"
@ -30,11 +36,17 @@ TV Time's API is not open. In order to get access to your personal data, you wil
7. Make note of your details to be used later. 7. Make note of your details to be used later.
## Setup Script ## Setup Script
### Install Required Libraries ### Install Required Libraries
Install the following frameworks via Pip: Install the following frameworks via Pip:
1. `pip install trakt`
2. `pip install tinydb` ```
python -m pip install -r requirements.txt
```
### Setup Configuration ### 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). 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).
``` ```
@ -49,4 +61,5 @@ Create a new file named `config.json` in the same directory of `TimeToTrakt.py`,
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. 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 ##### Credit
<a href='https://www.freepik.com/vectors/city'>City vector created by freepik - www.freepik.com</a>
<a href='https://www.freepik.com/vectors/city'>City vector created by freepik - www.freepik.com</a>