Add local zip sets and a source client to broadcast them - #1
Open
Andrey-Raspopov wants to merge 1 commit into
Open
Add local zip sets and a source client to broadcast them#1Andrey-Raspopov wants to merge 1 commit into
Andrey-Raspopov wants to merge 1 commit into
Conversation
A show can now be backed by a zip of mp3s plus an .m3u instead of a spotify playlist. zipset.js opens the archive, picks the m3u nearest the root and uses it for running order and display names, falling back to every mp3 sorted by name when there is none. Playlist lines are matched against archive entries tolerantly, since real m3u files arrive with backslashes, './' prefixes and inconsistent case. Entries are unpacked into zip_work_dir one at a time and asynchronously so a long set does not block the websocket server. server.js gains /loadZip, /getPlaylist and /track (with range support so the browser can seek), and unpacks a set by itself when a show whose playlistLink names a zip goes on air. Requested paths are resolved against zip_root and anything pointing outside it is refused, so the endpoint cannot be used to unpack arbitrary files. The page shows the current track, taken from the stream's ICY title, which a local set announces as "local:<track index>". Nothing here produces audio on its own, so broadcast.js streams a loaded set into icecast as one continuous connection and updates the title as each track comes up. dev/icecast.xml runs an icecast locally to try the whole chain against. Three fixes fell out of getting that working: * the ICY reader had the production host hardcoded and ignored stream_ip, so it read metadata from a different server than the page was playing * it parsed icy-metaint from responses it never checked, so a stream with no source connected left it wedged forever with no retry * connection errors were unhandled, which took the server down when icecast was unreachable Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A show can now be backed by a zip of mp3s plus an .m3u instead of a spotify playlist. zipset.js opens the archive, picks the m3u nearest the root and uses it for running order and display names, falling back to every mp3 sorted by name when there is none. Playlist lines are matched against archive entries tolerantly, since real m3u files arrive with backslashes, './' prefixes and inconsistent case. Entries are unpacked into zip_work_dir one at a time and asynchronously so a long set does not block the websocket server.
server.js gains /loadZip, /getPlaylist and /track (with range support so the browser can seek), and unpacks a set by itself when a show whose playlistLink names a zip goes on air. Requested paths are resolved against zip_root and anything pointing outside it is refused, so the endpoint cannot be used to unpack arbitrary files.
The page shows the current track, taken from the stream's ICY title, which a local set announces as "local:".
Nothing here produces audio on its own, so broadcast.js streams a loaded set into icecast as one continuous connection and updates the title as each track comes up. dev/icecast.xml runs an icecast locally to try the whole chain against.
Three fixes fell out of getting that working: