Comments (16)
yes, I have updated the code to work for linux systems. It seems that on linux webkit is not accepting arguments.
from tiktok-signature.
same here, I ran into this error when I try to run it on server.
Is it possible a problem related to playwright setting?
Server context require some other special settings?
from tiktok-signature.
I'm getting this error when running the listen.js file
TikTok Signature server started (node:4574) UnhandledPromiseRejectionWarning: Error: Protocol error (Playwright.createContext): Browser has been closed. at /home/user/tiktok1/node_modules/playwright-core/lib/webkit/wkConnection.js:102:63 at new Promise (<anonymous>) at WKSession.send (/home/user/tiktok1/node_modules/playwright-core/lib/webkit/wkConnection.js:101:16) at WKBrowser.newContext (/home/user/tiktok1/node_modules/playwright-core/lib/webkit/wkBrowser.js:65:65) at WKBrowser.<anonymous> (/home/user/tiktok1/node_modules/playwright-core/lib/helper.js:64:31) at Signer.init (/home/user/tiktok1/tiktok-signature/index.js:48:39) (node:4574) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag
--unhandled-rejections=strict(see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1) (node:4574) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
it seems fix the issue by replacing the webkit in index.js with chromium
from tiktok-signature.
@hackmoore most probably you don't have dependencies installed.
Try running
DEBUG=* node browser.js ""
You will see what's missing.
Replacing webkit with chromium will not work generating signature for user/detail
from tiktok-signature.
@hackmoore most probably you don't have dependencies installed.
Try running
DEBUG=* node browser.js ""You will see what's missing.
Replacing webkit with chromium will not work generating signature for user/detail
I followed your recommendation about debug and researched the following:
"pw:browser:err Cannot parse arguments: Unknown option --no-sandbox"
Are you sure about correct initializing process using:
"this.browser = await webkit.launch(this.options);"
?
I assume that correct using is "this.browser = await webkit.launch();"
from tiktok-signature.
Does it work ? I cant get this working.
from tiktok-signature.
Do you get any error ? Can you debug it?
from tiktok-signature.
No just an empty answer.
from tiktok-signature.
Test it first using trending.py file, you should have same user agent when requesting
from tiktok-signature.
I'm using amazon linux 2 and not working.
It seems missing lots of libs.
Any idea?
[tiktok-signature]# node browser.js
Error: Protocol error (Playwright.createContext): Browser has been closed.
at /home/ec2-user/tiktok-signature/node_modules/playwright-core/lib/webkit/wkConnection.js:102:63
at new Promise ()
at WKSession.send (/home/ec2-user/tiktok-signature/node_modules/playwright-core/lib/webkit/wkConnection.js:101:16)
at WKBrowser.newContext (/home/ec2-user/tiktok-signature/node_modules/playwright-core/lib/webkit/wkBrowser.js:65:65)
at WKBrowser. (/home/ec2-user/tiktok-signature/node_modules/playwright-core/lib/helper.js:64:31)
at Signer.init (/home/ec2-user/tiktok-signature/index.js:49:39)
at async main (/home/ec2-user/tiktok-signature/browser.js:8:9)
[tiktok-signature]# DEBUG=* node browser.js ""
pw:browser /root/.cache/ms-playwright/webkit-1219/pw_run.sh --inspector-pipe --headless --no-startup-window +0ms
pw:browser pid=15176 +4ms
pw:protocol SEND ► {"id":1,"method":"Playwright.createContext"} +0ms
pw:browser:err /root/.cache/ms-playwright/webkit-1219/minibrowser-wpe/MiniBrowser: error while loading shared libraries: libvpx.so.5: cannot open shared object file: No such file or directory +0ms
pw:generic Error: read ECONNRESET
pw:generic at Pipe.onStreamRead (internal/stream_base_commons.js:205:27) [] +0ms
pw:browser <process did exit 127, null> +11ms
Error: Protocol error (Playwright.createContext): Browser has been closed.
at /home/ec2-user/tiktok-signature/node_modules/playwright-core/lib/webkit/wkConnection.js:102:63
at new Promise ()
at WKSession.send (/home/ec2-user/tiktok-signature/node_modules/playwright-core/lib/webkit/wkConnection.js:101:16)
at WKBrowser.newContext (/home/ec2-user/tiktok-signature/node_modules/playwright-core/lib/webkit/wkBrowser.js:65:65)
at WKBrowser. (/home/ec2-user/tiktok-signature/node_modules/playwright-core/lib/helper.js:64:31)
at Signer.init (/home/ec2-user/tiktok-signature/index.js:49:39)
at async main (/home/ec2-user/tiktok-signature/browser.js:8:9)
npm install error:
[tiktok-signature]$ sudo npm install
[email protected] install /home/ec2-user/tiktok-signature/node_modules/playwright
node install.js
(node:14857) UnhandledPromiseRejectionWarning: Error: EACCES: permission denied, mkdir '/root/.cache/ms-playwright/.links'
(Use node --trace-warnings ...
to show where the warning was created)
(node:14857) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict
(see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:14857) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
added 38 packages from 79 contributors and audited 38 packages in 0.958s
2 packages are looking for funding
run npm fund
for details
found 0 vulnerabilities
from tiktok-signature.
@kangchih you have to install libpvx see this tutorial https://zoomadmin.com/HowToInstall/UbuntuPackage/libvpx-dev
from tiktok-signature.
And you can define a directory where you want to install the browers.
PLAYWRIGHT_BROWSERS_PATH: /var/www/pw-browsers
It's not mandatory but it helps.
from tiktok-signature.
Test it first using trending.py file, you should have same user agent when requesting
It's ok now.
from tiktok-signature.
I was running this on an instance of ubuntu server which I assume was missing libraries. I managed to install the dependencies for it by running the following command:
sudo apt-get install -y libwayland-dev libegl1-mesa libvpx-dev libopus-dev woff2 libwebpdemux2 libglfw3-dev libgles2-mesa-dev libguddev1.0
The problem I'm having now is when I run the listen.js file, I get the following error when running a curl request:
Error: Evaluation failed: ReferenceError: Can't find variable: generateSignature at WKExecutionContext.evaluate (/home/user/tiktok1/node/tiktok-signature/node_modules/playwright-core/lib/webkit/wkExecutionContext.js:50:23) at processTicksAndRejections (internal/process/task_queues.js:97:5) at async FrameManager.waitForSignalsCreatedBy (/home/user/tiktok1/node/tiktok-signature/node_modules/playwright-core/lib/frames.js:81:28) at async FrameExecutionContext._doEvaluateInternal (/home/user/tiktok1/node/tiktok-signature/node_modules/playwright-core/lib/dom.js:42:16) at async Signer.sign (/home/user/tiktok1/node/tiktok-signature/index.js:96:15) at async IncomingMessage.<anonymous> (/home/user/tiktok1/node/tiktok-signature/listen.js:38:27) -- ASYNC -- at Frame.<anonymous> (/home/user/tiktok1/node/tiktok-signature/node_modules/playwright-core/lib/helper.js:63:23) at Page.evaluate (/home/user/tiktok1/node/tiktok-signature/node_modules/playwright-core/lib/page.js:257:33) at Page.<anonymous> (/home/user/tiktok1/node/tiktok-signature/node_modules/playwright-core/lib/helper.js:64:31) at Signer.sign (/home/user/tiktok1/node/tiktok-signature/index.js:96:31) at processTicksAndRejections (internal/process/task_queues.js:97:5) at async IncomingMessage.<anonymous> (/home/user/tiktok1/node/tiktok-signature/listen.js:38:27)
from tiktok-signature.
@hackmoore this error appear when you request for signature before server is initialized, give it a few seconds to load page and try after that.
from tiktok-signature.
i have the same issue on centos:
Error: Protocol error (Playwright.createContext): Browser has been closed.
at /root/test/node_modules/playwright-core/lib/webkit/wkConnection.js:102:63
at new Promise ()
at WKSession.send (/root/test/node_modules/playwright-core/lib/webkit/wkConnection.js:101:16)
at WKBrowser.newContext (/root/test/node_modules/playwright-core/lib/webkit/wkBrowser.js:65:65)
at WKBrowser. (/root/test/node_modules/playwright-core/lib/helper.js:64:31)
at Signer.init (/root/test/node_modules/tiktok-signature/index.js:49:39)
at async main (/root/test/node_modules/tiktok-signature/browser.js:8:9)
from tiktok-signature.
Related Issues (20)
- trending.py returns empty response HOT 2
- Pulling data for all user videos? HOT 2
- Normal search example HOT 1
- How to sign a hashtag request? HOT 1
- python support HOT 4
- How do you get the downloadAddress to work? HOT 1
- X-bogus on video list api
- User-videos request is returning empty data
- URL length issue reported, localhost: 8080/signature
- Hashtag is only getting 30 results
- how to setup in vercel
- Fetch user info returns empty info HOT 2
- Fetching user videos not working on deployment HOT 4
- Frequent Empty String Returns in examples/user-video.js HOT 19
- Fail to get SEC_UID HOT 6
- How to get user infor HOT 6
- 请问 是否能在直接浏览器环境中使用
- How to get TT_REQ_PERM_URL for keyword search HOT 1
- Empty Response HOT 12
- TikTok not rendering when starting app HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tiktok-signature.