# MEGA Radio Listen to **WAKE - Control Plane**, the MEGA Radio album from the MEGA.dev course, at **https://mega-radio--noah.kody.run/**. Only members of the [MEGA.dev Discord](https://discord.gg/megadev) can play it. Used MEGA Radio at the old address (noah.kody.run/mega-radio)? Open it once before December 17, 2026 and choose **Move my data to the new address** to bring your repeat setting along. New to Kody? **[Create a Free Account](https://kody.codes/signup?ref=noah)**, then come back and sign in. ## Intent Share the MEGA Radio tracks with the MEGA.dev community. Access is gated server-side: a visitor must be signed in with Kody **and** verified as a member of the MEGA.dev Discord server (guild `831056664123670539`) before any audio or cover is served. ## How to listen 1. Open https://mega-radio--noah.kody.run/ and choose **Sign in with Kody** (no account? **[Create a Free Account](https://kody.codes/signup?ref=noah)**). 2. Choose **Check with Discord** and approve on Discord. The app asks Discord whether you are in the MEGA.dev server, saves only "member: yes/no" plus your Discord name, and revokes the token. 3. Play a track. Use **Repeat off / Repeat one / Repeat all**: - **Repeat one** plays the same track over and over. - **Repeat all** moves to the next open track at the end and wraps around to the first one after the last. - It is off by default, and your browser remembers what you chose. - Playback keeps going with the screen locked or the tab in the background (iOS Safari, Android Chrome), and the lock screen shows the track with play, pause, previous, next and seek controls. - Each track shows its play count after its length (hover or tap the ▶ number). A play counts once 30 seconds have played or the track ends, each repeat loop included, at most once per track length per listener. Only totals and your own count are stored. A check stays valid for 30 days. After that the page asks you to check again (one click if you already approved the app on Discord). Track 5 opened 16 Nov; tracks 6 and 7 open 18 and 23 Nov 2026. ## Exports - `kody:@noah/mega-radio`: album info, the track list, and the listen and sign-up links (no audio). - `kody:@noah/mega-radio/status`: your access state (whether your last Discord check still counts). Read-only. - `kody:@noah/mega-radio/audio-store`: owner-only upload API used by `npm run upload-radio`. App routes: `/` (the page), `/status` (JSON with your sign-in and membership state plus the sign-in and sign-up links), `/tracks.json` (with play counts for members), `/files/radio/NN.(mp3|png)` (members only), `POST /plays/NN` (members only, JSON) and `/art/NN.png?exp&sig` (signed lock-screen artwork). ## Setup (owner) 1. Discord application: **Mega.dev** (client ID `1565030809998458920`). Under **OAuth2**: - turn on **Public Client** (lets the app use PKCE with no client secret); - add the redirect `https://mega-radio--noah.kody.run/discord/callback` (keep `https://noah.kody.run/mega-radio/discord/callback` until December 17, 2026, while the old address still serves the app). 2. The client ID is set in `src/config.ts` (`DISCORD_CLIENT_ID`). It is public, not a secret. 3. Publish, then run `npm run upload-radio` on the machine that has `~/mega-dev/radio/`. 4. Make the app internet-visible and approve its capability page (`/@noah/mega-radio/approve-capabilities`). 5. New track: set its title, length and `localFile` in `src/tracks.ts`, publish, then run `npm run upload-radio`. It plays once its MP3 is stored and its open date has passed. The source is open: the audio lives only in this package's storage, so a copy of the code cannot serve it. ## Limits - Anyone who passes the check can still save the MP3s their browser plays. The gate decides who can get the audio. It cannot stop a member from sharing it. - Discord membership is re-checked every 30 days, not live. Someone who leaves the server keeps access until their check expires. Previous and next icons: [Font Awesome Free](https://fontawesome.com) 6.7.2 (`backward-step`, `forward-step`), CC BY 4.0, inlined as SVG with the license comment kept.