Giter Site home page Giter Site logo

arrtools's Introduction

Radarr and Sonarr Tools

radarr_add_from_list.py Add Movies from a csv formatted file.

sonarr_add_from_list.py Add Shows from a csv formatted file.

lidarr_add_from_list.py Add Artists from a csv formatted file.

radarr_remove_downloaded.py Removes already downloaded movies and removes their entries from Radarr.

backup_radarr_2csv.py Creates a backup of the Radarr Database for easy importing.

backup_sonarr_2csv.py Creates a backup of the Sonarr Database for easy importing.

backup_lidarr_2csv.py Creates a backup of the Lidarr Database for easy importing.

get_imdbid.py Matches the imdbd from a csv list MovieName/ShowName,Year for easy importing for the list import.

Using radarr_add_from_list/sonarr_add_from_list The input list file has to have the format. It has to have MovieName/ShowName,Year,imdbid **imdbid is Optional Makes it easer to find movie/TV show

Use pip install -r requirments.txt to install the required python modules

Movies CSV

title,year,imdbid (This header has to be included in the csv for it to work correctly)
Ben-Hur,1959,tt0052618
Gone with the Wind,1939,tt0031381

Without imdbid

title,year,imdbid (This header has to be included in the csv for it to work correctly)
The English Patient,1996
Schindler's List,1993

TV Shows CSV

title,year,imdbid (This header has to be included in the csv for it to work correctly)
13 Reasons Why,2017,tt1837492
50 Central,2017,tt7261310

Without imdbID

title,year,imdbid (This header has to be included in the csv for it to work correctly)
60 Days In,2016
9-1-1,2018
A Discovery of Witches,2018

Artist CSV

artist,foreignArtistId
10cc
2 DJ's and One
3 Doors Down
3-11 Porter

With foreignArtistId

artist,foreignArtistId
Weird Al Yankovic,7746d775-9550-4360-b8d5-c37bd448ce01
Adele,cc2c9c3c-b7bc-4b8b-84d8-4fbd8779e493
Alanis Morissette,4bdcee62-4902-4773-8cd1-e252e2e31225
Arctic Monkeys,ada7a83c-e3e1-40f1-93f9-3e73dbc9298a
Augie March,29070ba5-c3df-41d9-bed0-8e2f1e1c22ad
BABYMETAL,27e2997f-f7a1-4353-bcc4-57b9274fa9a4
Backstreet Boys,2f569e60-0a1b-4fb9-95a4-3dc1525d1aad

when you run it use

$python3 radarr_add_from_list.py movielist.csv
$python3 sonarr_add_from_list.py showlist.csv
$python3 lidarr_add_from_list.py artist.csv

Rename config_example.ini and add your details

[radarr]
api_key = Radarr Api Key
baseurl = http://localhost:7878 Radarr Base Url
urlbase = ; Include URL Base if you have it enabled
rootfolderpath = Movie Root Path (trailing slash is needed eg. /media/Movies/ or d:\media\Movies\)
searchForMovie = Enable forced search
qualityProfileId = 
omdbapi_key =  sign up here for free api key http://www.omdbapi.com/apikey.aspx

[sonarr]
api_key = Sonarr Api Key 
baseurl = http://localhost:8989
urlbase = ; Include URL Base if you have it enabled
rootfolderpath = Show Root Path (trailing slash is needed eg. /media/shows/ or d:\media\shows\)
searchForShow = 
qualityProfileId = 
omdbapi_key = 
tvdb_api =  ; sign up here for a api key https://thetvdb.com/api-information
tvdb_userkey = 
tvdb_username = 

[lidarr]
api_key = 
baseurl = http://localhost:8686
rootfolderpath = 


Standard Profile ID
1 Any
2 SD
3 HD-720p
4 HD-1080p
5 Ultra-HD
6 HD - 720p/1080p

Thanks for the support :)

Github Sponsorship

ko-fi

arrtools's People

Contributors

dp247 avatar mchangrh avatar pbarone avatar sirk123au avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

arrtools's Issues

Errors with both Sonarr and Radarr Importing

I had a few different error but the biggest issue right now is that both the sonarr and radarr import tool always say the movie/tv show already exists and then won't add anything.

I appreciate the work you've done making this and hope I can get it to run as I have some lists I would really like to get into each program.

