All Projects → ghaiklor → icecast-parser

ghaiklor / icecast-parser

Licence: MIT license
Node.js module for getting and parsing metadata from SHOUTcast/Icecast radio streams

Programming Languages

typescript
32286 projects
javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to icecast-parser

obplayer
📻 OBPlayer Streaming Automation Playout with CAP EAS Alerting
Stars: ✭ 93 (+40.91%)
Mutual labels:  icecast, shoutcast, radio-station
player-shoutcast-html5
Responsive HMTL5 Web Player for SHOUTCast and Icecast streamings with cover art and lyrics
Stars: ✭ 71 (+7.58%)
Mutual labels:  icecast, shoutcast
Metascraper
Scrape data from websites using Open Graph, HTML metadata & fallbacks.
Stars: ✭ 1,254 (+1800%)
Mutual labels:  metadata, parse
goicy
AAC and MPEG (MP1, MP2, MP3) Icecast/Shoutcast source client written in Go
Stars: ✭ 58 (-12.12%)
Mutual labels:  icecast, shoutcast
jsCast
📻 An Audio Streaming Application written in JavaScript
Stars: ✭ 23 (-65.15%)
Mutual labels:  icecast, radio-station
fridgefm-radio-core
Simple lightweight package for creating your own radio station via NodeJS heavily inspired by Shoutcast and Icecast.
Stars: ✭ 32 (-51.52%)
Mutual labels:  icecast, shoutcast
nowplaying
A lightweight PHP adapter for viewing the current now playing data in Icecast and SHOUTcast 1/2. A part of the AzuraCast software suite.
Stars: ✭ 20 (-69.7%)
Mutual labels:  icecast, shoutcast
icc
JavaScript module to parse International Color Consortium (ICC) profiles
Stars: ✭ 37 (-43.94%)
Mutual labels:  metadata, parse
Forensic Tools
A collection of tools for forensic analysis
Stars: ✭ 204 (+209.09%)
Mutual labels:  metadata, parse
Fulltext
Search across and get full text for OA & closed journals
Stars: ✭ 221 (+234.85%)
Mutual labels:  metadata
opensource
Collection of Open Source packages by Otherwise
Stars: ✭ 21 (-68.18%)
Mutual labels:  parse
Vuvuzela
Private messaging system that hides metadata
Stars: ✭ 2,423 (+3571.21%)
Mutual labels:  metadata
Linqit
Extend python lists with .NET's LINQ syntax for clean and fast coding. Also known as PINQ.
Stars: ✭ 222 (+236.36%)
Mutual labels:  metadata
parse-github-url
Parse a Github URL into an object. Supports a wide variety of GitHub URL formats.
Stars: ✭ 114 (+72.73%)
Mutual labels:  parse
Codemeta
Minimal metadata schemas for science software and code, in JSON-LD
Stars: ✭ 218 (+230.3%)
Mutual labels:  metadata
sqlite-createtable-parser
A parser for sqlite create table sql statements.
Stars: ✭ 67 (+1.52%)
Mutual labels:  parse
Sfpowerkit
A Salesforce DX Plugin with multiple functionalities aimed at improving development and operational workflows
Stars: ✭ 214 (+224.24%)
Mutual labels:  metadata
Frappejs
Node + Electron + Vue based metadata web framework (inspired by Frappe)
Stars: ✭ 214 (+224.24%)
Mutual labels:  metadata
publiccode.yml
A metadata description standard for public software and policy repositories
Stars: ✭ 18 (-72.73%)
Mutual labels:  metadata
awesome-json-next
A Collection of What's Next for Awesome JSON (JavaScript Object Notation) for Structured (Meta) Data in Text - JSON5, HJSON, HanSON, TJSON, SON, CSON, USON, JSONX/JSON11 & Many More
Stars: ✭ 50 (-24.24%)
Mutual labels:  metadata

icecast-parser

Build Status Code Coverage

GitHub followers Twitter Follow

Node.js module for getting and parsing metadata from SHOUTcast/Icecast radio streams.

NOTE: the server that serves radio station stream must support Icy-Metadata header. If that is not the case, this parser cannot parse the metadata from there.

Features

  • Opens async connection to URL and gets response with radio stream and metadata. Then pipes the response to Transform stream for processing;
  • Getting metadata from stream is implemented as Transform stream, so you can pipe it to another Writable\Duplex\Transform;
  • Once it receives metadata, metadata event triggers with metadata object;
  • After metadata is received, connection to radio station closes automatically, so you will not spend a lot of traffic;
  • But you can set keepListen flag in configuration object and continue listening radio station;
  • Auto updating metadata from radio station by interval in economical way (connection is opens when time has come);
  • Metadata parsed as a Map with key-value;
  • When you create a new instance, you get EventEmitter. So you can subscribe to other events;
  • Easy to configure and use;

Getting Started

You can install icecast-parser from npm.

npm install icecast-parser

Get your first metadata from radio station.

import { Parser } from 'icecast-parser';

const radioStation = new Parser({ url: 'https://live.hunter.fm/80s_high' });
radioStation.on('metadata', (metadata) => process.stdout.write(`${metadata.get('StreamTitle') ?? 'unknown'}\n`));

Configuration

You can provide additional parameters to constructor:

  • url - by default empty and REQUIRED. Otherwise, you will get an error.
  • userAgent - by default icecast-parser.
  • keepListen - by default false. If you set to true, then response from radio station will not be destroyed and you can pipe it to another streams. E.g. piping it to the speaker module.
  • autoUpdate - by default true. If you set to false, then parser will not be listening for recent updates and immediately close the stream. So that, you will get a metadata only once.
  • notifyOnChangeOnly - by default false. If you set both autoUpdate and notifyOnChangeOnly to true, it will keep listening the stream and notifying you about metadata, but it will not notify if metadata did not change from the previous time.
  • errorInterval - by default 10 minutes. If an error occurred when requesting, the next try will be executed after this interval. Works only if autoUpdate is enabled.
  • emptyInterval - by default 5 minutes. If the request was fullfiled but the metadata field was empty, the next try will be executed after this interval. Works only if autoUpdate is enabled.
  • metadataInterval - by default 5 seconds. If the request was fullfiled and the metadata was present, the next update will be scheduled after this interval. Works only if autoUpdate is enabled.
import { Parser } from 'icecast-parser';

const radioStation = new Parser({
  autoUpdate: true,
  emptyInterval: 5 * 60,
  errorInterval: 10 * 60,
  keepListen: false,
  metadataInterval: 5,
  notifyOnChangeOnly: false,
  url: 'https://live.hunter.fm/80s_high',
  userAgent: 'Custom User Agent',
});

radioStation.on('metadata', (metadata) => process.stdout.write(`${metadata.get('StreamTitle') ?? 'unknown'}\n`));

Events

You can subscribe to following events: end, error, empty, metadata, stream.

  • end event triggers when connection to radio station was ended;
  • error event triggers when connection to radio station was refused, rejected or timed out;
  • empty event triggers when connection was established successfully, but the radio station doesn't have metadata in there;
  • metadata event triggers when connection was established successfully and metadata is parsed;
  • stream event triggers when response from radio station returned and successfully piped to Transform stream.

License

MIT

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].