Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/rzajac/plparser
Playlist parser / detector in pure Go.
https://github.com/rzajac/plparser
Last synced: 3 days ago
JSON representation
Playlist parser / detector in pure Go.
- Host: GitHub
- URL: https://github.com/rzajac/plparser
- Owner: rzajac
- Created: 2013-04-29T11:35:38.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2013-06-13T08:55:01.000Z (over 11 years ago)
- Last Synced: 2023-03-24T23:48:33.430Z (over 1 year ago)
- Language: Go
- Size: 152 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Playlist parser in Go
Playlist parser / detector in pure Go.
# Supported playlist formats
* PLS
* ASX
* ASF
* M3U# Installation
Run
go get github.com/rzajac/plparser
Include in your source:
import "github.com/rzajac/plparser"
# Updating
Run
go get -u github.com/rzajac/plparser
# Benchmarking
go test -bench=".*" github.com/rzajac/plparser
# Usage
// Get playlist from URL with timeout set to 5 seconds
plr, err := plparser.NewPlaylistRespUrl("http://example.com/some_playlist", 5)// or get playlist from file
plr, err := plparser.NewPlaylistRespFile("/path/to/playlist")if err != nil {
// Handle error
}if !(plr.StatusCode >= 200 && plr.StatusCode < 300) {
// Handle HTTP error
}if plr.IsPotentialPlaylist() {
pl := plparser.NewPlaylist(plr)
pl.Parse()// If everything goes well
// pl.Streams will have a list of streams
// see stream.go
} else {
// File or URL is not a playlist
}# TODO
* Write rests for plresp.go
* Simplify tests
* Write more tests
* Add more playlist types# License
Licensed under the MIT license