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

HTTPError( requests.exceptions.HTTPError: Invalid input.) - Even after changing the limit to 100 #63

Closed
theneo13 opened this issue Oct 7, 2021 · 4 comments

Comments

@theneo13
Copy link

theneo13 commented Oct 7, 2021

Traceback (most recent call last):
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.9_3.9.2032.0_x64__qbz5n2kfra8p0\lib\runpy.py", line 197, in _run_module_as_main
return _run_code(code, main_globals, None,
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.9_3.9.2032.0_x64__qbz5n2kfra8p0\lib\runpy.py", line 87, in run_code
exec(code, run_globals)
File "C:\Users\hello\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\kindle2notion_main
.py", line 49, in
main()
File "C:\Users\hello\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\click\core.py", line 1137, in call
return self.main(*args, **kwargs)
File "C:\Users\hello\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\click\core.py", line 1062, in main
rv = self.invoke(ctx)
File "C:\Users\hello\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\click\core.py", line 1404, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "C:\Users\hello\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\click\core.py", line 763, in invoke
return _callback(*args, **kwargs)
File "C:\Users\hello\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\kindle2notion_main
.py", line 38, in main
export_to_notion(
File "C:\Users\hello\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\kindle2notion\exporting.py", line 35, in export_to_notion
message = _add_book_to_notion(
File "C:\Users\hello\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\kindle2notion\exporting.py", line 87, in _add_book_to_notion
notion_collection_view_rows = notion_collection_view.collection.get_rows()
File "C:\Users\hello\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\notion\collection.py", line 239, in get_rows
return self.query(**kwargs)
File "C:\Users\hello\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\notion\collection.py", line 236, in query
return CollectionQuery(self, self._get_a_collection_view(), **kwargs).execute()
File "C:\Users\hello\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\notion\collection.py", line 385, in execute
self._client.query_collection(
File "C:\Users\hello\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\notion\client.py", line 294, in query_collection
return self._store.call_query_collection(*args, **kwargs)
File "C:\Users\hello\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\notion\store.py", line 344, in call_query_collection
response = self._client.post("queryCollection", data).json()
File "C:\Users\hello\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\notion\client.py", line 260, in post
raise HTTPError(
requests.exceptions.HTTPError: Invalid input.

I used this without any error but recently installed SSD in my machine with a fresh install of windows. And installed python just to use this amazing script, but getting this error. I followed the solution and changed the limit to 100, but it isn't working anymore.

@paperboi
Copy link
Owner

Seems like Notion made some changes to its backend. Will need to refer to Notion-py docs again and take a look at this issue. Thanks for reporting the issue!

@ttuan
Copy link

ttuan commented Dec 23, 2021

@theneo13 I have the same problem. Fixed it with this command:

pip install git+https://github.com/jamalex/notion-py.git@refs/pull/352/merge

and rerun python -m kindle2notion 'notion_token' 'notion_table_id' 'clipping_file_path'

Reference: jamalex/notion-py#352 (comment)

@cleswell
Copy link

cleswell commented Mar 7, 2022

does anyone have any updates on this? Tried every trick in the book...

@paperboi
Copy link
Owner

paperboi commented Jul 15, 2022

Hi @theneo13 @ttuan @cleswell , it took a while to find a workable solution (and find time to implement it) but please update the package on your local system and refer to the docs on how to run it. I essentially had to move to another Notion Python wrapper that's makes API calls through the official Notion API.

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

4 participants