This Cloudflare Worker handles M3U playlist creation and serving. Below are visual workflows for the two main endpoints.
This endpoint accepts a JSON payload with playlist_id and m3u_content, stores it in Cloudflare KV with a 24-hour TTL, and returns the playlist URL.
Flow Description: The client sends a POST request with playlist data. The worker validates the input, sanitizes the ID, stores the content in KV storage with automatic expiration, and returns the access URL.
This endpoint retrieves and serves M3U playlist content from Cloudflare KV storage with proper MIME type headers.
Flow Description: The client requests a specific playlist by ID. The worker sanitizes the ID, fetches the content from KV storage, and serves it as an M3U file if found.