[GH-ISSUE #145] KeyError: 'title' when importing Firefox History #3118

Closed
opened 2026-03-14 21:09:06 +03:00 by kerem · 1 comment
Owner

Originally created by @nicolaschan on GitHub (Feb 18, 2019).
Original GitHub issue: https://github.com/ArchiveBox/ArchiveBox/issues/145

Describe the bug
When parsing firefox_history.json, the parser runs into a KeyError, because some entries might not have a title field.

Steps to reproduce
Steps to reproduce the behavior:

  1. Generate Firefox history JSON (containing some entries without description/title)
  2. Try to run ./archive on it
  3. See error

Screenshots or log output
If applicable, use screenshots or copy/pasted terminal output to help explain your problem.

nicolas@nicolas-desktop:~/ArchiveBox$ ./archive output/sources/firefox_history.json 
[*] [2019-02-18 01:20:50] Parsing new links from output/sources/firefox_history.json and fetching titles...
    Traceback (most recent call last):
  File "./archive", line 185, in <module>
    links = merge_links(archive_path=out_dir, import_path=source, only_new=ONLY_NEW)
  File "./archive", line 64, in merge_links
    raw_links, parser_name = parse_links(import_path)
  File "/home/nicolas/ArchiveBox/archivebox/parse.py", line 70, in parse_links
    links += list(parser_func(file))
  File "/home/nicolas/ArchiveBox/archivebox/parse.py", line 129, in parse_pinboard_json_export
    title = erg['title'].strip()
KeyError: 'title'

Here is an example of one such entry from my firefox_history.json:

{"timestamp":null,"description":null,"href":"https://support.mozilla.org/en-US/products/firefox"}

Software versions (please complete the following information):

  • ArchiveBox version: 74b99fe9eb
  • Python version: python3 --version [e.g. 3.7.0]
    Python 3.6.7
  • OS: [e.g. macOS 10.14]
    Linux 4.15.0-43-generic #46-Ubuntu SMP x86_64 x86_64 x86_64 GNU/Linux
  • Chrome version: chromium-browser --version [e.g. v73.1.2.3]
    Chromium 71.0.3578.98 Built on Ubuntu , running on Ubuntu 18.04
Originally created by @nicolaschan on GitHub (Feb 18, 2019). Original GitHub issue: https://github.com/ArchiveBox/ArchiveBox/issues/145 **Describe the bug** When parsing `firefox_history.json`, the parser runs into a KeyError, because some entries might not have a title field. **Steps to reproduce** Steps to reproduce the behavior: 1. Generate Firefox history JSON (containing some entries without description/title) 2. Try to run `./archive` on it 3. See error **Screenshots or log output** If applicable, use screenshots or copy/pasted terminal output to help explain your problem. ```bash nicolas@nicolas-desktop:~/ArchiveBox$ ./archive output/sources/firefox_history.json [*] [2019-02-18 01:20:50] Parsing new links from output/sources/firefox_history.json and fetching titles... Traceback (most recent call last): File "./archive", line 185, in <module> links = merge_links(archive_path=out_dir, import_path=source, only_new=ONLY_NEW) File "./archive", line 64, in merge_links raw_links, parser_name = parse_links(import_path) File "/home/nicolas/ArchiveBox/archivebox/parse.py", line 70, in parse_links links += list(parser_func(file)) File "/home/nicolas/ArchiveBox/archivebox/parse.py", line 129, in parse_pinboard_json_export title = erg['title'].strip() KeyError: 'title' ``` Here is an example of one such entry from my `firefox_history.json`: ```json {"timestamp":null,"description":null,"href":"https://support.mozilla.org/en-US/products/firefox"} ``` **Software versions (please complete the following information):** - ArchiveBox version: 74b99fe9eb68cd57e64648690a2e158952b6b18e - Python version: python3 --version [e.g. 3.7.0] Python 3.6.7 - OS: [e.g. macOS 10.14] Linux 4.15.0-43-generic #46-Ubuntu SMP x86_64 x86_64 x86_64 GNU/Linux - Chrome version: chromium-browser --version [e.g. v73.1.2.3] Chromium 71.0.3578.98 Built on Ubuntu , running on Ubuntu 18.04
kerem closed this issue 2026-03-14 21:09:11 +03:00
Author
Owner

@pirate commented on GitHub (Feb 19, 2019):

Fixed in latest master (bb5879a). Give it a try, and comment back if it's still not working. Thanks for reporting this!

<!-- gh-comment-id:464981077 --> @pirate commented on GitHub (Feb 19, 2019): Fixed in latest master (bb5879a). Give it a try, and comment back if it's still not working. Thanks for reporting this!
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/ArchiveBox#3118
No description provided.