ageitgey / medium_to_ghost

Instantly move all your Medium.com content (formatted posts + images) to an open source Ghost blog!
MIT License
121 stars 13 forks source link

IndexError: list index out of range #10

Closed jlopp closed 3 years ago

jlopp commented 5 years ago
INFO:root:Parsing posts/2019-01-01_Bitcoin-By-the-Numbers--2018-Recap-68a91789d804.html
Traceback (most recent call last):
  File "/usr/lib/python3.6/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "/usr/lib/python3.6/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/home/jameson/.local/lib/python3.6/site-packages/medium_to_ghost/medium_to_ghost.py", line 111, in <module>
    main()
  File "/home/jameson/.local/lib/python3.6/site-packages/click/core.py", line 764, in __call__
    return self.main(*args, **kwargs)
  File "/home/jameson/.local/lib/python3.6/site-packages/click/core.py", line 717, in main
    rv = self.invoke(ctx)
  File "/home/jameson/.local/lib/python3.6/site-packages/click/core.py", line 956, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/jameson/.local/lib/python3.6/site-packages/click/core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "/home/jameson/.local/lib/python3.6/site-packages/medium_to_ghost/medium_to_ghost.py", line 98, in main
    exported_posts = parse_posts(posts)
  File "/home/jameson/.local/lib/python3.6/site-packages/medium_to_ghost/medium_to_ghost.py", line 53, in parse_posts
    converted_post = convert_medium_post_to_ghost_json(name, content)
  File "/home/jameson/.local/lib/python3.6/site-packages/medium_to_ghost/medium_post_parser.py", line 79, in convert_medium_post_to_ghost_json
    parser.feed(post_html_content)
  File "/usr/lib/python3.6/html/parser.py", line 111, in feed
    self.goahead(0)
  File "/usr/lib/python3.6/html/parser.py", line 163, in goahead
    self.handle_data(unescape(rawdata[i:j]))
  File "/home/jameson/.local/lib/python3.6/site-packages/medium_to_ghost/medium_post_parser.py", line 459, in handle_data
    self.cards[-1][1]["caption"] = data
IndexError: list index out of range

HTML file attached: 2019-01-01_Bitcoin-By-the-Numbers--2018-Recap-68a91789d804.txt