From 2938029c51ab3f6639ad150264eed564aaf70d3e Mon Sep 17 00:00:00 2001 From: desimaniac Date: Tue, 6 Mar 2018 13:29:30 -0600 Subject: [PATCH 1/6] Update README.md --- README.md | 100 ++++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 98 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index aa4c1a2..70cd0b2 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,98 @@ -# traktarr -Script to add new series & movies to Sonarr/Radarr based on Trakt lists. \ No newline at end of file +# Traktarr +Script to add new TV series & movies to Sonarr/Radarr based on Trakt lists. + +# Requirements +1. Python 3.5 or higher (`sudo apt install python3 python3-pip`). +2. requirements.txt modules (see below). + +# Installation on Ubuntu/Debian + +1. `cd /opt` +3. `sudo git clone https://github.com/l3uddz/traktarr` +4. `sudo chown -R user:group traktarr` (run `id` to find your user / group) +5. `cd traktarr` +6. `sudo python3 -m pip install -r requirements.txt` +7. `python3 traktarr.py` to generate a default config.json file. +8. Edit `config.json` to your preference. + + +# Configuration + +``` +{ + "core": { + "debug": false + }, + "filters": { + "movies": { + "allowed_countries": [ + "us", + "gb", + "ca" + ], + "blacklist_title_keywords": [ + "untitled", + "barbie" + ], + "blacklisted_genres": [ + "documentary", + "music" + ], + "blacklisted_min_runtime": 60, + "blacklisted_min_year": 2000 + }, + "shows": { + "allowed_countries": [ + "us", + "gb", + "ca" + ], + "blacklisted_genres": [ + "animation", + "game-show", + "talk-show", + "home-and-garden", + "children", + "reality", + "anime", + "news", + "documentary", + "special-interest" + ], + "blacklisted_min_runtime": 15, + "blacklisted_min_year": 2000, + "blacklisted_networks": [ + "twitch", + "youtube", + "nickelodeon", + "hallmark", + "reelzchannel", + "disney", + "cnn", + "cbbc", + "the movie network", + "teletoon", + "cartoon network", + "espn", + "yahoo!", + "fox sports" + ] + } + }, + "radarr": { + "api_key": "", + "profile": "Remux", + "root_folder": "/movies/", + "url": "http://localhost:8989" + }, + "sonarr": { + "api_key": "", + "profile": "WEBDL-1080p", + "root_folder": "/tv/", + "url": "http://localhost:8989" + }, + "trakt": { + "api_key": "" + } +}% +``` From d30c3dac3bf2e1b7ffff869923a83860b6e0dc17 Mon Sep 17 00:00:00 2001 From: desimaniac Date: Tue, 6 Mar 2018 13:29:45 -0600 Subject: [PATCH 2/6] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 70cd0b2..f4db686 100644 --- a/README.md +++ b/README.md @@ -94,5 +94,5 @@ Script to add new TV series & movies to Sonarr/Radarr based on Trakt lists. "trakt": { "api_key": "" } -}% +} ``` From 3ad4caa101ea9e72c92389a266488fb91c9e5df0 Mon Sep 17 00:00:00 2001 From: desimaniac Date: Tue, 6 Mar 2018 13:30:48 -0600 Subject: [PATCH 3/6] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index f4db686..d6d7c86 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ Script to add new TV series & movies to Sonarr/Radarr based on Trakt lists. 4. `sudo chown -R user:group traktarr` (run `id` to find your user / group) 5. `cd traktarr` 6. `sudo python3 -m pip install -r requirements.txt` -7. `python3 traktarr.py` to generate a default config.json file. +7. `python3 traktarr.py` to generate a default a config.json file. 8. Edit `config.json` to your preference. From 5f2ddb91ef6398caab7828e17b51b9d2cb3dc135 Mon Sep 17 00:00:00 2001 From: l3uddz Date: Tue, 6 Mar 2018 20:36:48 +0000 Subject: [PATCH 4/6] adjust default config to defaults for sonarr/radarr. --- misc/config.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/misc/config.py b/misc/config.py index b9a72b6..d732ea6 100644 --- a/misc/config.py +++ b/misc/config.py @@ -15,13 +15,13 @@ base_config = { 'sonarr': { 'url': 'http://localhost:8989', 'api_key': '', - 'profile': 'WEBDL-1080p', + 'profile': 'HD-1080p', 'root_folder': '/tv/' }, 'radarr': { - 'url': 'http://localhost:8989', + 'url': 'http://localhost:7878', 'api_key': '', - 'profile': 'Remux', + 'profile': 'HD-1080p', 'root_folder': '/movies/' }, 'filters': { From adc54518fb9a7d6cc7a4b21962223812586a615e Mon Sep 17 00:00:00 2001 From: l3uddz Date: Tue, 6 Mar 2018 22:28:05 +0000 Subject: [PATCH 5/6] readme default config update --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index d6d7c86..1cc1176 100644 --- a/README.md +++ b/README.md @@ -81,13 +81,13 @@ Script to add new TV series & movies to Sonarr/Radarr based on Trakt lists. }, "radarr": { "api_key": "", - "profile": "Remux", + "profile": "HD-1080p", "root_folder": "/movies/", - "url": "http://localhost:8989" + "url": "http://localhost:7878" }, "sonarr": { "api_key": "", - "profile": "WEBDL-1080p", + "profile": "HD-1080p", "root_folder": "/tv/", "url": "http://localhost:8989" }, From 1cb17ff6ffdf3f2515709bf7bc5a20446501375e Mon Sep 17 00:00:00 2001 From: l3uddz Date: Tue, 6 Mar 2018 22:43:05 +0000 Subject: [PATCH 6/6] added --no-search flag to disable automatic search when adding movies/series. fixed radarr being sent sonarr root_folder accidently. --- traktarr.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/traktarr.py b/traktarr.py index 8418edd..95e702b 100644 --- a/traktarr.py +++ b/traktarr.py @@ -33,7 +33,8 @@ def app(): help='Trakt list to process.', required=True) @click.option('--add-limit', '-l', default=0, help='Limit number of series added to Sonarr.', show_default=True) @click.option('--add-delay', '-d', default=2.5, help='Seconds between each add request to Sonarr.', show_default=True) -def shows(list_type, add_limit=0, add_delay=2.5): +@click.option('--no-search', is_flag=True, help='Disable search when adding series to Sonarr.') +def shows(list_type, add_limit=0, add_delay=2.5, no_search=False): added_shows = 0 # validate trakt api_key @@ -107,7 +108,7 @@ def shows(list_type, add_limit=0, add_delay=2.5): # add show to sonarr if sonarr.add_series(series['show']['ids']['tvdb'], series['show']['title'], profile_id, cfg.sonarr.root_folder, - True): + not no_search): log.info("ADDED %s (%d)", series['show']['title'], series['show']['year']) added_shows += 1 else: @@ -131,7 +132,8 @@ def shows(list_type, add_limit=0, add_delay=2.5): help='Trakt list to process.', required=True) @click.option('--add-limit', '-l', default=0, help='Limit number of movies added to Radarr.', show_default=True) @click.option('--add-delay', '-d', default=2.5, help='Seconds between each add request to Radarr.', show_default=True) -def movies(list_type, add_limit=0, add_delay=2.5): +@click.option('--no-search', is_flag=True, help='Disable search when adding movies to Radarr.') +def movies(list_type, add_limit=0, add_delay=2.5, no_search=False): added_movies = 0 # validate trakt api_key @@ -202,7 +204,7 @@ def movies(list_type, add_limit=0, add_delay=2.5): ', '.join(movie['movie']['genres']), movie['movie']['country'].upper()) # add movie to radarr if radarr.add_movie(movie['movie']['ids']['tmdb'], movie['movie']['title'], movie['movie']['year'], - profile_id, cfg.sonarr.root_folder, True): + profile_id, cfg.radarr.root_folder, not no_search): log.info("ADDED %s (%d)", movie['movie']['title'], movie['movie']['year']) added_movies += 1 else: