0.2.1 • Published 5h agoCLI
@inner-dj/client
Licence
MIT
Version
0.2.1
Deps
9
Size
21 kB
Vulns
0
Weekly
0
@inner-dj/client
This is the client (or player) component for inner-dj.
Requirements
- yt-dlp
- ffplay
Deployment
The inner-dj client is available via npm.
npm
npx @inner-dj/client
pnpm
pnpm dlx @inner-dj/client
Configuration
By default, inner-dj client will attempt to load a configuration file at config/config.yaml (relative to the current working directory).
To use a custom config path, set environment variable CONFIG.
Config Root
Note that comma-separated values are accepted for environment variables.
| YAML key | Environment Var | Type | Description | Default |
|---|---|---|---|---|
| clientId | CLIENTID | string | ID of your choice to identify the client to the server as | REQUIRED |
| server | SERVER | string | URL of the inner-dj server | REQUIRED |
| jwtSecret | JWTSECRET | string | Secret for communications between client and server. Only share with server. | REQUIRED |
| cookies | COOKIES | string | Optional path to Netscape-formatted file to read cookies from. See how do I pass cookies to yt-dlp? | null |
| forceDownloadViaServer | FORCESERVERDOWNLOAD | boolean | If true, download missing songs via the server. Otherwise download locally first and fall back to server if something goes wrong | false |
| downloadDir | DOWNLOADDIR | string | Where audio files are stored. | ./downloads/ next to config file |
| maxLength | MAXLENGTH | number | How long in ms to wait during each track before skipping to the next track. Set to 0 to play audio files in their entirety. | 0 |
| standbyPool | STANDBYPOOL | string[] | List of songs (YouTube URLs) to shuffle through if there are no requests in the queue. | [] |
| blocked | BLOCKED | string[] | List of YouTube URLs to reject requests for. | [] |
Supplying Files
You can supply your own higher-quality audio files. Perfect for standby queue items, popular songs, or just if you've got more time than sense.
- Find the YouTube video(s) that correspond with the song and note their ID's
- Place the file in the downloads folder. Rename it to
<video ID>.<track name>.<file extension> - Make sure no other files that match that video ID exist in the downloads folder
This process can also be used to add standby queue items for songs that do not exist on YouTube. Just choose a random 11-character video ID or borrow one from an obscure video of your choice.