giovanni-orciuolo / Valorant-watcher

Automatic watching the twitch to get Valorant drop

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Valorant watcher

I spent two days watching Valorant streams to get a drop. I got bored...

GitHub package.json version GitHub GitHub repo size GitHub issues

Requirements

  • Windows or Linux OS
  • Network connection (So obvious...)
  • Nodejs and NPM

Features

  • πŸŽ₯ True HTTP Live Streaming support (Forget the #4000 error code)
  • πŸ” Cookie based login
  • πŸ“œ Auto accept cookie policy
  • πŸ‘¨β€πŸ’» Choice random streamer with drop-enabled tag
  • 🀐 Unmute stream
  • πŸ›  Detect mature content based stream and interact it
  • πŸ›‘ Proxy option
  • πŸ“¦ Deployable to VPS by docker

Installation

!! Working only desktop environment, therefore use my docker image!!

Windows

Someone please test it πŸ™

Linux

  1. Login your twitch account
  2. Open inspector(F12 or Ctlr+Shift+I) on main site
  3. Find stored cookie section
  4. Copy auth-token
  5. Clone this repo
  6. Install chromium: TUTORIAL πŸ€—
  7. Locate chromium executable: whereis chromium
  8. Install the dependencies with npm install
  9. Start the program with npm start

Docker

Docker Cloud Build Status Docker Image Version (latest by date) Docker Pulls Docker Image Size (latest by date)

Requirements

Useage

  1. Download docker-compose-example.yml
  2. Rename docker-compose.yml
  3. Open and replace the token environment record
  4. Run with docker-compose up -d command

Dependencies

GitHub package.json dependency version (subfolder of monorepo) GitHub package.json dependency version (subfolder of monorepo) GitHub package.json dependency version (subfolder of monorepo) GitHub package.json dependency version (subfolder of monorepo) GitHub package.json dependency version (subfolder of monorepo)

Troubleshooting

How token does it look like?

auth-token: rxk38rh5qtyw95fkvm7kgfceh4mh6u


Setting Up Chrome Linux Sandbox

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:

var browserConfig = {
    headless: !showBrowser,
    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


streamers.json is empty?

Try to again with higher delay. Default delay:

const scrollDelay = 2000;

Go to code


Something went wrong?

Try to non-headless mode. Edit headless value to true, like this:

const showBrowser = true;

Go to code


Proxy?

Yes, of course:

const proxy = ""; // "ip:port" By https://github.com/Jan710

Go to code

OR

With Docker env:

proxy=PROXY_IP_ADDRESS:PROXY_PORT

Screenshot without non-headless mode

const browserScreenshot = false;

Go to code

Support

Donations

Buy Me A Coffee

Disclaimer

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.
Reproduction and copy is authorised, provided the source is acknowledged.

About

Automatic watching the twitch to get Valorant drop

License:MIT License


Languages

Language:JavaScript 92.2%Language:Dockerfile 7.8%