Giter Site home page Giter Site logo

twitch-watcher's Introduction

Twitch watcher

This is a fork that utilizes the HELIX API to determine who to watch

GitHub package.json version GitHub GitHub repo size GitHub issues

Features

  • πŸŽ₯ True HTTP Live Streaming support (Forget the #4000 error code)
  • πŸ” Cookie-based login
  • πŸ“œ Auto accept cookie policy
  • πŸ‘¨β€πŸ’» The choice of a random streamer with drop-enabled tag
  • 🀐 Unmuted stream
  • πŸ›  Detect mature content-based stream and interact with it
  • πŸ›‘ Proxy option
  • πŸ“½ Automatic lowest possible resolution settings
  • 🧰 Highly customizable codebase
  • πŸ“¦ Deployable to VPS by docker
  • 🏳️ Helpful support community
  • πŸ’¬ Multi language readme: πŸ‡«πŸ‡· README πŸ‡§πŸ‡· README πŸ‡·πŸ‡Ί README πŸ‡ΈπŸ‡° README

Grab your Login Token

  1. Login to your twitch account
  2. Open inspector(F12 or Ctrl+Shift+I) on main site
  3. Find the stored cookie section
  4. Copy auth-token -- This is your LoginToken

Getting your API Authorization Token

  1. Login to your twitch account
  2. go to this page I have set up: https://rfbomb.github.io/DockerWatcherAuthPage.io/
  3. Click the 'Authorize' button. This will send a request to the Twitch authorization server, which will provide a unique key, similar to the LoginToken keys above.
  4. Copy ApiToken once is it displayed on the page. This token will be used for the 'ApiAuthToken' variable.

Requirements

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

Installation

  1. Grab your Login & API Auth Tokens
  2. Clone this repo
  3. Install Chromium
  4. Locate Chromium executable:
    • Linux -> whereis chromium or whereis chromium-browser
    • Windows -> Usually the path to the Chromium executable is: C:\Program Files (x86)\Google\Chrome\Application\chrome.exe
  5. Navigate your command prompt / terminal into this the folder you downloaded the repo into
  6. Install the dependencies with npm install
  7. Start the program with npm start

Docker

Docker Image Version (latest by date) Docker Pulls Docker Image Size (latest by date)

Docker is a set of platform as a service (PaaS) products that uses OS-level virtualization to deliver software in packages called containers. Containers are isolated from one another and bundle their own software, libraries and configuration files. All containers are run by a single operating system kernel and therefore use fewer resources than virtual machines.

Requirements

Usage

  1. Download docker-compose-example.yml
  2. Rename docker-compose.yml
  3. Customize Environment Variables
    • LoginToken environment variable
    • ApiAuthToken environment variable
    • streamersUrl environment variable
  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) GitHub package.json dependency version (prod)

Troubleshooting

What do the tokens look like?

auth-token: rxk38rh5qtyw95fkvm7kgfceh4mh6u


Streamers.json is empty?

Try again with higher delay. Default delay:

const scrollDelay = 2000;

Go to code


Something went wrong?

Try non-headless mode. Set 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

Donation

Please donate to keep alive this project!

My Fork that uses the Helix API: Buy Me A Coffee

Original Source: Buy Me A Coffee

Support

Disclaimer

This code is for educational and research purposes only. Do not attempt to violate the law with anything contained here. I will not be responsible for any illegal actions. Reproduction and copy is authorised, provided the source is acknowledged.

twitch-watcher's People

Contributors

alexhaber avatar d3vl0per avatar dependabot[bot] avatar giovanni-orciuolo avatar rfbomb avatar supersandro2000 avatar sylveonbottle avatar tetreum avatar thvozdovic avatar valnesfjord avatar

Stargazers

 avatar  avatar  avatar  avatar

Forkers

gdomod comictypx

twitch-watcher's Issues

[Docker] ChannelName_3 is interpreted as UserTimezone

In the app.js at line 102 you are initializing the var UserTimeZone with the Enviroment Variable ChannelName_3:
UserTimeZone = (process.env.ChannelName_3 || 'America/New_York');

So if the ChannelName_3 Var is used in e.g. the docker-compose.yml, the twitch-watcher will not start: "Error: RangeError: Invalid time zone specified: warframe"

This only affects Docker-Container, because normally the code in Line 119 would be executed:
UserTimeZone = (await UserSettings.ReadConfigSetting('UserTimeZone') || 'America/New_York');

UserTimeZone could then also be mentioned in the docker-compose-example.yml file :)

[Docker] Request to https://api.twitch.tv/helix/streams failed

=========================
πŸ”Ž Checking config file...
βœ… Env config found

=========================
πŸ“± Launching browser...
πŸ”§ Setting User-Agent...
πŸ”§ Setting auth token...
⏰Setting timeouts...
----------- Loaded Variables ------------
ChannelName_1 - nmplol
ChannelName_2 -
ChannelName_3 -
streamersUrl - https://www.twitch.tv/directory/game/iRacing
TimeZone - America/New_York
minWatching - 15
maxWatching - 30
IgnoreRandomChannels - true
----------- End of Loaded Variables ------------
🀬 Error: FetchError: request to https://api.twitch.tv/helix/streams failed, reason: getaddrinfo EAI_AGAIN api.twitch.tv
at ClientRequest. (/usr/src/app/node_modules/node-fetch/lib/index.js:1461:11)
at ClientRequest.emit (events.js:315:20)
at TLSSocket.socketErrorListener (_http_client.js:432:9)
at TLSSocket.emit (events.js:315:20)
at emitErrorNT (internal/streams/destroy.js:84:8)
at processTicksAndRejections (internal/process/task_queues.js:84:21) {
message: 'request to https://api.twitch.tv/helix/streams failed, reason: getaddrinfo EAI_AGAIN api.twitch.tv',
type: 'system',
errno: 'EAI_AGAIN',
code: 'EAI_AGAIN'
}
(node:25) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'error' of undefined
at Object.TestAPIToken (/usr/src/app/HelixAPI.js:98:14)
at processTicksAndRejections (internal/process/task_queues.js:97:5)
at async SetupVariables (/usr/src/app/app.js:156:9)
at async main (/usr/src/app/app.js:644:3)
(node:25) 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:25) [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.

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.