nicholastay / node-twitch-get-stream

Gets the m3u8 direct stream URLs of a live stream on twitch.tv.
MIT License
48 stars 26 forks source link
api stream twitchtv

node-twitch-get-stream

Gets the m3u8 direct stream URLs of a live stream on twitch.tv.

NOTE: v0.6.0 breaking change - no longer needs client ID, as only one works as discussed in #9.

Usage

npm install --save twitch-get-stream

var twitchStreams = require('twitch-get-stream')
...
twitchStreams.get('channel')
    .then(function(streams) {
        ...
    });

The output will be as an array of objects, example:

[
  {
    quality: 'Source',
    resolution: '1280x720',
    url: 'long_twitch_hls_url_here'
  }, {...}
]

Other uses

twitchStream.raw('channel');
twitchStream.rawParsed('channel');

Similar to above, however .raw is used for getting the raw m3u8 data as a string, and .rawParsed is used to get the raw data, parsed through the m3u8 lib into an object.

Upgrading Notes

Other

If theres anything else you want with this module, do tell me but I just put together this module for another project I was working on. Feel free to issue a pull request if you have any code changes you want to contribute yourself.

License

This project is licensed under the terms of the MIT license.