# twitchrec

> TwitchRec

Latest version **2.7.5** (published 2022-02-09) · ISC license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install twitchrec
pnpm add twitchrec
yarn add twitchrec
bun add twitchrec
```

Provides the command `twitchrec`.

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 2.7.5 |
| Published | 2022-02-09 |
| First published | 2021-12-30 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 11 |
| Unpacked size | 68 KB |
| Known vulnerabilities | 0 (+23 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 2 |
| Author | Stian Wiu |
| Maintainers | stianwiu |
| Keywords | puppeteer, m3u8, m3u8stream, record, cli |

## Links

- npm: https://www.npmjs.com/package/twitchrec
- Repository: https://github.com/StianWiu/TwitchRec
- Homepage: https://github.com/StianWiu/TwitchRec#readme
- Issues: https://github.com/StianWiu/TwitchRec/issues
- npm.io page: https://npm.io/package/twitchrec

## Dependencies (11)

- [axios](https://npm.io/package/axios.md) ^0.25.0
- [ts-node](https://npm.io/package/ts-node.md) ^10.2.1
- [enquirer](https://npm.io/package/enquirer.md) ^2.3.6
- [commander](https://npm.io/package/commander.md) ^9.0.0
- [puppeteer](https://npm.io/package/puppeteer.md) ^13.1.3
- [bug-killer](https://npm.io/package/bug-killer.md) ^4.4.4
- [m3u8stream](https://npm.io/package/m3u8stream.md) ^0.8.4
- [timer-node](https://npm.io/package/timer-node.md) ^5.0.5
- [twitch-m3u8](https://npm.io/package/twitch-m3u8.md) ^1.1.5
- [randomstring](https://npm.io/package/randomstring.md) ^1.2.1
- [asciiart-logo](https://npm.io/package/asciiart-logo.md) ^0.2.6

## Alternatives

- [@salesforce/cli](https://npm.io/package/@salesforce/cli.md) — 389.7K weekly downloads
- [@mintlify/cli](https://npm.io/package/@mintlify/cli.md) — 208.9K weekly downloads
- [@grafana/e2e-selectors](https://npm.io/package/@grafana/e2e-selectors.md) — 128.7K weekly downloads
- [mintlify](https://npm.io/package/mintlify.md) — 112.0K weekly downloads
- [@intlayer/cli](https://npm.io/package/@intlayer/cli.md) — 22.8K weekly downloads

## Recent versions

- 2.7.5 (latest) — 2022-02-09
- 2.7.4 — 2022-02-09
- 2.7.3 — 2022-01-23
- 2.7.2 — 2022-01-18
- 2.7.1 — 2022-01-17
- 2.7.0 — 2022-01-13
- 2.6.1 — 2022-01-12
- 2.6.0 — 2022-01-12
- 2.5.3 — 2022-01-10
- 2.5.2 — 2022-01-10
- 2.5.1 — 2022-01-10
- 2.5.0 — 2022-01-10
- 2.4.5 — 2022-01-07
- 2.4.4 — 2022-01-06
- 2.4.3 — 2022-01-06
- … 11 more at https://npm.io/package/twitchrec/versions

## README

<p align='center'>
    <a href="https://github.com/StianWiu/TwitchRec/actions/workflows/node.js.yml">
        <img alt="Github test" src="https://github.com/StianWiu/TwitchRec/actions/workflows/node.js.yml/badge.svg">
    </a>
    <a href='https://www.npmjs.com/package/twitchrec'>
        <img src='https://img.shields.io/npm/v/twitchrec.svg' alt='Latest npm version'>
        <img alt="GitHub last commit" src="https://img.shields.io/github/last-commit/stianwiu/twitchrec">
        <img alt="GitHub commit activity" src="https://img.shields.io/github/commit-activity/m/stianwiu/twitchrec">
        <img alt="GitHub repo size" src="https://img.shields.io/github/repo-size/stianwiu/twitchrec">
        <img src='https://img.shields.io/npm/dm/twitchrec.svg' alt='Dependents'>
    </a>
</p>

# Install

```bash
$ npm i -g twitchrec
```

You can also install this without the -g but it will not be available globally.

# Options

| **Name**         | **Type**  | **Description**                      | **Input** | **Required** |
| ---------------- | --------- | ------------------------------------ | --------- | ------------ |
| `-h --help`      | `Extra`   | Display information about program.   |           | ☓            |
| `-u --user`      | `setting` | Specify what user to record          | `string ` | ✓            |
| `-r --rerun`     | `setting` | Enable or disable reruns             | `boolean` | ☓            |
| `-c --category`  | `setting` | Chose specific category to record.   | `string ` | ☓            |
| `-m --max`       | `setting` | Control how large file can become    | `number ` | ☓            |
| `-l --loop`      | `setting` | Automatically wait for next stream   | `boolean` | ☓            |
| `-d --directory` | `setting` | Chose what directory to save to      | `string ` | ☓            |
| `-q --quality`   | `setting` | What quality to record. 0 is highest | `num `    | ☓            |
| `-v --vod`       | `tool`    | Record vod using vod ID              | `string ` | ☓            |

# Example commands

```bash
$ twitchrec -u <username>

$ twitchrec -u <username> -r <true/false> -c <category> -m <num> -l <true/false> -d <path> -q <num>

$ twitchrec --user <username> --rerun <true/false> --category <category> --max <num> --loop <true/false> --directory <path> --quality <num>

$ twitchrec -u <username> -v <vodID>

$ twitchrec --user <username> --vod <vodID>
```

# Issues

If you are experiencing issues please open an issue on [GitHub](https://github.com/StianWiu/TwitchRec/issues) and I'll do my best to help you.

# Features

- Record only certain categories
- Record until certain file size has been reached
- Enable/Disable recording rerun streams
- Continue waiting for next stream after stream is done
- Automatically sorts recorded vods into folders based on streamer username
- Choose what quality to record.
- Record vods in max quality

# How it's done

The program works by using [puppeteer](https://github.com/puppeteer/puppeteer) to open a twitch stream checking if it is live and whether it is a rerun and more. Once it has gotten the required information and knows the specified user is live it will grab the twitch stream m3u8stream link. Using this link it will use [m3u8stream](https://www.npmjs.com/package/m3u8stream) to record that URL to a mp4 format.

This was made for windows and ubuntu so it has not been tested in any other operating system. Though it will most likely still work. Please see [Requirements](#requirements) section.

Feel free to take as much as you want from this project and use it on your own.

# Requirements

- For both windows and Linux you need [Node.js](https://nodejs.org/) and [NPM](https://nodejs.org/) installed.

# Build Setup

```bash
# clone repo
$ git clone https://github.com/StianWiu/TwitchRec/

# install dependencies
$ npm i

# start project with node
$ node index.js --user pignuuuu

# To see all options run
$ node index.js --help
```

# Extra

In order to edit the code you will need to go into the [index.ts](https://github.com/Pignuuu/twitch-recorder/blob/main/index.ts) file and add your code there.

Then to compile it into JavaScript

```bash
$ npm run build
```

---
_Source: https://npm.io/package/twitchrec · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
