Giter VIP home page Giter VIP logo

streamtitle's Introduction

StreamTitle

Simple library to retrieve song title from SHOUTcast v1 or v2 and Icecast server.

Build Status Coverage Status

Installation

npm install stream-title --save

Example

SHOUTcast v1

var streamTitle = require('stream-title');

streamTitle({
    url: 'http://shoutcastserver:port',
    type: 'shoutcast'
}).then(function (title) {
    console.log(title);
}).catch(function (err) {
    console.log(err);
});

SHOUTcast v2

var streamTitle = require('stream-title');

streamTitle({
    url: 'http://shoutcastserver:port',
    type: 'shoutcast2',
    sid: 1
}).then(function (title) {
    console.log(title);
}).catch(function (err) {
    console.log(err);
});

Icecast v2.4.x

var streamTitle = require('stream-title');

streamTitle({
    url: 'http://icecastserver:port',
    type: 'icecast',
    mount: 'mymount'
}).then(function (title) {
    console.log(title);
}).catch(function (err) {
    console.log(err);
});

Options

Name Type Description
type string required, server type that can be "shoutcast", "shoutcast2" or "icecast"
url string required, server url
sid integer required for shoutcast2, stream id
mount string required for incecast, mount name
timeout integer request timeout in ms, default: 1500

License

StreamTitle is open-sourced software licensed under the MIT license

Author

Fabio Ricali

streamtitle's People

Contributors

fabioricali avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

streamtitle's Issues

Icy sample

I tried your library - considering this stream - "http://144.217.129.213:8702/stream?icy=http"

It seems I can connect to it but - I see 200 request - but the promise doesn't seem to resolve - I can't read the title

If try to hit http://144.217.129.213:8702 in the address bar I can see all the shoutcast info including the current show title.

how would you go about reading it using your library?

Stream full metadata

Hello,
would it be possible to also get stream artist and album, rather than the title only?

Thanks

Icecast 2 - TypeError: Parameter "url" must be a string, not undefined

Hi there,

This seems to be the only repo that actually works with Shoutcast streams these days, Icecast-Parser doesn't seem to think any stream I give it has metadata. I was having a great deal of fun until I tried it with some icecast streams; that was when I started getting:

TypeError: Parameter "url" must be a string, not undefined
    at Url.parse (url.js:103:11)
    at Object.urlParse [as parse] (url.js:97:13)
    at /Users/KariBarry/strayve/node_modules/stream-title/src/stream-title.js:30:32
    at tryCatcher (/Users/KariBarry/strayve/node_modules/bluebird/js/release/util.js:16:23)
    at Promise._settlePromiseFromHandler (/Users/KariBarry/strayve/node_modules/bluebird/js/release/promise.js:512:31)
    at Promise._settlePromise (/Users/KariBarry/strayve/node_modules/bluebird/js/release/promise.js:569:18)
    at Promise._settlePromise0 (/Users/KariBarry/strayve/node_modules/bluebird/js/release/promise.js:614:10)
    at Promise._settlePromises (/Users/KariBarry/strayve/node_modules/bluebird/js/release/promise.js:693:18)
    at Async._drainQueue (/Users/KariBarry/strayve/node_modules/bluebird/js/release/async.js:133:16)
    at Async._drainQueues (/Users/KariBarry/strayve/node_modules/bluebird/js/release/async.js:143:10)
    at Immediate.Async.drainQueues (/Users/KariBarry/strayve/node_modules/bluebird/js/release/async.js:17:14)
    at runCallback (timers.js:810:20)
    at tryOnImmediate (timers.js:768:5)
    at processImmediate [as _immediateCallback] (timers.js:745:5)

There's something inside the mystical ether of the URL parser here that's making it think it's completely undefined, regardless of what stream I give it or how I give it to it. Any ideas? I'd really like my program to be able to handle both Icecast 2 & Shoutcast 1 /2 streams if possible (since Traktor only outputs an ogg icecast stream)

Thanks!

webhook feature

Any chances of adding a webhook as output, as to use it with discord to monitor a station?

Uncaught ReferenceError: rp is not defined

when I try tp use script in html I get this in Chrome console. It says rp var is not defined showing this line as an error:
' return rp({ '

How to make it work? I was using the code in in static .html for testing
thx in advance!

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.