Script to add new shows & movies to Sonarr/Radarr based on Trakt lists.
Script to add new shows & movies to Sonarr/Radarr based on Trakt lists.
Trakt lists currently supported:
Types of Trakt lists supported:
- anticipated
- boxoffice
- Official Trakt lists
- interval
- popular
- Trending
- trending
- Popular
- Anticipated
- boxoffice
- Public lists
- Private lists*
- Watchlist
- Custom list(s)
\* Support for multiple (authenticated) users.
# Requirements
# Requirements
@ -28,7 +43,47 @@ Install Traktarr to be run with `traktarr` command.
7. `traktarr` - run once to generate a default a config.json file.
7. `traktarr` - run once to generate a default a config.json file.
8. `nano config.json` - edit preferences.
8. `nano config.json` - edit preferences.
## 2. Setup Schedule
## 2. Create app authentication
1. Create a Trakt application by going [here](https://trakt.tv/oauth/applications/new)
2. Enter a name for your application; for example `Traktarr`
3. Enter `urn:ietf:wg:oauth:2.0:oob` in the `Redirect uri` field.
4. Click "SAVE APP".
5. Open the Traktarr configuration file `config.json` and insert the Client ID in the `api_key` and the Client Secret in the `api_secret`, like this:
```
{
"trakt": {
"api_key": "my_client_id",
"api_secret": "my_client_secret_key"
}
}
```
## 3. Authenticate User(s) (optional)
For each user you want to access the private lists for (i.e. watchlist and/or custom lists), you will need to to authenticate that user.
Repeat the following steps for every user you want to authenticate:
1. Run `traktarr trakt_authentication`
2. You wil get the following prompt:
```
INFO - media.trakt - __oauth_request_device_code - We're talking to Trakt to get your verification code. Please wait a moment...
INFO - media.trakt - __oauth_request_device_code - Go to: https://trakt.tv/activate on any device and enter A0XXXXXX. We'll be polling Trakt every 5 seconds for a reply
```
3. Go to https://trakt.tv/activate.
4. Enter the code you see in your terminal.
5. Click continue.
6. If you are not logged in to Trakt, login now.
7. Click "Accept".
8. You will get the message: "Woohoo! Your device is now connected and will automatically refresh in a few seconds.".
You've now authenticated the user.
You can repeat this process for as many users as you like.
## 4. Setup Schedule
To have Traktarr get Movies and Shows for you automatically, on set interval.
To have Traktarr get Movies and Shows for you automatically, on set interval.
@ -41,6 +96,8 @@ To have Traktarr get Movies and Shows for you automatically, on set interval.
# Configuration
# Configuration
## Sample Configuration
```json
```json
{
{
"core": {
"core": {
@ -149,7 +206,8 @@ To have Traktarr get Movies and Shows for you automatically, on set interval.
"url": "http://localhost:8989/"
"url": "http://localhost:8989/"
},
},
"trakt": {
"trakt": {
"api_key": ""
"api_key": "",
"api_secret": ""
}
}
}
}
```
```
@ -179,13 +237,17 @@ Movies can be run on a separate schedule from Shows.
"boxoffice": 10,
"boxoffice": 10,
"interval": 24,
"interval": 24,
"popular": 3,
"popular": 3,
"trending": 2
"trending": 2,
"watchlist": {},
"lists": {}
},
},
"shows": {
"shows": {
"anticipated": 10,
"anticipated": 10,
"interval": 48,
"interval": 48,
"popular": 1,
"popular": 1,
"trending": 2
"trending": 2,
"watchlist": {},
"lists": {}
}
}
},
},
```
```
@ -194,6 +256,108 @@ Movies can be run on a separate schedule from Shows.
`anticipated`, `popular`, `trending`, `boxoffice` (movies only) - specify how many items from each Trakt list to find.
`anticipated`, `popular`, `trending`, `boxoffice` (movies only) - specify how many items from each Trakt list to find.
`watchlist` - specify which watchlists to fetch (see explanation below)
`lists` - specify which custom lists to fetch (see explanation below)
### Personal Watchlists
The watchlist task can be scheduled with a differtent item limit for every (authenticated) user.*
So for every user, you will add: `"username": limit` to the watchlist key. For example:
```json
"automatic": {
"movies": {
"watchlist": {
"user1": 10,
"user2": 5
}
},
"shows": {
"watchlist": {
"user1": 2,
"user3": 1
}
}
},
```
Of course you can combine this with running the other list types as well.
### Custom Lists
You can also schedule any number of public or private custom lists.
For both public and private lists you'll need the url to that list. When viewing the list on Trakt, simply copy the url from the address bar of the your browser.
#### Public Lists
Public lists can be added by specifying the url and the item limit like this:
Use filters to specify the movie/shows's country of origin or blacklist (i.e. filter-out) certain keywords, genres, years, runtime, or specific movies/shows.
Use filters to specify the movie/shows's country of origin or blacklist (i.e. filter-out) certain keywords, genres, years, runtime, or specific movies/shows.
@ -387,6 +551,8 @@ Sonarr configuration.
To show how tags work, we will create a sample tag `AMZN` and assign it to certain networks.
To show how tags work, we will create a sample tag `AMZN` and assign it to certain networks.
_Note: These are optional._
### Sonarr
### Sonarr
First, we will create a tag in Sonarr (Settings > Indexers > Restrictions).
First, we will create a tag in Sonarr (Settings > Indexers > Restrictions).
@ -429,22 +595,19 @@ Finally, we will edit the Traktarr config and assign the `AMZN` tag to certain n
## Trakt
## Trakt
Trakt Authentication info:
```json
```json
"trakt": {
"trakt": {
"api_key": ""
"api_key": "",
"api_scret": ""
}
}
```
```
`api_key` - Fill in your Trakt API key (_Client ID_).
`api_key` - Fill in your Trakt API key (_Client ID_).
`api_secret` - Fill in your Trakt Secret key (_Client Scret_)
How to get a Trakt API Key:
- Go to https://trakt.tv/oauth/applications/new
- Fill in:
- Name: `Traktarr`
- Redirect uri: `https://google.com`
- Click `Save App`
- Retrieve the _Client ID_.
# Usage
# Usage
@ -470,6 +633,7 @@ Commands:
movies Add new movies to Radarr.
movies Add new movies to Radarr.
run Run in automatic mode.
run Run in automatic mode.
shows Add new shows to Sonarr.
shows Add new shows to Sonarr.
trakt_authentication Authenticate Traktrarr to index your personal...
```
```
@ -486,8 +650,9 @@ Usage: traktarr movies [OPTIONS]