yannick-cw / notion-ocr

Adding OCR support to Notion
Other
140 stars 4 forks source link

HttpExceptionRequest #13

Closed dschinkel closed 7 months ago

dschinkel commented 7 months ago

Not sure if it just can't work in modals or what. It's like it can't find my local notion desktop instance or something.

This is image gallery here where I placed the image and ocr callout. Does this only work on the web version of notion or something? I'm using desktop (OS X Sonoma 14.2.1 (23C71))

tesseract is usable

Screenshot 2024-02-08 at 12 27 53 PM

notion-ocr -t "v02%3Auser_token_or_cookies%3As5MbyNNQnI3u2vst5-AmbglA7V8w_zpdOssJeD3UbS5CQYhNt3PGhadkxos4n_OblSJ0ZGyH3yD31r1eH6FKRaQhyYGr2FXCt4RKZv7G5z8xHWCOl8JHO8SbU1MrNi0iLb85" -s 1

produced this error

notion-ocr: HttpExceptionRequest Request {
  host                 = "www.notion.so"
  port                 = 443
  secure               = True
  requestHeaders       = [("Cookie","token_v2=v02%3Auser_token_or_cookies%3As5MbyNNQnI3u2vst5-AmbglA7V8w_zpdOssJeD3UbS5CQYhNt3PGhadkxos4n_OblSJ0ZGyH3yD31r1eH6FKRaQhyYGr2FXCt4RKZv7G5z8xHWCOl8JHO8SbU1MrNi0iLb85"),("Content-Type","application/json"),("User-Agent","haskell wreq-0.5.3.2")]
  path                 = "/api/v3/searchBlocks"
  queryString          = ""
  method               = "POST"
  proxy                = Nothing
  rawBody              = False
  redirectCount        = 10
  responseTimeout      = ResponseTimeoutDefault
  requestVersion       = HTTP/1.1
}
 (StatusCodeException (Response {responseStatus = Status {statusCode = 404, statusMessage = "Not Found"}, responseVersion = HTTP/1.1, responseHeaders = [("Date","Thu, 08 Feb 2024 18:19:36 GMT"),("Content-Type","text/html; charset=utf-8"),("Transfer-Encoding","chunked"),("Connection","keep-alive"),("Set-Cookie","AWSALBTG=Xs8n+EZShwjslttW6uZQYdLlml+bMX21HFJS2a0ppRIhMsw5s2GkuOg5wwpsG5261CRJBL3eXcTeKpEXV7bUasgDu0PvCGoEcmaNcwJaIXhi3BAMI+rRQoAhf1GBhaE4tsfH9xzKJCf1Ev1oRa23yMKaFEELHh7qxVTwafq4pbzJ; Expires=Thu, 15 Feb 2024 18:19:36 GMT; Path=/"),("X-Notion-Request-Id","fac14b2c-7901-44b9-b86f-6f718b3dd34f"),("Content-Security-Policy","default-src 'none'"),("X-DNS-Prefetch-Control","off"),("X-Frame-Options","SAMEORIGIN"),("Strict-Transport-Security","max-age=31536000; includeSubDomains; preload"),("X-Download-Options","noopen"),("X-Content-Type-Options","nosniff"),("X-Permitted-Cross-Domain-Policies","none"),("Referrer-Policy","strict-origin-when-cross-origin"),("X-XSS-Protection","0"),("Vary","Accept-Encoding"),("CF-Cache-Status","DYNAMIC"),("Set-Cookie","AWSALBTGCORS=Xs8n+EZShwjslttW6uZQYdLlml+bMX21HFJS2a0ppRIhMsw5s2GkuOg5wwpsG5261CRJBL3eXcTeKpEXV7bUasgDu0PvCGoEcmaNcwJaIXhi3BAMI+rRQoAhf1GBhaE4tsfH9xzKJCf1Ev1oRa23yMKaFEELHh7qxVTwafq4pbzJ; Expires=Thu, 15 Feb 2024 18:19:36 GMT; Path=/; SameSite=None; Secure"),("Set-Cookie","notion_browser_id=301d0fc4-18c8-4d3d-9b66-bc29fad979d4; Domain=www.notion.so; Path=/; Expires=Fri, 07 Feb 2025 18:19:36 GMT; Secure"),("Set-Cookie","device_id=045bc9a1-d4ba-4fc1-8919-c0d58dad4042; Domain=www.notion.so; Path=/; Expires=Fri, 07 Feb 2025 18:19:36 GMT; Secure"),("Set-Cookie","notion_check_cookie_consent=false; Domain=www.notion.so; Path=/; Expires=Fri, 09 Feb 2024 18:19:36 GMT; Secure"),("Set-Cookie","__cf_bm=HRQNW6YftZ8p0H8VH1tfc_sB.dXNfUzacxW7V_hQB0g-1707416376-1-ARKcY2xJiWwiFVjHjOfueWS7287Q71/HBdXlIQcXw/RCTVOVJ7mHH3qMrinWgC7YRgQMrkKtxnq0U8FYZXbvROU=; path=/; expires=Thu, 08-Feb-24 18:49:36 GMT; domain=.notion.so; HttpOnly; Secure; SameSite=None"),("Set-Cookie","_cfuvid=clvZCTHYrTcIGeCgVkw4BqSfMPGdSSmmhwRxAejHmqs-1707416376538-0-604800000; path=/; domain=.notion.so; HttpOnly; Secure; SameSite=None"),("Server","cloudflare"),("CF-RAY","8525e1c0ed11606c-ORD"),("Content-Encoding","gzip"),("alt-svc","h3=\":443\"; ma=86400")], responseBody = (), responseCookieJar = CJ {expose = [Cookie {cookie_name = "_cfuvid", cookie_value = "clvZCTHYrTcIGeCgVkw4BqSfMPGdSSmmhwRxAejHmqs-1707416376538-0-604800000", cookie_expiry_time = 3023-06-11 00:00:00 UTC, cookie_domain = "notion.so", cookie_path = "/", cookie_creation_time = 2024-02-08 18:19:36.498828 UTC, cookie_last_access_time = 2024-02-08 18:19:36.498828 UTC, cookie_persistent = False, cookie_host_only = False, cookie_secure_only = True, cookie_http_only = True},Cookie {cookie_name = "__cf_bm", cookie_value = "HRQNW6YftZ8p0H8VH1tfc_sB.dXNfUzacxW7V_hQB0g-1707416376-1-ARKcY2xJiWwiFVjHjOfueWS7287Q71/HBdXlIQcXw/RCTVOVJ7mHH3qMrinWgC7YRgQMrkKtxnq0U8FYZXbvROU=", cookie_expiry_time = 2024-02-08 18:49:36 UTC, cookie_domain = "notion.so", cookie_path = "/", cookie_creation_time = 2024-02-08 18:19:36.498828 UTC, cookie_last_access_time = 2024-02-08 18:19:36.498828 UTC, cookie_persistent = True, cookie_host_only = False, cookie_secure_only = True, cookie_http_only = True},Cookie {cookie_name = "notion_check_cookie_consent", cookie_value = "false", cookie_expiry_time = 3023-06-11 00:00:00 UTC, cookie_domain = "www.notion.so", cookie_path = "/", cookie_creation_time = 2024-02-08 18:19:36.498828 UTC, cookie_last_access_time = 2024-02-08 18:19:36.498828 UTC, cookie_persistent = False, cookie_host_only = False, cookie_secure_only = True, cookie_http_only = False},Cookie {cookie_name = "device_id", cookie_value = "045bc9a1-d4ba-4fc1-8919-c0d58dad4042", cookie_expiry_time = 3023-06-11 00:00:00 UTC, cookie_domain = "www.notion.so", cookie_path = "/", cookie_creation_time = 2024-02-08 18:19:36.498828 UTC, cookie_last_access_time = 2024-02-08 18:19:36.498828 UTC, cookie_persistent = False, cookie_host_only = False, cookie_secure_only = True, cookie_http_only = False},Cookie {cookie_name = "notion_browser_id", cookie_value = "301d0fc4-18c8-4d3d-9b66-bc29fad979d4", cookie_expiry_time = 3023-06-11 00:00:00 UTC, cookie_domain = "www.notion.so", cookie_path = "/", cookie_creation_time = 2024-02-08 18:19:36.498828 UTC, cookie_last_access_time = 2024-02-08 18:19:36.498828 UTC, cookie_persistent = False, cookie_host_only = False, cookie_secure_only = True, cookie_http_only = False},Cookie {cookie_name = "AWSALBTGCORS", cookie_value = "Xs8n+EZShwjslttW6uZQYdLlml+bMX21HFJS2a0ppRIhMsw5s2GkuOg5wwpsG5261CRJBL3eXcTeKpEXV7bUasgDu0PvCGoEcmaNcwJaIXhi3BAMI+rRQoAhf1GBhaE4tsfH9xzKJCf1Ev1oRa23yMKaFEELHh7qxVTwafq4pbzJ", cookie_expiry_time = 3023-06-11 00:00:00 UTC, cookie_domain = "www.notion.so", cookie_path = "/", cookie_creation_time = 2024-02-08 18:19:36.498828 UTC, cookie_last_access_time = 2024-02-08 18:19:36.498828 UTC, cookie_persistent = False, cookie_host_only = True, cookie_secure_only = True, cookie_http_only = False},Cookie {cookie_name = "AWSALBTG", cookie_value = "Xs8n+EZShwjslttW6uZQYdLlml+bMX21HFJS2a0ppRIhMsw5s2GkuOg5wwpsG5261CRJBL3eXcTeKpEXV7bUasgDu0PvCGoEcmaNcwJaIXhi3BAMI+rRQoAhf1GBhaE4tsfH9xzKJCf1Ev1oRa23yMKaFEELHh7qxVTwafq4pbzJ", cookie_expiry_time = 3023-06-11 00:00:00 UTC, cookie_domain = "www.notion.so", cookie_path = "/", cookie_creation_time = 2024-02-08 18:19:36.498828 UTC, cookie_last_access_time = 2024-02-08 18:19:36.498828 UTC, cookie_persistent = False, cookie_host_only = True, cookie_secure_only = False, cookie_http_only = False},Cookie {cookie_name = "token_v2", cookie_value = "v02%3Auser_token_or_cookies%3As5MbyNNQnI3u2vst5-AmbglA7V8w_zpdOssJeD3UbS5CQYhNt3PGhadkxos4n_OblSJ0ZGyH3yD31r1eH6FKRaQhyYGr2FXCt4RKZv7G5z8xHWCOl8JHO8SbU1MrNi0iLb85", cookie_expiry_time = 2024-03-29 18:19:36.175084 UTC, cookie_domain = "notion.so", cookie_path = "/", cookie_creation_time = 2024-02-08 18:19:36.175084 UTC, cookie_last_access_time = 2024-02-08 18:19:36.260814 UTC, cookie_persistent = False, cookie_host_only = False, cookie_secure_only = True, cookie_http_only = True}]}, responseClose' = ResponseClose}) "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n<meta charset=\"utf-8\">\n<title>Error</title>\n</head>\n<body>\n<pre>Cannot POST /api/v3/searchBlocks</pre>\n</body>\n</html>\n")
Screenshot 2024-02-08 at 12 18 43 PM
dschinkel commented 7 months ago

I missed that this repo was marked as unmaintained and that you said the notion API had changed and that you don't have time to devote to updating the code here. Closing...