While adding shows I was getting
Failed to get TvDB JWT Token

Here is some of the log:

2020-04-04 15:40:18,414 [DEBUG]  Starting new HTTP connection (1): localhost:18990
2020-04-04 15:40:18,558 [DEBUG]  http://localhost:18990 "GET /api/series HTTP/1.1" 200 None
2020-04-04 15:40:18,564 [INFO ]  Found 1 TV Shows in TV-Shows-Documentary-Import.csv. :)
2020-04-04 15:40:18,565 [DEBUG]  Starting new HTTPS connection (1): www.omdbapi.com:443
2020-04-04 15:40:18,833 [DEBUG]  https://www.omdbapi.com:443 "GET /?t=Dirty%20Jobs&y=2003&apikey=xxxxxxx HTTP/1.1" 200 None
2020-04-04 15:40:18,837 [DEBUG]  Starting new HTTPS connection (1): api.thetvdb.com:443
2020-04-04 15:41:18,926 [DEBUG]  https://api.thetvdb.com:443 "POST /login HTTP/1.1" 504 1033
2020-04-04 15:41:18,928 [ERROR]  Failed to get TvDB JWT Token

I don't get that error anymore. Not sure what changed but now it doesn't matter what I put in the list, it always comes back with already exists in sonarr.

2020-04-04 22:40:25,256 [INFO ] Downloading Sonarr Show Data. :) 2020-04-04 22:40:25,259 [DEBUG] Starting new HTTP connection (1): localhost:18990 2020-04-04 22:40:25,395 [DEBUG] http://localhost:18990 "GET /api/series HTTP/1.1" 200 None 2020-04-04 22:40:25,401 [INFO ] Found 1 TV Shows in TV-Shows-Documentary-Import.csv. :) 2020-04-04 22:40:25,403 [DEBUG] Starting new HTTPS connection (1): www.omdbapi.com:443 2020-04-04 22:40:25,691 [DEBUG] https://www.omdbapi.com:443 "GET /?t=shark&y=2015&apikey=xxxxx HTTP/1.1" 200 None 2020-04-04 22:40:25,698 [DEBUG] Starting new HTTPS connection (1): api.thetvdb.com:443 2020-04-04 22:40:25,864 [DEBUG] https://api.thetvdb.com:443 "POST /login HTTP/1.1" 200 528 2020-04-04 22:40:25,868 [DEBUG] Starting new HTTPS connection (1): api.thetvdb.com:443 2020-04-04 22:40:26,073 [DEBUG] https://api.thetvdb.com:443 "GET /search/series?imdbId=tt4706496 HTTP/1.1" 200 448 2020-04-04 22:40:26,075 [DEBUG] Converted retries value: 20 -> Retry(total=20, connect=None, read=None, redirect=None, status=None) 2020-04-04 22:40:26,077 [DEBUG] Starting new HTTP connection (1): localhost:18990 2020-04-04 22:40:26,355 [DEBUG] http://localhost:18990 "GET /api/series/lookup?term=tvdb:295438&apikey=xxxxxxxxxxxxxxxxxxx HTTP/1.1" 200 None 2020-04-04 22:40:26,358 [DEBUG] Starting new HTTP connection (1): localhost:18990 2020-04-04 22:40:26,370 [DEBUG] http://localhost:18990 "POST /api/series HTTP/1.1" 400 None 2020-04-04 22:40:26,371 [INFO ] �[36mtt4706496 �[32mShark (2015) (2015) �[0malready Exists in Sonarr. 2020-04-04 22:40:26,372 [INFO ] Added 0 of 1 Shows, 1 Already Exist

When adding a movie I "randomly" get
local variable 'headers' referenced before assignment

