twitch-video-url-finder

1.0.5 • Public • Published

Twitch Video Url Finder

Super simple way to get Twitch clips url.

This library uses puppeteer library to render twitch page and find video url.

Import

import twitchUrlFinder from 'twitch-video-url-finder';

Browser location

You need to specify browser executable location, so puppeteer knows what to use.

// Windows
const browserLocation = 'C:/Program Files (x86)/Google/Chrome/Application/chrome.exe';

// MacOS
const browserLocation = '/Applications/Google Chrome.app/Contents/MacOS/Google Chrome';

// Linux
const browserLocation = '/usr/bin/google-chrome-stable';

Please note that your location may be different.

Usage

const browserArgs = ['--no-sandbox']; // Sometimes you may have to specify browser arguments. This option is required to run chromium inside docker.
const findClipFileUrl = twitchUrlFinder(browserLocation, browserArgs);

const clipUrl = 'https://www.twitch.tv/user/clip/id';
findClipFileUrl(clipUrl).then(url => console.log(url));

Example

import twitchUrlFinder from 'twitch-video-url-finder';

const findClipFileUrl = twitchUrlFinder('/usr/bin/google-chrome-stable', ['--no-sandbox']);

const { url } = await findClipFileUrl('https://www.twitch.tv/user/clip/id');

console.log(url);

Readme

Keywords

none

Package Sidebar

Install

npm i twitch-video-url-finder

Weekly Downloads

0

Version

1.0.5

License

MIT

Unpacked Size

3.5 kB

Total Files

4

Last publish

Collaborators

  • arturkuma