Coder Social home page Coder Social logo

Comments (16)

carcabot avatar carcabot commented on September 19, 2024 2

yes, I have updated the code to work for linux systems. It seems that on linux webkit is not accepting arguments.

from tiktok-signature.

jonas-meng avatar jonas-meng commented on September 19, 2024

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.

jonas-meng avatar jonas-meng commented on September 19, 2024

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.

carcabot avatar carcabot commented on September 19, 2024

@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.

brain-buster avatar brain-buster commented on September 19, 2024

@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.

toxicity1985 avatar toxicity1985 commented on September 19, 2024

Does it work ? I cant get this working.

from tiktok-signature.

carcabot avatar carcabot commented on September 19, 2024

Do you get any error ? Can you debug it?

from tiktok-signature.

toxicity1985 avatar toxicity1985 commented on September 19, 2024

No just an empty answer.

from tiktok-signature.

carcabot avatar carcabot commented on September 19, 2024

Test it first using trending.py file, you should have same user agent when requesting

from tiktok-signature.

kangchih avatar kangchih commented on September 19, 2024

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.

carcabot avatar carcabot commented on September 19, 2024

@kangchih you have to install libpvx see this tutorial https://zoomadmin.com/HowToInstall/UbuntuPackage/libvpx-dev

from tiktok-signature.

toxicity1985 avatar toxicity1985 commented on September 19, 2024

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.

toxicity1985 avatar toxicity1985 commented on September 19, 2024

Test it first using trending.py file, you should have same user agent when requesting

It's ok now.

from tiktok-signature.

hackmoore avatar hackmoore commented on September 19, 2024

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.

carcabot avatar carcabot commented on September 19, 2024

@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.

Pezhvak avatar Pezhvak commented on September 19, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.