Skip to content

BOOK第一次加载成功,更新豆瓣内容后再执行出错 httpx.HTTPStatusError: Client error '400 Bad Request' for.. #11

@LollyWang

Description

@LollyWang

首先感谢提供这么好的方案!
执行打印如下
Run python -u scripts/douban.py "book"
notion 183
total = 0
size = 50
total = 0
size = 100
total = 0
size = 150
total = 0
size = 168
total = 0
size = 15
插入我在北京送快递
Traceback (most recent call last):
File "/opt/hostedtoolcache/Python/3.9.19/x64/lib/python3.9/site-packages/notion_client/client.py", line 118, in _parse_response
response.raise_for_status()
File "/opt/hostedtoolcache/Python/3.9.19/x64/lib/python3.9/site-packages/httpx/_models.py", line 763, in raise_for_status
raise HTTPStatusError(message, request=request, response=self)
httpx.HTTPStatusError: Client error '400 Bad Request' for url 'https://api.notion.com/v1/databases/None/query'
For more information check: https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/400

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/home/runner/work/douban2notion/douban2notion/scripts/douban.py", line 277, in
insert_book()
File "/home/runner/work/douban2notion/douban2notion/scripts/douban.py", line 234, in insert_book
book["作者"] = [
File "/home/runner/work/douban2notion/douban2notion/scripts/douban.py", line 235, in
notion_helper.get_relation_id(
File "/opt/hostedtoolcache/Python/3.9.19/x64/lib/python3.9/site-packages/retrying.py", line 56, in wrapped_f
return Retrying(*dargs, **dkw).call(f, *args, **kw)
File "/opt/hostedtoolcache/Python/3.9.19/x64/lib/python3.9/site-packages/retrying.py", line 266, in call
raise attempt.get()
File "/opt/hostedtoolcache/Python/3.9.19/x64/lib/python3.9/site-packages/retrying.py", line 301, in get
six.reraise(self.value[0], self.value[1], self.value[2])
File "/opt/hostedtoolcache/Python/3.9.19/x64/lib/python3.9/site-packages/six.py", line 719, in reraise
raise value
File "/opt/hostedtoolcache/Python/3.9.19/x64/lib/python3.9/site-packages/retrying.py", line 251, in call
attempt = Attempt(fn(*args, **kwargs), attempt_number, False)
File "/home/runner/work/douban2notion/douban2notion/scripts/notion_helper.py", line 186, in get_relation_id
response = self.client.databases.query(database_id=id, filter=filter)
File "/opt/hostedtoolcache/Python/3.9.19/x64/lib/python3.9/site-packages/notion_client/api_endpoints.py", line 132, in query
return self.parent.request(
File "/opt/hostedtoolcache/Python/3.9.19/x64/lib/python3.9/site-packages/notion_client/client.py", line 194, in request
return self._parse_response(response)
File "/opt/hostedtoolcache/Python/3.9.19/x64/lib/python3.9/site-packages/notion_client/client.py", line 126, in _parse_response
raise APIResponseError(response, body["message"], code)
notion_client.errors.APIResponseError: path failed validation: path.database_id should be a valid uuid, instead was "None".
Error: Process completed with exit code 1.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions