lofi-app/prompt.md
2026-05-09 08:57:54 -05:00

4.1 KiB
Raw Permalink Blame History

Prompt for the next LLM “Implement a LofiRadio App” Objective Build a crossplatform app (web / Android / iOS) that streams the live audio from 20 popular lofi YouTube channels as a continuous “radio” feed no YouTube UI, no download, just the raw audio stream. The app must: 1. Discover the live broadcast for each channel. 2. Retrieve the HLS (m3u8) stream URL from YouTubes API (or via ytdlp). 3. Play the stream using an HLSaware media player. 4. Validate that the stream is working before starting playback. Highlevel logic | Step | What to do | Why it matters | |------|------------|----------------| | A. Gather channel IDs | Keep a list of the 20 channel IDs (see list below). | Needed to query the API for each channel. | | B. Query YouTube Data API | Use liveBroadcasts to get the current broadcast ID for each channel. | The broadcast ID is required to find the stream. | | C. Query LiveStreaming API | Use liveStreams with the broadcast ID to get the CDN ingestion info (streamName, streamKey). | These two pieces build the HLS URL. | | D. Build HLS URL | https://rr1---snak.akamaized.net/live//playlist.m3u8?key=. | This is the actual playlist that a media player consumes. | | E. Validate URL | Make a lightweight HTTP GET to the playlist; ensure it returns 200 and contains .m3u8. | Confirms the channel is live and the URL is correct before launching the player. | | F. Feed to player | Pass the URL to the platforms media player (VLC, ExoPlayer, AVPlayer, or