paperboi / kindle2notion

Export all clippings from your Kindle device to a database in Notion.
https://pypi.org/project/kindle2notion/
MIT License
903 stars 120 forks source link

raise HTTPError( requests.exceptions.HTTPError: Invalid input. #66

Closed ShuibCodes closed 2 years ago

ShuibCodes commented 3 years ago

I tried running the script and i get that error

zaan commented 3 years ago

I had the same issue. Running on Mac OS Big Sur, MacBook Pro M1, Python 3.10. Traceback:



Traceback (most recent call last):
  File "/usr/local/bin/kindle2notion", line 8, in <module>
    sys.exit(main())
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/click/core.py", line 1134, in __call__
    return self.main(*args, **kwargs)
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/click/core.py", line 1059, in main
    rv = self.invoke(ctx)
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/click/core.py", line 1401, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/click/core.py", line 767, in invoke
    return __callback(*args, **kwargs)
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/kindle2notion/__main__.py", line 26, in main
    export_to_notion(books, enable_highlight_date, enable_book_cover, notion_token, notion_table_id)
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/kindle2notion/exporting.py", line 29, in export_to_notion
    message = _add_book_to_notion(title, author, highlight_count, aggregated_text_from_highlights, last_date,
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/kindle2notion/exporting.py", line 60, in _add_book_to_notion
    notion_collection_view_rows = notion_collection_view.collection.get_rows()
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/notion/collection.py", line 180, in get_rows
    return self.query(**kwargs)
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/notion/collection.py", line 177, in query
    return CollectionQuery(self, self._get_a_collection_view(), **kwargs).execute()
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/notion/collection.py", line 322, in execute
    self._client.query_collection(
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/notion/client.py", line 243, in query_collection
    return self._store.call_query_collection(*args, **kwargs)
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/notion/store.py", line 338, in call_query_collection
    response = self._client.post("queryCollection", data).json()
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/notion/client.py", line 209, in post
    raise HTTPError(
requests.exceptions.HTTPError: Invalid input.
vin1391 commented 2 years ago

Same problem for me as well. OS: Windows 10

File "C:\Users\Vinlite\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\Vinlite\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\Vinlite\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\Vinlite\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.

ttuan commented 2 years ago

I fixed with this temporary solution: https://github.com/paperboi/kindle2notion/issues/63#issuecomment-1000267633

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: https://github.com/jamalex/notion-py/pull/352#issuecomment-937553265

benooirj commented 2 years ago

I fixed with this temporary solution: #63 (comment)

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)

I tried this but got this error instead: ERROR: Command errored out with exit status 1: command: git version cwd: None Complete output (2 lines): xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun

WARNING: Discarding git+https://github.com/jamalex/notion-py.git@refs/pull/352/merge. Command errored out with exit status 1: git version Check the logs for full command output. ERROR: Command errored out with exit status 1: git version Check the logs for full command output.

What should I do?

ttuan commented 2 years ago

@benooirj Maybe your xcode commandline tools needs to be updated.

You could try this command: xcode-select --install https://stackoverflow.com/a/52522566/4381022

damouzo commented 2 years ago

Nice tool! Same error from here (Windows 10), I tried the temporary solution but give the same error after the next warning:

I fixed with this temporary solution: #63 (comment)

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)

C:\Windows\system32>pip install git+https://github.com/jamalex/notion-py.git@refs/pull/352/merge Collecting git+https://github.com/jamalex/notion-py.git@refs/pull/352/merge Cloning https://github.com/jamalex/notion-py.git (to revision refs/pull/352/merge) to c:\users\danie\appdata\local\temp\pip-req-build-8_bv7o4t Running command git clone --filter=blob:none -q https://github.com/jamalex/notion-py.git 'C:\Users\danie\AppData\Local\Temp\pip-req-build-8_bv7o4t' WARNING: Did not find branch or tag 'refs/pull/352/merge', assuming revision or ref. Running command git fetch -q https://github.com/jamalex/notion-py.git refs/pull/352/merge Running command git checkout -q 017de43af765e232f6ba4403c5fa3513e614c955 Resolved https://github.com/jamalex/notion-py.git to commit 017de43af765e232f6ba4403c5fa3513e614c955 Preparing metadata (setup.py) ... done

WintermuteTwin commented 2 years ago

Same error here and the temp fix didn't resolve it. Mac OS Big Sur, MacBook Pro M1, Python 3.93

Rukenshia commented 2 years ago

Nice tool! Same error from here (Windows 10), I tried the temporary solution but give the same error after the next warning:

I fixed with this temporary solution: #63 (comment)

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)

C:\Windows\system32>pip install git+jamalex/notion-py.git@refs#352 (merge) Collecting git+jamalex/notion-py.git@refs#352 (merge) Cloning jamalex/notion-py.git (to revision refs/pull/352/merge) to c:\users\danie\appdata\local\temp\pip-req-build-8_bv7o4t Running command git clone --filter=blob:none -q jamalex/notion-py.git 'C:\Users\danie\AppData\Local\Temp\pip-req-build-8_bv7o4t' WARNING: Did not find branch or tag 'refs/pull/352/merge', assuming revision or ref. Running command git fetch -q jamalex/notion-py.git refs/pull/352/merge Running command git checkout -q 017de43af765e232f6ba4403c5fa3513e614c955 Resolved jamalex/notion-py.git to commit 017de43af765e232f6ba4403c5fa3513e614c955 Preparing metadata (setup.py) ... done

Got it working by directly installing the fork (instead of the ref to the PR):

# in a pipenv (in my case)

pip install kindle2notion
pip install git+https://github.com/wsykala/notion-py.git
python -m kindle2notion .....
paperboi commented 2 years ago

Hi, just got around to this- please update to the latest version (1.0.0) and try again. The setup is a little different too so please go through the README file and docs. Latest solution does away with notion-py and the code is built upon the official API (python wrapper is notional which is based on notion-sdk-py.