icymeta

package module
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 21, 2024 License: MPL-2.0 Imports: 7 Imported by: 0

README

icymeta

Release GoDoc Build

Parses metadata from SHOUTcast audio streams.

package main

import (
	"context"
	"fmt"
	"github.com/inspectorgoget/icymeta"
)

func main() {
	streamUrl := "..."
	title, err := icymeta.GetCurrentStreamTitle(context.Background(), streamUrl)

	if err != nil {
		panic(fmt.Sprintf("failed to get current stream title: %v", err))
	}

	fmt.Printf("Current stream title: %s\n", title)
}

Documentation

Overview

Package icymeta parses metadata from SHOUTcast audio streams.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetCurrentStreamTitle

func GetCurrentStreamTitle(ctx context.Context, url string) (string, error)

GetCurrentStreamTitle opens a stream to the specified url, parses the icy metadata and returns the current stream title.

func ParseStreamTitle

func ParseStreamTitle(meta string) (string, error)

ParseStreamTitle extracts the stream title from the icy metadata.

func ReadMeta

func ReadMeta(reader *bufio.Reader) (string, error)

ReadMeta reads the icy metadata from the reader and returns it as string. The bytes following the icy metadata remain untouched in the reader.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL