arty-name / livejournal-export

Export your LiveJournal (posts + comments) to XML, JSON and optionally convert them to HTML and Markdown
45 stars 16 forks source link

Crash when handling a comment of deleted user #2

Closed arty-name closed 9 years ago

arty-name commented 9 years ago

Reported by Aleksandr Nessler:

I’m using your livejournal exporter and i constantly receive a strange issue which prevents further export

raidho@Ubuntu-1404-trusty-64-minimal:~/lj_cosh/lj_export$ ./export.py
Traceback (most recent call last):
  File "./export.py", line 195, in <module>
    all_comments = download_comments()
  File "/home/raidho/lj_cosh/lj_export/download_comments.py", line 91, in download_comments
    start_id, comments = get_more_comments(start_id + 1, users)
  File "/home/raidho/lj_cosh/lj_export/download_comments.py", line 68, in get_more_comments
    comment['author'] = users[str(comment['posterid'])]
KeyError: ‘48713497'

… i checked the usermap.json & found that there is no such user. I suppose the issue is related users that are deleted from livejournal.

like this one http://evlie.livejournal.com

I found the corresponding user to the id ‘48713497’ on wich your exporter stops.

arty-name commented 9 years ago

Fixed in #556beeb5