Here I some of the log:
2020-04-04 14:24:47,402 [DEBUG] http://localhost:17880 "GET /api/movie/lookup/imdb?imdbId=tt1529567&apikey=xxxxxxxxxxxxxxxx HTTP/1.1" 200 None 2020-04-04 14:24:47,404 [DEBUG] Starting new HTTP connection (1): localhost:17880 2020-04-04 14:24:47,430 [DEBUG] http://localhost:17880 "POST /api/movie HTTP/1.1" 500 None 2020-04-04 14:24:47,433 [DEBUG] Starting new HTTPS connection (1): www.omdbapi.com:443 2020-04-04 14:24:47,690 [DEBUG] https://www.omdbapi.com:443 "GET /?i=tt5532610&apikey=xxxx HTTP/1.1" 200 None 2020-04-04 14:24:47,694 [DEBUG] Converted retries value: 20 -> Retry(total=20, connect=None, read=None, redirect=None, status=None) 2020-04-04 14:24:47,695 [DEBUG] Starting new HTTP connection (1): localhost:17880 2020-04-04 14:24:47,810 [DEBUG] http://localhost:17880 "GET /api/profile HTTP/1.1" 200 None 2020-04-04 14:24:47,815 [DEBUG] Starting new HTTP connection (1): localhost:17880 2020-04-04 14:24:47,839 [DEBUG] http://localhost:17880 "GET /api/movie/lookup/imdb?imdbId=tt5532610&apikey=xxxxxxxxxxxxxx HTTP/1.1" 200 None 2020-04-04 14:24:47,842 [DEBUG] Starting new HTTP connection (1): localhost:17880 2020-04-04 14:24:47,867 [DEBUG] http://localhost:17880 "POST /api/movie HTTP/1.1" 500 None 2020-04-04 14:24:47,870 [DEBUG] Starting new HTTPS connection (1): www.omdbapi.com:443 2020-04-04 14:24:48,158 [DEBUG] https://www.omdbapi.com:443 "GET /?i=tt1424432&apikey=xxxxx HTTP/1.1" 200 None 2020-04-04 14:24:48,163 [INFO ] �[36mtt1424432 �[0mSenna (2010) already Exists in Radarr. 2020-04-04 14:24:48,165 [DEBUG] Starting new HTTPS connection (1): www.omdbapi.com:443 2020-04-04 14:24:48,465 [DEBUG] https://www.omdbapi.com:443 "GET /?i=&apikey=xxxxxx HTTP/1.1" 200 None 2020-04-04 14:24:48,470 [DEBUG] Starting new HTTPS connection (1): www.omdbapi.com:443 2020-04-04 14:24:48,731 [DEBUG] https://www.omdbapi.com:443 "GET /?t=Sharks:%20Kings%20of%20the%20Ocean&y=None&apikey=xxxxx HTTP/1.1" 200 47 2020-04-04 14:24:48,734 [ERROR] local variable 'headers' referenced before assignment

That looks to be some sort of formatting error I can't quite put my finger on but when not having an issue with that I now have the same issue as with sonarr in that it says the movie already exists in radarr.

Add Readarr books from top list

I'm interested to have Readarr support adding books from some kind of top list, perhaps from goodreads? Similar to how Sonarr & Radarr work.

JWT Token Error?

I saw you answered this previously but I'm unsure of how I can use that answer, I don't make use of urlbase on my sonarr install and am not sure what I should put there?
Error:

[INFO] Downloading Sonarr Show Data. :) [INFO] Found 7962 TV Shows in tv2.csv. :) [INFO] None 71° North (UK) (2010) already Exists in Sonarr. [ERROR] Failed to get TvDB JWT Token

And a copy of my config ( edited )
`[radarr]
api_key =
baseurl =
urlbase = ; Include URL Base if you have it enabled
rootfolderpath =
searchForMovie =
qualityProfileId =
omdbapi_key = ; sign up here for api key http://www.omdbapi.com/apikey.aspx

[sonarr]
api_key = 7618c07a0d3dfsfsfsfsfs9accfefdbd66552b
baseurl = http://1.19.10.143:8989
urlbase = ; Include URL Base if you have it enabled
rootfolderpath = /tv
searchForShow = no
qualityProfileId = 1
omdbapi_key = 9
tvdb_api = b23148dde ; sign up here for a api key https://thetvdb.com/api-information
tvdb_userkey = 5FB3371651
tvdb_username = k

; Standard Profile ID
; 1 Any
; 2 SD
; 3 HD-720p
; 4 HD-1080p
; 5 Ultra-HD
; 6 HD - 720p/1080p`

Profile ID not found

Hi think i'm probably missing something obvious but can't seem to see the issue. If i set profile id to 4 (or any of the standard numbers) i get the below error.

[INFO] Downloading Radarr Movie Data. :)
[INFO] Found 314 Movies in /Users/****/Desktop/plex/movieimport.csv. :)
[ERROR] Could not find profile_id for instance profile ID "4"

