Gets the m3u8 direct stream URLs of a live stream on twitch.tv.
npm install --save twitch-get-stream
var twitchStreams = require('twitch-get-stream')('<your-client-id>'); // twitch now ENFORCES client id usage, so this is required.
...
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'
}, {...}
]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.
- 0.4.1 to 0.5.0 -
.nodeify()support has been removed in favor of just using the native Promise over the npm package; thus, you cannot use callbacks anymore. If you really need callback support, look into some library that can change it back for you. Thesuperagentlibrary has also been removed, replaced withaxios. This change should not affect external code interfacing the library.
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.
This project is licensed under the terms of the MIT license.