jensb89 / trakt---letterboxd-import

Import Letterboxd movie list (diary) into trakt.tv
94 stars 19 forks source link

Script aborts with incomplete data #4

Open jdahdah opened 7 years ago

jdahdah commented 7 years ago

Hi, I bumped into the following error while running the script. It worked for my diary.csv, but this happened when importing watched.csv:

['Return of the Jedi', '1983', '2016-12-13T16:54:14.939219', u'tt2301123']
Get imdbID for Star Wars: Episode V - The Empire Strikes Back (Theatrical Version)()
Traceback (most recent call last):
  File "py-trakt-letterboxd-import.py", line 195, in <module>
    data = get_data_letterboxd(letterboxd_file[0],use_diary_file)
  File "py-trakt-letterboxd-import.py", line 109, in get_data_letterboxd
    imdbinfo = get_imdb_info(row[1], year=int(row[2]))
ValueError: invalid literal for int() with base 10: ''

The script aborts after that message. This is what line 26 in watched.csv looked like:

2012-05-02,Star Wars: Episode V - The Empire Strikes Back (Theatrical Version),,

After adding the missing information manually, the script resumed working:

2012-05-02,Star Wars: Episode V - The Empire Strikes Back (Theatrical Version),1980,http://letterboxd.com/film/the-empire-strikes-back/

This is just a heads-up that Letterboxd seems to sometimes export incomplete data. I'm guessing the script could use a fall-back for these cases. Either way, thanks for the script, very useful!

jdahdah commented 7 years ago

Update: I just noticed you already mention this in the readme. ¯\(ツ)

jensb89 commented 7 years ago

Hi, yup, I mentioned this in the Readme, but thanks for the heads-up :-) And you're right, a fall-back for these (rare) cases could be done. Whenever I've some time over, I will add it to the script.

Either way, thanks for the script, very useful!

Glad you like it :-)