If i set it to HD-1080P it looks like its trying to work however doesn't add any movies...

[INFO] Found 314 Movies in /Users/***/Desktop/plex/movieimport.csv. :)
[ERROR] Sorry. We couldn't find any movies matching Aquaman (2018)
[ERROR] Sorry. We couldn't find any movies matching Crocodile Dundee (1986)
[ERROR] Sorry. We couldn't find any movies matching Four Weddings and a Funeral (1994)
[INFO] tt0107290 Jurassic Park (1993) already Exists in Radarr.
[ERROR] Sorry. We couldn't find any movies matching Mamma Mia: Here We Go Again! (2018)
[INFO] Added 0 of 314 Movies, 1 already exists. ;)

I've done a couple of GET commands and confirmed that profileid should be 4 just a standard radarr setup

config.ini
[radarr]
api_key = 3*****************e
baseurl = http://10.*****1:7878
urlbase =
rootfolderpath = /data/media/movies/
searchForMovie = True
qualityProfileId = 4
omdbapi_key = f5a1532d;

Possible to use this to import artists/albums into Lidarr?

I would be great if this could import/add artists and albums from a CSV file, or any other type of text file. I currently have all of my YouTube Music artists/albums/songs (over 20k) in a spreadsheet and I'd like to get them into Lidarr.

API Error in Adding Movies

Hi

Please close if I should be posting this in a Radaar issue list. I'm using your scripts to import files from a CSV file. After a mighty battle :) I've almost got it working, but my test run finds a movie but does not add it to Radaar. This is the debug output in Radaar logging. Adding movies via the GUI UI works fine.

Grateful for any support or guidance.

