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

ValueError: invalid literal for int() with base 10 #13

Open
storkk opened this issue Dec 20, 2024 · 1 comment
Open

ValueError: invalid literal for int() with base 10 #13

storkk opened this issue Dec 20, 2024 · 1 comment

Comments

@storkk
Copy link

storkk commented Dec 20, 2024

Fresh install from pip: pocket-to-sqlite, version 0.2.3

$ pocket-to-sqlite fetch pocket.db
  [------------------------------------]  31/4625  1d 23:30:14
Traceback (most recent call last):
  File "/home/storkk/pocket/venv/bin/pocket-to-sqlite", line 8, in <module>
    sys.exit(cli())
             ^^^^^
  File "/home/storkk/pocket/venv/lib/python3.12/site-packages/click/core.py", line 1157, in __call__
    return self.main(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/storkk/pocket/venv/lib/python3.12/site-packages/click/core.py", line 1078, in main
    rv = self.invoke(ctx)
         ^^^^^^^^^^^^^^^^
  File "/home/storkk/pocket/venv/lib/python3.12/site-packages/click/core.py", line 1688, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/storkk/pocket/venv/lib/python3.12/site-packages/click/core.py", line 1434, in invoke
    return ctx.invoke(self.callback, **ctx.params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/storkk/pocket/venv/lib/python3.12/site-packages/click/core.py", line 783, in invoke
    return __callback(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/storkk/pocket/venv/lib/python3.12/site-packages/pocket_to_sqlite/cli.py", line 101, in fetch
    utils.save_items(bar, db)
  File "/home/storkk/pocket/venv/lib/python3.12/site-packages/pocket_to_sqlite/utils.py", line 18, in save_items
    "author_id": int(details["author_id"]),
                 ^^^^^^^^^^^^^^^^^^^^^^^^^
ValueError: invalid literal for int() with base 10: 'Brian Hayes'
@storkk
Copy link
Author

storkk commented Dec 20, 2024

Here is the details item, in case that helps:

{
    "author_id": "Brian Hayes",
    "name": "Brian Hayes",
    "url": "http://bit-player.org/author/brian",
    "item_id": "68155386"
}

If Pocket changed their internal representation to something more normalized in the time since it became a Mozilla project, then it's possible this is some kind of legacy format, or some format Pocket have introduced to help their new systems parse legacy saves. No idea, just grasping at straws at how an "id" field could contain the string representation... but most of my saved pages will have been from >10 years ago.

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

1 participant