Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Script aborts with incomplete data #4

Open
jdahdah opened this issue Dec 13, 2016 · 2 comments
Open

Script aborts with incomplete data #4

jdahdah opened this issue Dec 13, 2016 · 2 comments

Comments

@jdahdah
Copy link

jdahdah commented Dec 13, 2016

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 jdahdah changed the title ValueError: invalid literal for int() with base 10 Script aborts with incomplete data Dec 13, 2016
@jdahdah
Copy link
Author

jdahdah commented Dec 13, 2016

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

@jensb89
Copy link
Owner

jensb89 commented Dec 13, 2016

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 :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants