I spent two days watching Valorant streams to get a drop. I got bored...
- Windows or Linux OS
- Network connection (So obvious...)
- Nodejs and NPM
- screen (Optional, just for background running)
- Login your twitch account
- Open inspector(F12 or Ctlr+Shift+I) on main site
- Find stored cookie section
- Copy auth-token and the token's expires date
- Clone this repo
- Install the dependencies with
npm install
- After start the program with
npm start
- Download docker-compose-example.yml
- Rename docker-compose.yml
- Replace environments
- Run
docker-compose up -d
auth-token: rxk38rh5qtyw95fkvm7kgfceh4mh6u
expire date: 2020-04-13T22:22:22.010Z
In order to protect the host environment from untrusted web content, Chrome uses multiple layers of sandboxing. For this to work properly,
the host should be configured first. If there's no good sandbox for Chrome to use, it will crash
with the error No usable sandbox!
.
If you absolutely trust the content you open in Chrome, you can launch Chrome
with the --no-sandbox
argument:
const browser = await puppeteer.launch({args: ['--no-sandbox', '--disable-setuid-sandbox']});
NOTE: Running without a sandbox is strongly discouraged. Consider configuring a sandbox instead.
There are 2 ways to configure a sandbox in Chromium.
[recommended] Enable user namespace cloning
User namespace cloning is only supported by modern kernels. Unprivileged user namespaces are generally fine to enable, but in some cases they open up more kernel attack surface for (unsandboxed) non-root processes to elevate to kernel privileges.
sudo sysctl -w kernel.unprivileged_userns_clone=1
[alternative] Setup setuid sandbox
The setuid sandbox comes as a standalone executable and is located next to the Chromium that Puppeteer downloads. It is fine to re-use the same sandbox executable for different Chromium versions, so the following could be done only once per host environment:
# cd to the downloaded instance
cd <project-dir-path>/node_modules/puppeteer/.local-chromium/linux-<revision>/chrome-linux/
sudo chown root:root chrome_sandbox
sudo chmod 4755 chrome_sandbox
# copy sandbox executable to a shared location
sudo cp -p chrome_sandbox /usr/local/sbin/chrome-devel-sandbox
# export CHROME_DEVEL_SANDBOX env variable
export CHROME_DEVEL_SANDBOX=/usr/local/sbin/chrome-devel-sandbox
You might want to export the CHROME_DEVEL_SANDBOX
env variable by default. In this case, add the following to the ~/.bashrc
or .zshenv
:
export CHROME_DEVEL_SANDBOX=/usr/local/sbin/chrome-devel-sandbox
By puppeteer wiki: https://github.com/puppeteer/puppeteer/blob/master/docs/troubleshooting.md
Try to again with higher delay. Default delay:
const scrollDelay = 2000;
Try to non-headless mode. Edit headless value to true
, like this:
const browser = await puppeteer.launch({ headless: true , ignoreDefaultArgs: ['--mute-audio']});
- Keybase at https://keybase.io/d3v_
- Website at https://zsmark.dev
These codes for educational and research purposes only. Do not attempt to violate the law with anything contained here. I will not be responsible for your any illegal actions.