sirk123au / ArrTools

A collection of tools for Radarr, Sonarr & Lidarr
GNU General Public License v3.0
141 stars 16 forks source link

KeyError: 'title' #9

Closed CreamedRicePudding closed 3 years ago

CreamedRicePudding commented 3 years ago

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

sirk123au commented 3 years ago

This is the format of the CSV file and has the have the following heading

title,year,imdbid

The Matrix,1999,tt0133093

CreamedRicePudding commented 3 years ago

I have just tried that format and it gave the same result

CreamedRicePudding commented 3 years ago

I ran the backup_radarr_2csv program to give me a csv that actually has imdb id's in case that's where the issue lies, but using the backup csv gave the same error

CreamedRicePudding commented 3 years ago

Just had a look and noticed the method used to read the title, year etc from each row of the csv is different in sonarr_add_from_list.py. I copied that method into radarr_add_from_list.py and now there is no KeyError: 'title' !!

Unfortunately 0 movies were added out of the 52 discovered in the list, maybe that's cause I'm not on the pc that hosts radarr though.

sirk123au commented 3 years ago

I have fixed this, the csv file has to have a header of title,year,imdbid or it wont read the file, Pull for latest changes.