[v0.2.0.1504] Newtonsoft.Json.JsonReaderException: Could not convert string to boolean: N. Path 'addOptions.searchForMovie', line 1, position 339.
at Newtonsoft.Json.JsonReader.ReadBooleanString(String s)
at Newtonsoft.Json.JsonTextReader.ReadAsBoolean()
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.ReadForType(JsonReader reader, JsonContract contract, Boolean hasConverter)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateObject(Object newObject, JsonReader reader, JsonObjectContract contract, JsonProperty member, String id)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObject(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.SetPropertyValue(JsonProperty property, JsonConverter propertyConverter, JsonContainerContract containerContract, JsonProperty containerProperty, JsonReader reader, Object target)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateObject(Object newObject, JsonReader reader, JsonObjectContract contract, JsonProperty member, String id)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObject(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize(JsonReader reader, Type objectType, Boolean checkAdditionalContent)
at Newtonsoft.Json.JsonSerializer.DeserializeInternal(JsonReader reader, Type objectType)
at Newtonsoft.Json.JsonConvert.DeserializeObject(String value, Type type, JsonSerializerSettings settings)
at NzbDrone.Api.Extensions.ReqResExtensions.FromJson(Stream body, Type type) in C:\projects\radarr-usby1\src\NzbDrone.Api\Extensions\ReqResExtensions.cs:line 31
at NzbDrone.Api.Extensions.ReqResExtensions.FromJson[T](Stream body, Type type) in C:\projects\radarr-usby1\src\NzbDrone.Api\Extensions\ReqResExtensions.cs:line 24
at NzbDrone.Api.Extensions.ReqResExtensions.FromJson[T](Stream body) in C:\projects\radarr-usby1\src\NzbDrone.Api\Extensions\ReqResExtensions.cs:line 19
at NzbDrone.Api.REST.RestModule1.ReadResourceFromRequest(Boolean skipValidate) in C:\projects\radarr-usby1\src\NzbDrone.Api\REST\RestModule.cs:line 194 at NzbDrone.Api.REST.RestModule1.<set_CreateResource>b__41_0(Object options) in C:\projects\radarr-usby1\src\NzbDrone.Api\REST\RestModule.cs:line 161
at CallSite.Target(Closure , CallSite , Func`2 , Object )
at Nancy.Routing.Route.<>c__DisplayClass4.b__3(Object parameters, CancellationToken context)

API Error adding movies

I can't figure this one out for the life of me, my config is as follows:

[radarr]
api_key = e980************1d787e91
baseurl = http://192.168.***.3:7878
urlbase =
rootfolderpath = /media/movies/
searchForMovie = True
qualityProfileId = 1
omdbapi_key =

KeyError: 'title'

Not sure if this is due to my config etc but when I try to run radarr_add_from_list.py I get " KeyError: 'title' ".

The following is the console output:

[INFO] Downloading Radarr Movie Data. :)
[INFO] Found 52 Movies in movies.csv. :)
Traceback (most recent call last):
  File "radarr_add_from_list.py", line 236, in <module>
    main()
  File "radarr_add_from_list.py", line 230, in main
    title = row['title']; year = row['year']; imdbid = row['imdbid']
KeyError: 'title'

I'm using CygWin on Windows 10 Ameliorated (rare OS so apologies if that's the issue)

My movies.csv is just title,year and I've tried with a header row of title,year Title,Year title,year,imdbid and without this row but not sure what the correct format is when I don't have imdb id's.

Thanks for putting time into this tool it's exactly what I need if I can figure out how to use it

Experience issues with radarr_add_from_list

Hi,

Ive been trying to get a list from a CSV to radarr working but fail at almost the first hurdle!

I've added qualityProfileId = 1 to the config but when I try to run the script I get the following error, which found to be from the def match_profile_id(id): function.

[ERROR] Could not find profile_id for instance profile ID "1"

If I change to qualityProfileId = Any which has an ID of 1 it runs but only detects films already in radarr and does not add any, nor give any output, I suspect because it's not adding a valid qualityProfileId so fails?

[INFO] Downloading Radarr Movie Data. :) [INFO] Found 50 Movies in movies.csv. :) [INFO] tt2120120 Pixels (2015) already Exists in Radarr. [INFO] tt3659388 The Martian (2015) already Exists in Radarr. [INFO] tt1355644 Passengers (2016) already Exists in Radarr. [INFO] Added 0 of 50 Movies, 3 already exists. ;)

Any ideas where I'm going wrong please?

The API endpoint in backup_radarr_2csv.py is incorrect

The line that forms the URL of the endpoint:
url = "{}/api/movie".format(baseurl)

Should be:
url = "{}/api/v3/movie".format(baseurl)

For the latest versions of Radarr. This currently results in the user getting a "failed to connect to Radarr" message, when all of the settings are actually correct in the config.ini file.

The team here needs to decide if this needs some type of variable for the version of Radarr the user is running, or just to assume the latest version and patch this in.

0 matches

hey,
i just set up ArrTools ang fetting this error on over 3000 entries.

2021-12-13 13:15:03,230 [ERROR] Sorry. We couldn't find any movies matching Can You Ever Forgive Me! (2018) 2021-12-13 13:15:03,230 [DEBUG] Converted retries value: 20 -> Retry(total=20, connect=None, read=None, redirect=None, status=None) 2021-12-13 13:15:03,231 [DEBUG] Starting new HTTP connection (1): 172.17.0.20 2021-12-13 13:15:03,233 [DEBUG] http://172.17.0.20:7878 "GET /api/profile HTTP/1.1" 200 None 2021-12-13 13:15:03,235 [DEBUG] Starting new HTTP connection (1): 172.17.0.20 2021-12-13 13:15:03,236 [DEBUG] http://172.17.0.20:7878 "GET /api/movie/lookup/imdb?imdbId=&apikey=badfaa3bf30541d6ac2dd344ca253512 HTTP/1.1" 200 0

is there anything i missed?

(JSONDecodeError) radarr_add_from_list.py

Hi,

when run command $python3 radarr_add_from_list.py movielist.csv

showing this error:

[INFO] Downloading Radarr Movie Data. :)
Traceback (most recent call last):
  File "radarr_add_from_list.py", line 253, in <module>
    main()
  File "radarr_add_from_list.py", line 235, in main
    RadarrData = json.loads(rsp.text)
  File "/usr/lib/python3.7/json/__init__.py", line 348, in loads
    return _default_decoder.decode(s)
  File "/usr/lib/python3.7/json/decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/lib/python3.7/json/decoder.py", line 355, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

I using Radarr in dokcer, this config.ini details (API are hid):

[radarr]
api_key = API Key
baseurl = https://radarr.domian.xyz/
urlbase =
rootfolderpath = /Movies/Movies_Hollywood
searchForMovie = False
qualityProfileId = 1
omdbapi_key = API Key; sign up here for api key http://www.omdbapi.com/apikey.aspx

 Standard Profile ID
 1 Any
 2 Bluray
 3 HD-1080p
 4 HD-720p
 5 SD
 6 Ultra-HD
 7 WEB-DL 1080P

I have tried localhost:7878 and IP Address docker network (172.18.0.25:7878) as same result.

Lidarr Support?

Hi,

I've been using this to backup both my sonarr and 2 radarr instances.

Will you by any chance be supporting Lidarr in the future?

Thanks

Lidarr Foreign Artist Id must not be empty

I have CSV file formatted with a blank Foreign Artist ID in a csv, for example.

artist | foreignArtistId
The Chainsmokers |  
Zedd |

Arrtools will state the artist already exists when it doesn't in Lidarr

python3 lidarr_add_from_list.py artists.csv
[INFO] Downloading Lidarr Artist Data. :)
[DEBUG] Starting new HTTP connection (1): 192.168.86.2:8686
[DEBUG] http://192.168.86.2:8686 "GET /api/v1/artist HTTP/1.1" 200 None
[INFO] Found 2 Artists in artists.csv. :)
[DEBUG] Starting new HTTP connection (1): 192.168.86.2:8686
[DEBUG] http://192.168.86.2:8686 "POST /api/v1/artist HTTP/1.1" 400 None
[INFO] Zedd already Exists in Lidarr.
[DEBUG] Starting new HTTP connection (1): 192.168.86.2:8686
[DEBUG] http://192.168.86.2:8686 "POST /api/v1/artist HTTP/1.1" 400 None
[INFO] Leikeli47 already Exists in Lidarr.
[INFO] Added 0 of 2 Artists, 2 Already Exist

Looking at the logs, it is looking for the Foreign Artist ID which does not exist in my CSV

2023-07-30 17:58:38.8|Warn|LidarrErrorPipeline|Invalid request Validation failed:
-- ForeignArtistId: 'Foreign Artist Id' must not be empty.
2023-07-30 17:59:52.3|Info|ImportListSyncService|Starting Import List Sync
2023-07-30 17:59:52.4|Info|ImportListSyncService|Processing 0 list items
2023-07-30 17:59:52.4|Info|ImportListSyncService|Import List Sync Completed. Items found: 0, Artists added: 0, Albums added: 0
2023-07-30 18:04:52.6|Info|ImportListSyncService|Starting Import List Sync
2023-07-30 18:04:52.6|Info|ImportListSyncService|Processing 0 list items
2023-07-30 18:04:52.6|Info|ImportListSyncService|Import List Sync Completed. Items found: 0, Artists added: 0, Albums added: 0
2023-07-30 18:05:44.7|Warn|LidarrErrorPipeline|FluentValidation.ValidationException: Validation failed:
-- ForeignArtistId: 'Foreign Artist Id' must not be empty.

[v1.3.0.3322] FluentValidation.ValidationException: Validation failed:
-- ForeignArtistId: 'Foreign Artist Id' must not be empty.
at Lidarr.Http.REST.RestController1.ValidateResource(TResource resource, Boolean skipValidate, Boolean skipSharedValidate) in ./Lidarr.Http/REST/RestController.cs:line 122 at Lidarr.Http.REST.RestController1.OnActionExecuting(ActionExecutingContext context) in ./Lidarr.Http/REST/RestController.cs:line 67
at Microsoft.AspNetCore.Mvc.Controller.OnActionExecutionAsync(ActionExecutingContext context, ActionExecutionDelegate next)
at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeInnerFilterAsync()
--- End of stack trace from previous location ---
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.g__Awaited|20_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.g__Awaited|17_0(ResourceInvoker invoker, Task task, IDisposable scope)
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.g__Awaited|17_0(ResourceInvoker invoker, Task task, IDisposable scope)
at Microsoft.AspNetCore.Routing.EndpointMiddleware.g__AwaitRequestTask|6_0(Endpoint endpoint, Task requestTask, ILogger logger)
at Lidarr.Http.Middleware.BufferingMiddleware.InvokeAsync(HttpContext context) in ./Lidarr.Http/Middleware/BufferingMiddleware.cs:line 28
at Lidarr.Http.Middleware.IfModifiedMiddleware.InvokeAsync(HttpContext context) in ./Lidarr.Http/Middleware/IfModifiedMiddleware.cs:line 41
at Lidarr.Http.Middleware.CacheHeaderMiddleware.InvokeAsync(HttpContext context) in ./Lidarr.Http/Middleware/CacheHeaderMiddleware.cs:line 33
at Lidarr.Http.Middleware.StartingUpMiddleware.InvokeAsync(HttpContext context) in ./Lidarr.Http/Middleware/StartingUpMiddleware.cs:line 38
at Lidarr.Http.Middleware.UrlBaseMiddleware.InvokeAsync(HttpContext context) in ./Lidarr.Http/Middleware/UrlBaseMiddleware.cs:line 27
at Lidarr.Http.Middleware.VersionMiddleware.InvokeAsync(HttpContext context) in ./Lidarr.Http/Middleware/VersionMiddleware.cs:line 29
at Microsoft.AspNetCore.ResponseCompression.ResponseCompressionMiddleware.InvokeCore(HttpContext context)
at Microsoft.AspNetCore.Authorization.Policy.AuthorizationMiddlewareResultHandler.HandleAsync(RequestDelegate next, HttpContext context, AuthorizationPolicy policy, PolicyAuthorizationResult authorizeResult)
at Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext context)
at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context)
at Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware.g__Awaited|6_0(ExceptionHandlerMiddleware middleware, HttpContext context, Task task)

Any possible way to fix this?

Few issues

Firstly: great tool! Used it to import some ~150 movies. Had some issues though:

  1. Requirments contains the logging module which is already present in Python3, so it gives an error when installing.

  2. Had some trouble with the config because the inline comments were read as part of the variable. Inline comments don't work with the default CommentParser settings, but can work with the inline_comment_prefixes option set to ';'.

  3. In radarr_add_from_list.py, in the function add_movie (line 77), the headers are set after the first if-statement. When imdbid == None, the headers are not set and an error pops up. Setting the headers before the if-else fixes this.

  4. Same as 3, but with ProfileId at line 73.

  5. I started with rootfolderpath without the trailing slash, which doesn't give errors but makes it so that it seems like every movie already exists in Radarr. Maybe alter the documentation to state the trailing slash is needed.

[Error] JSONDecodeError

Traceback (most recent call last):
File "radarr_add_from_list.py", line 236, in
main()
File "radarr_add_from_list.py", line 220, in main
RadarrData = json.loads(rsp.text)
File "/home/ashish/miniconda3/lib/python3.7/json/init.py", line 348, in loads
return _default_decoder.decode(s)
File "/home/ashish/miniconda3/lib/python3.7/json/decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/home/ashish/miniconda3/lib/python3.7/json/decoder.py", line 355, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

Config

[radarr]
api_key = KEY
baseurl = localhost:7878/radarr
urlbase = ; Include URL Base if you have it enabled
rootfolderpath = '/home/ashish/HDD/Torrents/completed/'
searchForMovie = True
qualityProfileId = 7
omdbapi_key = KEY; sign up here for api key http://www.omdbapi.com/apikey.aspx

Lidarr import says all artists already exist, but they don't

Running lidarr_add_from_list.py against a CSV of just artist names results in the following:

tor@tor:~/ArrTools$ python3 lidarr_add_from_list.py /STORAGE/Music/list.csv
[INFO] Downloading Lidarr Artist Data. :)
[INFO] Found 538 Artists in /STORAGE/Music/list.csv. :)
[INFO] 21 Savage already Exists in Lidarr.
<... insert 537 similar lines here ...>
[INFO] Added 0 of 538 Artists, 538 Already Exist

The artists don't show up in Lidarr, nor are they reflected when running backup_lidarr_2csv.py

Thoughts?

Added 0 of 50 Movies - Error 405

Hi !

Thanks for all the work.
I'm new around here so sorry if my question is stupid but I can't quite get my head around this.

I'm getting, what I've seen some people having : Added 0 of 50 Movies, 0 already exists. ;).

I've done the curl -x GET but didn't see any change.

My config.ini :

[radarr]
api_key = 03d3******7f52
baseurl = http://192.*****:8310
urlbase =
rootfolderpath = /
/downloads
searchForMovie = True
qualityProfileId = Any
omdbapi_key = 2d****093


The log

2022-02-09 13:54:34,746 [DEBUG] Starting new HTTPS connection (1): www.omdbapi.com:443
2022-02-09 13:54:34,859 [DEBUG] https://www.omdbapi.com:443 "GET /?t=Passengers&apikey=2d****093HTTP/1.1" 200 None
2022-02-09 13:54:34,861 [DEBUG] Converted retries value: 20 -> Retry(total=20, connect=None, read=None, redirect=None, status=None)
2022-02-09 13:54:34,863 [DEBUG] Starting new HTTP connection (1): 192.:8310
2022-02-09 13:54:34,867 [DEBUG] http://192.*****:8310 "GET /api/v3/qualityProfile HTTP/1.1" 200 None
2022-02-09 13:54:34,871 [DEBUG] Starting new HTTP connection (1): 192.
:8310
2022-02-09 13:54:34,995 [DEBUG] http://192.*****:8310 "GET /api/v3/movie/lookup/imdb?imdbId=tt1355644&apikey=03d3******7f52 HTTP/1.1" 200 None
2022-02-09 13:54:34,998 [DEBUG] Starting new HTTP connection (1): 192.
:8310
2022-02-09 13:54:34,999 [DEBUG] http://192.*****:8310 "POST /api/movie HTTP/1.1" 405 0


The only problem I see is the 405, which mean validation exception right ? But there, I've no idea where to find the solution. I find it weird that at the start of the script the adress works and no at the end. So I though maybe it's POST that's doing the issue but I've no idea how to manage that.

--

On radar I've a webhook for omdbapi which is working.
All my indexers/download clients etc works too.

--
Any Idea ? I probably missed something quite easy. Hope I've given you all the information you need.

Thanks in advance (:

config.ini issues

Heya

Not sure how I can add a suggested change to config.ini, however I had to delete quite a bit under the radarr section for it to work, as otherwise I was getting errors:

This is my final config.ini

[radarr]
api_key = [RADARR API KEY FROM RADARR SETTINGS]
baseurl = http://[IP ADDRESS WHERE RADARR LIVES]:7878
urlbase = /api
rootfolderpath = /data/path/to/root/folder/within/radarr/
searchForMovie = False
qualityProfileId = 1
omdbapi_key = [API key from OMDB]

If I left the comments on (after the ; ) it would simply not work. Not sure if this was a phyton3 quirk or anything, but it was trial and error to get it to work

More verbose prompts needed for get_imdbid.py

I was trying to get a list of IMDB IDs so I can use these to run radarr_add_from_list.py.

However running get_imdbid.py produced no output and no changes to the destination CSV file.

Testing the search string in the script manually does the following, so it's not that:

https://omdbapi.com/?t=Antz&apikey=APIKEY

{"Title":"Antz","Year":"1998","Rated":"PG","Released":"02 Oct 1998","Runtime":"83 min","Genre":"Animation, Adventure, Comedy, Family","Director":"Eric Darnell, Tim Johnson","Writer":"Todd Alcott (screenplay), Chris Weitz (screenplay), Paul Weitz (screenplay)","Actors":"Woody Allen, Dan Aykroyd, Anne Bancroft, Jane Curtin","Plot":"A rather neurotic ant tries to break from his totalitarian society while trying to win the affection of the princess he loves.","Language":"English","Country":"USA","Awards":"Nominated for 1 BAFTA Film Award. Another 6 wins & 13 nominations.","Poster":"https://m.media-amazon.com/images/M/MV5BMzMzMDdlMDktODg4OC00Y2E5LTk1ZjMtNzM2MzIxZGQ0ZGI3XkEyXkFqcGdeQXVyMTQxNzMzNDI@._V1_SX300.jpg","Ratings":[{"Source":"Internet Movie Database","Value":"6.5/10"},{"Source":"Rotten Tomatoes","Value":"92%"},{"Source":"Metacritic","Value":"72/100"}],"Metascore":"72","imdbRating":"6.5","imdbVotes":"145,976","imdbID":"tt0120587","Type":"movie","DVD":"N/A","BoxOffice":"$90,757,863","Production":"DreamWorks SKG, Pacific Data Images (PDI)","Website":"N/A","Response":"True"}

The issues was my CSV file was Title,Year. If only the names are fed in, it works.
You may want to add a prompt when incorrect input is detected.

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.