kurubushi / notion-cli-hs Goto Github PK
View Code? Open in Web Editor NEWA file uploader for Notion.
License: MIT License
A file uploader for Notion.
License: MIT License
It seems that Cloudflare bot management sometimes blocks an IP address and rejects all requests from this tool with 403 Forbidden.
$ notion-cli upload --page-url 'https://www.notion.so/xxxxx/yyyyy-zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz' test.txt
notion-cli: JSONParseException Request {
host = "www.notion.so"
port = 443
secure = True
requestHeaders = [("Accept","application/json"),("Content-Type","application/json; charset=utf-8"),("User-Agent","Mozilla/5.0 ..."),("Cookie","token_v2=*****")]
path = "/api/v3/getUploadFileUrl"
queryString = ""
method = "POST"
proxy = Nothing
rawBody = False
redirectCount = 10
responseTimeout = ResponseTimeoutDefault
requestVersion = HTTP/1.1
proxySecureMode = ProxySecureWithConnect
}
(Response {responseStatus = Status {statusCode = 403, statusMessage = "Forbidden"}, responseVersion = HTTP/1.1, responseHeaders = [
A request succeeds if the header has a valid __cf_bm
obtained from a browser.
Unfortunately, however, the expiration time of __cf_bm
is too short to be used repeatedly.
And if a request is not rejected by the management and simply fails authentication, the server responds with 401 Unauthorized (not 403 Forbidden).
I'm getting the below error while making notion-cli :
$ make notion-cli
cabal update
Downloading the latest package list from hackage.haskell.org
Package list of hackage.haskell.org is up to date at index-state 2022-12-22T07:53:18Z
cabal build
Resolving dependencies...
cabal: Could not resolve dependencies:
[__0] trying: notion-cli-0.1.0.0 (user goal)
[__1] next goal: bytestring (dependency of notion-cli)
[__1] rejecting: bytestring-0.11.3.1/installed-0.11.3.1 (conflict: notion-cli
=> bytestring^>=0.10.12)
[__1] skipping: bytestring-0.11.3.1, bytestring-0.11.3.0, bytestring-0.11.2.0,
bytestring-0.11.1.0, bytestring-0.11.0.0 (has the same characteristics that
caused the previous version to fail: excluded by constraint '^>=0.10.12' from
'notion-cli')
[__1] trying: bytestring-0.10.12.1
[__2] next goal: base (dependency of notion-cli)
[__2] rejecting: base-4.16.4.0/installed-4.16.4.0 (conflict: bytestring =>
base>=4.2 && <4.16)
[__2] skipping: base-4.17.0.0, base-4.16.4.0, base-4.16.3.0, base-4.16.2.0,
base-4.16.1.0, base-4.16.0.0 (has the same characteristics that caused the
previous version to fail: excluded by constraint '>=4.2 && <4.16' from
'bytestring')
[__2] rejecting: base-4.15.1.0, base-4.15.0.0, base-4.14.3.0, base-4.14.2.0,
base-4.14.1.0, base-4.14.0.0, base-4.13.0.0, base-4.12.0.0, base-4.11.1.0,
base-4.11.0.0, base-4.10.1.0, base-4.10.0.0, base-4.9.1.0, base-4.9.0.0,
base-4.8.2.0, base-4.8.1.0, base-4.8.0.0, base-4.7.0.2, base-4.7.0.1,
base-4.7.0.0, base-4.6.0.1, base-4.6.0.0, base-4.5.1.0, base-4.5.0.0,
base-4.4.1.0, base-4.4.0.0, base-4.3.1.0, base-4.3.0.0, base-4.2.0.2,
base-4.2.0.1, base-4.2.0.0, base-4.1.0.0, base-4.0.0.0, base-3.0.3.2,
base-3.0.3.1 (constraint from non-upgradeable package requires installed
instance)
[__2] fail (backjumping, conflict set: base, bytestring, notion-cli)
After searching the rest of the dependency tree exhaustively, these were the
goals I've had most trouble fulfilling: base, bytestring, notion-cli
make: *** [Makefile:18: notion-cli] Error 1
I've built the binary on Google Cloud shell and transferred the binary to my local machine but I get the following error.
error while loading shared libraries: libffi.so.7: cannot open shared object file: No such file or directory
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.