nixamp 0.36.2 → 0.36.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/library.d.ts +2 -0
- package/dist/library.js +1 -0
- package/dist/server.d.ts +2 -0
- package/dist/server.js +26 -5
- package/dist/station-guide.d.ts +17 -1
- package/dist/station-guide.js +23 -1
- package/dist/station-metering.d.ts +1 -1
- package/dist/station-metering.js +21 -9
- package/dist/station-routes.d.ts +12 -1
- package/dist/station-routes.js +11 -7
- package/package.json +1 -1
- package/src/library.ts +3 -0
- package/src/server.ts +28 -5
- package/src/station-guide.ts +33 -1
- package/src/station-metering.ts +19 -9
- package/src/station-routes.ts +18 -7
- package/web/dist/assets/{ar-CoV0OSCG.js → ar-B9jc6q-w.js} +1 -1
- package/web/dist/assets/{cs-8b0JgLVt.js → cs-lU25OfSM.js} +1 -1
- package/web/dist/assets/{da-Dxr2Zkug.js → da-CAgdgQoL.js} +1 -1
- package/web/dist/assets/{de-B8-0ZBOG.js → de-CiusGizF.js} +1 -1
- package/web/dist/assets/{es-F09OzIqJ.js → es-DVxl-KYi.js} +1 -1
- package/web/dist/assets/{fi-BVBvuSzZ.js → fi-C1-78Aib.js} +1 -1
- package/web/dist/assets/{fr-B6or6Tqs.js → fr-BcAXoFCf.js} +1 -1
- package/web/dist/assets/{hi-DIj1MriN.js → hi-DXdG5DSQ.js} +1 -1
- package/web/dist/assets/{hls-3VKVEQE3-D7O6p_et.js → hls-3VKVEQE3-C3dxJvEy.js} +1 -1
- package/web/dist/assets/{hu-Cct424Np.js → hu-qrAMY3zu.js} +1 -1
- package/web/dist/assets/{id-D-aXH9se.js → id-Cgtr-WML.js} +1 -1
- package/web/dist/assets/{it-DYFl5GFw.js → it-kuAXXts8.js} +1 -1
- package/web/dist/assets/{main-BboiOHYs.js → main-C5IsPzDk.js} +2 -2
- package/web/dist/assets/{mpegts-DKHwoLCx.js → mpegts-BWzEpcbk.js} +1 -1
- package/web/dist/assets/{mpegts-LO6RVLD6-DffnRZ2P.js → mpegts-LO6RVLD6-CYjdm0vd.js} +1 -1
- package/web/dist/assets/{nl-CvduX6mj.js → nl-CEXpOYtY.js} +1 -1
- package/web/dist/assets/{ru-DSo78zYS.js → ru-v7b_XixQ.js} +1 -1
- package/web/dist/assets/{sv-CHGvTBtl.js → sv-CJK5wtih.js} +1 -1
- package/web/dist/assets/{uk-lDxIHc5N.js → uk-qDSjg5zB.js} +1 -1
- package/web/dist/assets/{vi-E7A-_R2y.js → vi-kckrzXyJ.js} +1 -1
- package/web/dist/assets/{zh-u9GNRWd_.js → zh-Cbq-3ikH.js} +1 -1
- package/web/dist/index.html +1 -1
- package/web/dist/sw.js +22 -22
package/dist/library.d.ts
CHANGED
|
@@ -7,6 +7,8 @@ export interface Config {
|
|
|
7
7
|
autoStations?: Record<string, unknown>;
|
|
8
8
|
/** Hosts (e.g. Moshpit names) whose front page is the public station guide. */
|
|
9
9
|
guideHosts?: string[];
|
|
10
|
+
/** Station limits kept across restarts (station-metering.ts). */
|
|
11
|
+
limits?: Record<string, unknown>;
|
|
10
12
|
}
|
|
11
13
|
export declare function configPath(): string;
|
|
12
14
|
export declare function readConfig(): Config;
|
package/dist/library.js
CHANGED
|
@@ -32,6 +32,7 @@ export function readConfig() {
|
|
|
32
32
|
...(typeof record["library"] === "string" ? { library: record["library"] } : {}),
|
|
33
33
|
...(typeof record["publish"] === "boolean" ? { publish: record["publish"] } : {}),
|
|
34
34
|
...(typeof record["autoStations"] === "object" && record["autoStations"] !== null ? { autoStations: record["autoStations"] } : {}),
|
|
35
|
+
...(typeof record["limits"] === "object" && record["limits"] !== null ? { limits: record["limits"] } : {}),
|
|
35
36
|
...(Array.isArray(record["guideHosts"]) ? { guideHosts: record["guideHosts"].filter((one) => typeof one === "string") } : {}),
|
|
36
37
|
};
|
|
37
38
|
}
|
package/dist/server.d.ts
CHANGED
|
@@ -589,6 +589,8 @@ export interface HandlerOptions {
|
|
|
589
589
|
sync: (input: Record<string, unknown>) => Promise<unknown>;
|
|
590
590
|
setting: () => unknown;
|
|
591
591
|
};
|
|
592
|
+
/** This server's public https address, once it is known. */
|
|
593
|
+
publicBase?: () => string;
|
|
592
594
|
};
|
|
593
595
|
web: string | null;
|
|
594
596
|
/** Branded clients on this same backend, keyed by an explicitly configured host. */
|
package/dist/server.js
CHANGED
|
@@ -54,14 +54,14 @@ import { ArtCache, coverArtOf, stillFrom } from "./art.js";
|
|
|
54
54
|
import { PartyLine, telnyxSms } from "./partyline.js";
|
|
55
55
|
import { HlsPackagers, segmentType, withKey } from "./hls.js";
|
|
56
56
|
import { refusedDestination } from "./destinations.js";
|
|
57
|
-
import { handleStations, isStationListenPath } from "./station-routes.js";
|
|
57
|
+
import { guideEntries, handleStations, isStationListenPath } from "./station-routes.js";
|
|
58
58
|
import { handleLibrary } from "./library-routes.js";
|
|
59
59
|
import { LibraryIndex, probeItem, trackOf } from "./library-index.js";
|
|
60
60
|
import { ListenerStore } from "./library-user.js";
|
|
61
61
|
import { Importer } from "./handoff.js";
|
|
62
62
|
import { handleHandoffs } from "./handoff-routes.js";
|
|
63
63
|
import { STATION_PAGE, STATION_PAGE_CSP, STATION_PAGE_HTML } from "./station-page.js";
|
|
64
|
-
import { GUIDE_CSP,
|
|
64
|
+
import { GUIDE_CSP, guideHosts, renderGuide } from "./station-guide.js";
|
|
65
65
|
import { StationRunner } from "./station-runner.js";
|
|
66
66
|
import { StationError, StationStore, stationOfChannel } from "./stations.js";
|
|
67
67
|
import { STATION_CONTROL_LIMIT, StationUsage, limitsFromEnv } from "./station-metering.js";
|
|
@@ -2204,6 +2204,22 @@ export function createHandler(engine, options) {
|
|
|
2204
2204
|
return { allowed: false, account: "" };
|
|
2205
2205
|
};
|
|
2206
2206
|
if (isGuidePage) {
|
|
2207
|
+
const encrypted = request.socket.encrypted === true;
|
|
2208
|
+
const entries = guideEntries({
|
|
2209
|
+
store: options.stations.store,
|
|
2210
|
+
runner: options.stations.runner,
|
|
2211
|
+
channels: options.channels,
|
|
2212
|
+
canControl: false,
|
|
2213
|
+
account: "",
|
|
2214
|
+
select: () => null,
|
|
2215
|
+
trackFor: (file) => trackFor(engine, file),
|
|
2216
|
+
base: `${encrypted ? "https" : "http"}://${request.headers.host ?? "localhost"}`,
|
|
2217
|
+
publicBase: options.stations.publicBase?.() ?? "",
|
|
2218
|
+
json,
|
|
2219
|
+
readBody,
|
|
2220
|
+
headers: CORS,
|
|
2221
|
+
});
|
|
2222
|
+
const page = renderGuide(entries);
|
|
2207
2223
|
response.writeHead(200, {
|
|
2208
2224
|
"content-type": "text/html; charset=utf-8",
|
|
2209
2225
|
"cache-control": "no-cache",
|
|
@@ -2211,7 +2227,7 @@ export function createHandler(engine, options) {
|
|
|
2211
2227
|
"referrer-policy": "no-referrer",
|
|
2212
2228
|
"x-content-type-options": "nosniff",
|
|
2213
2229
|
});
|
|
2214
|
-
response.end(request.method === "HEAD" ? undefined :
|
|
2230
|
+
response.end(request.method === "HEAD" ? undefined : page);
|
|
2215
2231
|
return;
|
|
2216
2232
|
}
|
|
2217
2233
|
// The page a station's link opens. The same bytes for every station: it
|
|
@@ -2292,6 +2308,7 @@ export function createHandler(engine, options) {
|
|
|
2292
2308
|
},
|
|
2293
2309
|
trackFor: (file) => trackFor(engine, file),
|
|
2294
2310
|
base: `${scheme}://${request.headers.host ?? "localhost"}`,
|
|
2311
|
+
publicBase: options.stations.publicBase?.() ?? "",
|
|
2295
2312
|
json,
|
|
2296
2313
|
readBody,
|
|
2297
2314
|
headers: CORS,
|
|
@@ -6198,7 +6215,7 @@ export async function serve(argv, version = "0.1.0") {
|
|
|
6198
6215
|
const stationStore = new StationStore(StationStore.fileFor(stateDir(), options.port));
|
|
6199
6216
|
// What stations deliver, per month, and the operator's limits on it.
|
|
6200
6217
|
const stationUsage = new StationUsage(StationUsage.fileFor(stateDir(), options.port));
|
|
6201
|
-
const stationLimits = limitsFromEnv();
|
|
6218
|
+
const stationLimits = limitsFromEnv(process.env, readConfig().limits ?? {});
|
|
6202
6219
|
process.once("exit", () => stationUsage.flush());
|
|
6203
6220
|
// Breaks between songs and films: the network's spot, or a house one.
|
|
6204
6221
|
const stationBreaks = new StationBreaks({
|
|
@@ -6289,7 +6306,11 @@ export async function serve(argv, version = "0.1.0") {
|
|
|
6289
6306
|
return { started: true, settings };
|
|
6290
6307
|
},
|
|
6291
6308
|
};
|
|
6292
|
-
const stations = {
|
|
6309
|
+
const stations = {
|
|
6310
|
+
store: stationStore, runner: stationRunner, usage: stationUsage, limits: stationLimits, auto: stationAuto,
|
|
6311
|
+
// Known once the server has worked out its addresses, after it is listening.
|
|
6312
|
+
publicBase: () => (publishable_?.url ?? "").replace(/\/+$/, ""),
|
|
6313
|
+
};
|
|
6293
6314
|
// Music handed over from BitTorrented, copied into a folder of our own.
|
|
6294
6315
|
const importer = new Importer(join(stateDir(), `handoffs-${options.port}.json`), {
|
|
6295
6316
|
index: libraryIndex,
|
package/dist/station-guide.d.ts
CHANGED
|
@@ -1,4 +1,20 @@
|
|
|
1
|
-
export
|
|
1
|
+
export interface GuideEntry {
|
|
2
|
+
name: string;
|
|
3
|
+
kind: "audio" | "video";
|
|
4
|
+
state: string;
|
|
5
|
+
page: string;
|
|
6
|
+
nowPlaying: {
|
|
7
|
+
title: string;
|
|
8
|
+
artist: string;
|
|
9
|
+
} | null;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* The guide with its stations already in it, so it reads the same through a
|
|
13
|
+
* gateway that cannot run its script against this server (the Moshpit's
|
|
14
|
+
* /n/<name>), and for a crawler. Everything from a station is escaped.
|
|
15
|
+
*/
|
|
16
|
+
export declare function renderGuide(entries: GuideEntry[]): string;
|
|
17
|
+
export declare const GUIDE_HTML = "<!doctype html>\n<html lang=\"en\">\n<head>\n<meta charset=\"utf-8\">\n<meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">\n<title>Live \u00B7 stations</title>\n<meta name=\"description\" content=\"Radio and TV stations, live now.\">\n<link rel=\"icon\" href=\"data:,\">\n<style>\n:root{--bg:#f6f5f2;--fg:#17171a;--muted:#5d5d66;--card:#fff;--line:#dedcd6;--accent:#1f6feb;--live:#0b7a3b}\n@media (prefers-color-scheme:dark){:root{--bg:#121214;--fg:#ececf1;--muted:#a4a4b0;--card:#1c1c20;--line:#2c2c33;--accent:#6aa7ff;--live:#3fbf7f}}\n*{box-sizing:border-box}html,body{margin:0;background:var(--bg);color:var(--fg);font:16px/1.5 system-ui,-apple-system,\"Segoe UI\",sans-serif}\nmain{max-width:880px;margin:0 auto;padding:40px 16px}\nh1{margin:0 0 4px;font-size:1.8rem}p.lead{color:var(--muted);margin:0 0 24px}\nh2{font-size:1rem;letter-spacing:.06em;text-transform:uppercase;color:var(--muted);margin:28px 0 10px}\n.grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(240px,1fr));gap:12px}\na.station{display:block;background:var(--card);border:1px solid var(--line);border-radius:14px;padding:16px;color:inherit;text-decoration:none}\na.station:hover,a.station:focus-visible{border-color:var(--accent);outline:none}\n.name{font-weight:700;font-size:1.05rem}.now{color:var(--muted);font-size:.9rem;margin-top:6px;min-height:1.4em}\n.live{color:var(--live);font-size:.8rem;font-weight:700}.empty{color:var(--muted)}\nfooter{margin-top:40px;color:var(--muted);font-size:.85rem}footer a{color:inherit}\n</style>\n</head>\n<body>\n<main>\n <h1>Live</h1>\n <p class=\"lead\">Radio and TV, on the air now. Pick one and press play.</p>\n <h2 id=\"radio-title\" hidden>Radio</h2>\n <div id=\"radio\" class=\"grid\" aria-live=\"polite\"></div>\n <h2 id=\"tv-title\" hidden>TV</h2>\n <div id=\"tv\" class=\"grid\" aria-live=\"polite\"></div>\n <p id=\"empty\" class=\"empty\">Nothing is on the air here yet.</p>\n <footer>Played by <a href=\"https://nixamp.com\">nixamp</a>, on the Moshpit.</footer>\n</main>\n<script>\n(async () => {\n const el = (tag, cls, text) => { const n = document.createElement(tag); if (cls) n.className = cls; if (text) n.textContent = text; return n; };\n const draw = (stations) => {\n for (const [kind, box] of [[\"audio\", \"#radio\"], [\"video\", \"#tv\"]]) {\n const grid = document.querySelector(box);\n grid.replaceChildren();\n const list = stations.filter((s) => s.kind === kind);\n document.querySelector(box + \"-title\").hidden = list.length === 0;\n for (const s of list) {\n const a = el(\"a\", \"station\");\n a.href = s.page;\n a.append(el(\"div\", \"live\", s.state === \"live\" ? \"\u25CF LIVE\" : \"off the air\"), el(\"div\", \"name\", s.name),\n el(\"div\", \"now\", s.nowPlaying ? [s.nowPlaying.title, s.nowPlaying.artist].filter(Boolean).join(\" \u2014 \") : \"\"));\n grid.append(a);\n }\n }\n document.querySelector(\"#empty\").hidden = stations.length > 0;\n };\n const load = async () => {\n try {\n const r = await fetch(\"/api/v1/stations/guide\", { cache: \"no-store\" });\n if (r.ok && (r.headers.get(\"content-type\") || \"\").includes(\"json\")) draw((await r.json()).stations);\n } catch {}\n };\n await load();\n setInterval(load, 15000);\n})();\n</script>\n</body>\n</html>\n";
|
|
2
18
|
export declare const GUIDE_CSP: string;
|
|
3
19
|
/**
|
|
4
20
|
* The hosts whose front page is the guide: `guideHosts` in config.json
|
package/dist/station-guide.js
CHANGED
|
@@ -44,7 +44,7 @@ const SCRIPT = `
|
|
|
44
44
|
const load = async () => {
|
|
45
45
|
try {
|
|
46
46
|
const r = await fetch("/api/v1/stations/guide", { cache: "no-store" });
|
|
47
|
-
if (r.ok) draw((await r.json()).stations);
|
|
47
|
+
if (r.ok && (r.headers.get("content-type") || "").includes("json")) draw((await r.json()).stations);
|
|
48
48
|
} catch {}
|
|
49
49
|
};
|
|
50
50
|
await load();
|
|
@@ -52,6 +52,28 @@ const SCRIPT = `
|
|
|
52
52
|
})();
|
|
53
53
|
`;
|
|
54
54
|
const hash = (text) => `'sha256-${createHash("sha256").update(text).digest("base64")}'`;
|
|
55
|
+
function escape(text) {
|
|
56
|
+
return text.replace(/[&<>"']/g, (one) => ({ "&": "&", "<": "<", ">": ">", '"': """, "'": "'" })[one]);
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* The guide with its stations already in it, so it reads the same through a
|
|
60
|
+
* gateway that cannot run its script against this server (the Moshpit's
|
|
61
|
+
* /n/<name>), and for a crawler. Everything from a station is escaped.
|
|
62
|
+
*/
|
|
63
|
+
export function renderGuide(entries) {
|
|
64
|
+
const cards = (kind) => entries
|
|
65
|
+
.filter((one) => one.kind === kind && /^https?:\/\//.test(one.page))
|
|
66
|
+
.map((one) => `<a class="station" href="${escape(one.page)}"><div class="live">${one.state === "live" ? "● LIVE" : "off the air"}</div><div class="name">${escape(one.name)}</div><div class="now">${one.nowPlaying ? escape([one.nowPlaying.title, one.nowPlaying.artist].filter(Boolean).join(" — ")) : ""}</div></a>`)
|
|
67
|
+
.join("");
|
|
68
|
+
const radio = cards("audio");
|
|
69
|
+
const tv = cards("video");
|
|
70
|
+
return GUIDE_HTML
|
|
71
|
+
.replace('<h2 id="radio-title" hidden>', radio ? '<h2 id="radio-title">' : '<h2 id="radio-title" hidden>')
|
|
72
|
+
.replace('<div id="radio" class="grid" aria-live="polite"></div>', `<div id="radio" class="grid" aria-live="polite">${radio}</div>`)
|
|
73
|
+
.replace('<h2 id="tv-title" hidden>', tv ? '<h2 id="tv-title">' : '<h2 id="tv-title" hidden>')
|
|
74
|
+
.replace('<div id="tv" class="grid" aria-live="polite"></div>', `<div id="tv" class="grid" aria-live="polite">${tv}</div>`)
|
|
75
|
+
.replace('<p id="empty" class="empty">', entries.length ? '<p id="empty" class="empty" hidden>' : '<p id="empty" class="empty">');
|
|
76
|
+
}
|
|
55
77
|
export const GUIDE_HTML = `<!doctype html>
|
|
56
78
|
<html lang="en">
|
|
57
79
|
<head>
|
|
@@ -5,7 +5,7 @@ export interface Limits {
|
|
|
5
5
|
/** Bytes per station per month; 0 is no allowance. */
|
|
6
6
|
monthlyBytes: number;
|
|
7
7
|
}
|
|
8
|
-
export declare function limitsFromEnv(env?: Record<string, string | undefined
|
|
8
|
+
export declare function limitsFromEnv(env?: Record<string, string | undefined>, saved?: Partial<Record<keyof Limits | "monthlyGb", unknown>>): Limits;
|
|
9
9
|
/** Station control: start, stop, edit, publish. Thirty a minute is a person. */
|
|
10
10
|
export declare const STATION_CONTROL_LIMIT: {
|
|
11
11
|
allowed: number;
|
package/dist/station-metering.js
CHANGED
|
@@ -12,7 +12,12 @@
|
|
|
12
12
|
*
|
|
13
13
|
* NIXAMP_STATION_MAX_LISTENERS per station (default 200)
|
|
14
14
|
* NIXAMP_MAX_LISTENERS across every station (default 500)
|
|
15
|
-
* NIXAMP_MAX_RUNNING_STATIONS stations on the air at once (default
|
|
15
|
+
* NIXAMP_MAX_RUNNING_STATIONS stations on the air at once (default 20)
|
|
16
|
+
*
|
|
17
|
+
* The same names, lower-cased without the prefix, can be kept in config.json
|
|
18
|
+
* under "limits" (e.g. {"limits": {"runningStations": 30}}); the environment
|
|
19
|
+
* wins when both are set. A daemon is restarted by every update, and an
|
|
20
|
+
* environment variable typed at a terminal does not survive that.
|
|
16
21
|
* NIXAMP_STATION_MONTHLY_GB delivered per station per month (default 0: no allowance)
|
|
17
22
|
*
|
|
18
23
|
* When an allowance runs out the policy is "pause": nobody new is admitted
|
|
@@ -23,16 +28,23 @@
|
|
|
23
28
|
*/
|
|
24
29
|
import { mkdirSync, readFileSync, renameSync, writeFileSync } from "node:fs";
|
|
25
30
|
import { dirname, join } from "node:path";
|
|
26
|
-
export function limitsFromEnv(env = process.env) {
|
|
27
|
-
const whole = (name, fallback) => {
|
|
28
|
-
const
|
|
29
|
-
|
|
31
|
+
export function limitsFromEnv(env = process.env, saved = {}) {
|
|
32
|
+
const whole = (name, key, fallback) => {
|
|
33
|
+
for (const raw of [env[name], saved[key]]) {
|
|
34
|
+
if (raw === undefined || raw === "")
|
|
35
|
+
continue;
|
|
36
|
+
const value = Number(raw);
|
|
37
|
+
if (Number.isFinite(value) && value >= 0)
|
|
38
|
+
return Math.floor(value);
|
|
39
|
+
}
|
|
40
|
+
return fallback;
|
|
30
41
|
};
|
|
42
|
+
const gb = env["NIXAMP_STATION_MONTHLY_GB"] ?? saved.monthlyGb;
|
|
31
43
|
return {
|
|
32
|
-
stationListeners: whole("NIXAMP_STATION_MAX_LISTENERS", 200),
|
|
33
|
-
totalListeners: whole("NIXAMP_MAX_LISTENERS", 500),
|
|
34
|
-
runningStations: whole("NIXAMP_MAX_RUNNING_STATIONS",
|
|
35
|
-
monthlyBytes: Math.round(Number(
|
|
44
|
+
stationListeners: whole("NIXAMP_STATION_MAX_LISTENERS", "stationListeners", 200),
|
|
45
|
+
totalListeners: whole("NIXAMP_MAX_LISTENERS", "totalListeners", 500),
|
|
46
|
+
runningStations: whole("NIXAMP_MAX_RUNNING_STATIONS", "runningStations", 20),
|
|
47
|
+
monthlyBytes: Math.round(Number(gb ?? 0) * 1024 ** 3) || 0,
|
|
36
48
|
};
|
|
37
49
|
}
|
|
38
50
|
/** Station control: start, stop, edit, publish. Thirty a minute is a person. */
|
package/dist/station-routes.d.ts
CHANGED
|
@@ -40,6 +40,12 @@ export interface StationContext {
|
|
|
40
40
|
} | null;
|
|
41
41
|
/** This server's address as the asker reached it, for links. */
|
|
42
42
|
base: string;
|
|
43
|
+
/**
|
|
44
|
+
* This server's public https address, for links that leave this request's
|
|
45
|
+
* host: the guide is often shown under another name (a Moshpit name through
|
|
46
|
+
* a gateway), and a station is listened to here, not there.
|
|
47
|
+
*/
|
|
48
|
+
publicBase?: string;
|
|
43
49
|
json: (response: ServerResponse, status: number, body: unknown) => void;
|
|
44
50
|
readBody: (request: IncomingMessage) => Promise<string>;
|
|
45
51
|
/** Headers every answer carries (CORS). */
|
|
@@ -57,13 +63,18 @@ export interface StationContext {
|
|
|
57
63
|
setting: () => unknown;
|
|
58
64
|
};
|
|
59
65
|
}
|
|
60
|
-
declare function links(ctx: StationContext, station: Station): {
|
|
66
|
+
declare function links(ctx: StationContext, station: Station, base?: string): {
|
|
61
67
|
page: string;
|
|
62
68
|
stream: string;
|
|
63
69
|
m3u: string;
|
|
64
70
|
state: string;
|
|
65
71
|
};
|
|
66
72
|
export declare function publicView(ctx: StationContext, station: Station): PublicStation;
|
|
73
|
+
/** What the public guide shows: public, listed stations, linked at this server's public address. */
|
|
74
|
+
export declare function guideEntries(ctx: StationContext): Array<PublicStation & {
|
|
75
|
+
page: string;
|
|
76
|
+
m3u: string;
|
|
77
|
+
}>;
|
|
67
78
|
export declare function ownerView(ctx: StationContext, station: Station): OwnerStation & {
|
|
68
79
|
links: ReturnType<typeof links>;
|
|
69
80
|
nowPlaying: string;
|
package/dist/station-routes.js
CHANGED
|
@@ -13,11 +13,11 @@ function fail(ctx, response, error) {
|
|
|
13
13
|
}
|
|
14
14
|
ctx.json(response, 500, { error: error instanceof Error ? error.message : String(error), code: "internal" });
|
|
15
15
|
}
|
|
16
|
-
function links(ctx, station) {
|
|
16
|
+
function links(ctx, station, base = ctx.base) {
|
|
17
17
|
const query = `t=${encodeURIComponent(station.listenToken)}`;
|
|
18
|
-
const at = `${
|
|
18
|
+
const at = `${base}/api/v1/stations/${station.id}`;
|
|
19
19
|
return {
|
|
20
|
-
page: `${
|
|
20
|
+
page: `${base}/station/${station.id}?${query}`,
|
|
21
21
|
stream: `${at}/stream?${query}`,
|
|
22
22
|
m3u: `${at}/listen.m3u?${query}`,
|
|
23
23
|
state: `${at}/state?${query}`,
|
|
@@ -50,6 +50,13 @@ export function publicView(ctx, station) {
|
|
|
50
50
|
listeners: ctx.runner.listeners(station.id),
|
|
51
51
|
};
|
|
52
52
|
}
|
|
53
|
+
/** What the public guide shows: public, listed stations, linked at this server's public address. */
|
|
54
|
+
export function guideEntries(ctx) {
|
|
55
|
+
const base = ctx.publicBase || ctx.base;
|
|
56
|
+
return ctx.store.list()
|
|
57
|
+
.filter((one) => one.visibility === "public" && one.listed)
|
|
58
|
+
.map((one) => ({ ...publicView(ctx, one), page: links(ctx, one, base).page, m3u: links(ctx, one, base).m3u }));
|
|
59
|
+
}
|
|
53
60
|
export function ownerView(ctx, station) {
|
|
54
61
|
const { failures, idempotencyKey: _key, ...rest } = station;
|
|
55
62
|
return {
|
|
@@ -74,10 +81,7 @@ export async function handleStations(request, response, path, url, ctx) {
|
|
|
74
81
|
// The public guide: only stations their owner made public and listed, with
|
|
75
82
|
// their links, because public is what that means. Nothing else, ever.
|
|
76
83
|
if (path === "/api/v1/stations/guide" && (method === "GET" || method === "HEAD")) {
|
|
77
|
-
|
|
78
|
-
ctx.json(response, 200, {
|
|
79
|
-
stations: listed.map((one) => ({ ...publicView(ctx, one), page: links(ctx, one).page, m3u: links(ctx, one).m3u })),
|
|
80
|
-
});
|
|
84
|
+
ctx.json(response, 200, { stations: guideEntries(ctx) });
|
|
81
85
|
return true;
|
|
82
86
|
}
|
|
83
87
|
const listen = LISTEN.exec(path);
|
package/package.json
CHANGED
package/src/library.ts
CHANGED
|
@@ -29,6 +29,8 @@ export interface Config {
|
|
|
29
29
|
autoStations?: Record<string, unknown>;
|
|
30
30
|
/** Hosts (e.g. Moshpit names) whose front page is the public station guide. */
|
|
31
31
|
guideHosts?: string[];
|
|
32
|
+
/** Station limits kept across restarts (station-metering.ts). */
|
|
33
|
+
limits?: Record<string, unknown>;
|
|
32
34
|
}
|
|
33
35
|
|
|
34
36
|
export function configPath(): string {
|
|
@@ -44,6 +46,7 @@ export function readConfig(): Config {
|
|
|
44
46
|
...(typeof record["library"] === "string" ? { library: record["library"] } : {}),
|
|
45
47
|
...(typeof record["publish"] === "boolean" ? { publish: record["publish"] } : {}),
|
|
46
48
|
...(typeof record["autoStations"] === "object" && record["autoStations"] !== null ? { autoStations: record["autoStations"] as Record<string, unknown> } : {}),
|
|
49
|
+
...(typeof record["limits"] === "object" && record["limits"] !== null ? { limits: record["limits"] as Record<string, unknown> } : {}),
|
|
47
50
|
...(Array.isArray(record["guideHosts"]) ? { guideHosts: (record["guideHosts"] as unknown[]).filter((one): one is string => typeof one === "string") } : {}),
|
|
48
51
|
};
|
|
49
52
|
} catch {
|
package/src/server.ts
CHANGED
|
@@ -71,14 +71,14 @@ import { ArtCache, coverArtOf, stillFrom } from "./art.ts";
|
|
|
71
71
|
import { PartyLine, telnyxSms } from "./partyline.ts";
|
|
72
72
|
import { HlsPackagers, segmentType, withKey } from "./hls.ts";
|
|
73
73
|
import { refusedDestination } from "./destinations.ts";
|
|
74
|
-
import { handleStations, isStationListenPath } from "./station-routes.ts";
|
|
74
|
+
import { guideEntries, handleStations, isStationListenPath } from "./station-routes.ts";
|
|
75
75
|
import { handleLibrary } from "./library-routes.ts";
|
|
76
76
|
import { LibraryIndex, probeItem, trackOf, type Probed } from "./library-index.ts";
|
|
77
77
|
import { ListenerStore } from "./library-user.ts";
|
|
78
78
|
import { Importer } from "./handoff.ts";
|
|
79
79
|
import { handleHandoffs } from "./handoff-routes.ts";
|
|
80
80
|
import { STATION_PAGE, STATION_PAGE_CSP, STATION_PAGE_HTML } from "./station-page.ts";
|
|
81
|
-
import { GUIDE_CSP,
|
|
81
|
+
import { GUIDE_CSP, guideHosts, renderGuide } from "./station-guide.ts";
|
|
82
82
|
import { StationRunner } from "./station-runner.ts";
|
|
83
83
|
import { StationError, StationStore, channelOf, stationOfChannel, type Station } from "./stations.ts";
|
|
84
84
|
import { STATION_CONTROL_LIMIT, StationUsage, limitsFromEnv, type Limits } from "./station-metering.ts";
|
|
@@ -1726,6 +1726,8 @@ export interface HandlerOptions {
|
|
|
1726
1726
|
usage?: StationUsage;
|
|
1727
1727
|
limits?: Limits;
|
|
1728
1728
|
auto?: { sync: (input: Record<string, unknown>) => Promise<unknown>; setting: () => unknown };
|
|
1729
|
+
/** This server's public https address, once it is known. */
|
|
1730
|
+
publicBase?: () => string;
|
|
1729
1731
|
};
|
|
1730
1732
|
web: string | null;
|
|
1731
1733
|
/** Branded clients on this same backend, keyed by an explicitly configured host. */
|
|
@@ -2720,6 +2722,22 @@ export function createHandler(engine: Engine, options: HandlerOptions) {
|
|
|
2720
2722
|
};
|
|
2721
2723
|
|
|
2722
2724
|
if (isGuidePage) {
|
|
2725
|
+
const encrypted = (request.socket as { encrypted?: boolean }).encrypted === true;
|
|
2726
|
+
const entries = guideEntries({
|
|
2727
|
+
store: options.stations!.store,
|
|
2728
|
+
runner: options.stations!.runner,
|
|
2729
|
+
channels: options.channels!,
|
|
2730
|
+
canControl: false,
|
|
2731
|
+
account: "",
|
|
2732
|
+
select: () => null,
|
|
2733
|
+
trackFor: (file) => trackFor(engine, file),
|
|
2734
|
+
base: `${encrypted ? "https" : "http"}://${request.headers.host ?? "localhost"}`,
|
|
2735
|
+
publicBase: options.stations!.publicBase?.() ?? "",
|
|
2736
|
+
json,
|
|
2737
|
+
readBody,
|
|
2738
|
+
headers: CORS,
|
|
2739
|
+
});
|
|
2740
|
+
const page = renderGuide(entries);
|
|
2723
2741
|
response.writeHead(200, {
|
|
2724
2742
|
"content-type": "text/html; charset=utf-8",
|
|
2725
2743
|
"cache-control": "no-cache",
|
|
@@ -2727,7 +2745,7 @@ export function createHandler(engine: Engine, options: HandlerOptions) {
|
|
|
2727
2745
|
"referrer-policy": "no-referrer",
|
|
2728
2746
|
"x-content-type-options": "nosniff",
|
|
2729
2747
|
});
|
|
2730
|
-
response.end(request.method === "HEAD" ? undefined :
|
|
2748
|
+
response.end(request.method === "HEAD" ? undefined : page);
|
|
2731
2749
|
return;
|
|
2732
2750
|
}
|
|
2733
2751
|
|
|
@@ -2810,6 +2828,7 @@ export function createHandler(engine: Engine, options: HandlerOptions) {
|
|
|
2810
2828
|
},
|
|
2811
2829
|
trackFor: (file) => trackFor(engine, file),
|
|
2812
2830
|
base: `${scheme}://${request.headers.host ?? "localhost"}`,
|
|
2831
|
+
publicBase: options.stations.publicBase?.() ?? "",
|
|
2813
2832
|
json,
|
|
2814
2833
|
readBody,
|
|
2815
2834
|
headers: CORS,
|
|
@@ -6689,7 +6708,7 @@ export async function serve(argv: string[], version = "0.1.0"): Promise<void> {
|
|
|
6689
6708
|
const stationStore = new StationStore(StationStore.fileFor(stateDir(), options.port));
|
|
6690
6709
|
// What stations deliver, per month, and the operator's limits on it.
|
|
6691
6710
|
const stationUsage = new StationUsage(StationUsage.fileFor(stateDir(), options.port));
|
|
6692
|
-
const stationLimits = limitsFromEnv();
|
|
6711
|
+
const stationLimits = limitsFromEnv(process.env, readConfig().limits ?? {});
|
|
6693
6712
|
process.once("exit", () => stationUsage.flush());
|
|
6694
6713
|
// Breaks between songs and films: the network's spot, or a house one.
|
|
6695
6714
|
const stationBreaks = new StationBreaks({
|
|
@@ -6777,7 +6796,11 @@ export async function serve(argv: string[], version = "0.1.0"): Promise<void> {
|
|
|
6777
6796
|
return { started: true, settings };
|
|
6778
6797
|
},
|
|
6779
6798
|
};
|
|
6780
|
-
const stations = {
|
|
6799
|
+
const stations = {
|
|
6800
|
+
store: stationStore, runner: stationRunner, usage: stationUsage, limits: stationLimits, auto: stationAuto,
|
|
6801
|
+
// Known once the server has worked out its addresses, after it is listening.
|
|
6802
|
+
publicBase: () => (publishable_?.url ?? "").replace(/\/+$/, ""),
|
|
6803
|
+
};
|
|
6781
6804
|
// Music handed over from BitTorrented, copied into a folder of our own.
|
|
6782
6805
|
const importer = new Importer(join(stateDir(), `handoffs-${options.port}.json`), {
|
|
6783
6806
|
index: libraryIndex,
|
package/src/station-guide.ts
CHANGED
|
@@ -46,7 +46,7 @@ const SCRIPT = `
|
|
|
46
46
|
const load = async () => {
|
|
47
47
|
try {
|
|
48
48
|
const r = await fetch("/api/v1/stations/guide", { cache: "no-store" });
|
|
49
|
-
if (r.ok) draw((await r.json()).stations);
|
|
49
|
+
if (r.ok && (r.headers.get("content-type") || "").includes("json")) draw((await r.json()).stations);
|
|
50
50
|
} catch {}
|
|
51
51
|
};
|
|
52
52
|
await load();
|
|
@@ -56,6 +56,38 @@ const SCRIPT = `
|
|
|
56
56
|
|
|
57
57
|
const hash = (text: string): string => `'sha256-${createHash("sha256").update(text).digest("base64")}'`;
|
|
58
58
|
|
|
59
|
+
function escape(text: string): string {
|
|
60
|
+
return text.replace(/[&<>"']/g, (one) => ({ "&": "&", "<": "<", ">": ">", '"': """, "'": "'" })[one]!);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
export interface GuideEntry {
|
|
64
|
+
name: string;
|
|
65
|
+
kind: "audio" | "video";
|
|
66
|
+
state: string;
|
|
67
|
+
page: string;
|
|
68
|
+
nowPlaying: { title: string; artist: string } | null;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* The guide with its stations already in it, so it reads the same through a
|
|
73
|
+
* gateway that cannot run its script against this server (the Moshpit's
|
|
74
|
+
* /n/<name>), and for a crawler. Everything from a station is escaped.
|
|
75
|
+
*/
|
|
76
|
+
export function renderGuide(entries: GuideEntry[]): string {
|
|
77
|
+
const cards = (kind: "audio" | "video"): string => entries
|
|
78
|
+
.filter((one) => one.kind === kind && /^https?:\/\//.test(one.page))
|
|
79
|
+
.map((one) => `<a class="station" href="${escape(one.page)}"><div class="live">${one.state === "live" ? "● LIVE" : "off the air"}</div><div class="name">${escape(one.name)}</div><div class="now">${one.nowPlaying ? escape([one.nowPlaying.title, one.nowPlaying.artist].filter(Boolean).join(" — ")) : ""}</div></a>`)
|
|
80
|
+
.join("");
|
|
81
|
+
const radio = cards("audio");
|
|
82
|
+
const tv = cards("video");
|
|
83
|
+
return GUIDE_HTML
|
|
84
|
+
.replace('<h2 id="radio-title" hidden>', radio ? '<h2 id="radio-title">' : '<h2 id="radio-title" hidden>')
|
|
85
|
+
.replace('<div id="radio" class="grid" aria-live="polite"></div>', `<div id="radio" class="grid" aria-live="polite">${radio}</div>`)
|
|
86
|
+
.replace('<h2 id="tv-title" hidden>', tv ? '<h2 id="tv-title">' : '<h2 id="tv-title" hidden>')
|
|
87
|
+
.replace('<div id="tv" class="grid" aria-live="polite"></div>', `<div id="tv" class="grid" aria-live="polite">${tv}</div>`)
|
|
88
|
+
.replace('<p id="empty" class="empty">', entries.length ? '<p id="empty" class="empty" hidden>' : '<p id="empty" class="empty">');
|
|
89
|
+
}
|
|
90
|
+
|
|
59
91
|
export const GUIDE_HTML = `<!doctype html>
|
|
60
92
|
<html lang="en">
|
|
61
93
|
<head>
|
package/src/station-metering.ts
CHANGED
|
@@ -12,7 +12,12 @@
|
|
|
12
12
|
*
|
|
13
13
|
* NIXAMP_STATION_MAX_LISTENERS per station (default 200)
|
|
14
14
|
* NIXAMP_MAX_LISTENERS across every station (default 500)
|
|
15
|
-
* NIXAMP_MAX_RUNNING_STATIONS stations on the air at once (default
|
|
15
|
+
* NIXAMP_MAX_RUNNING_STATIONS stations on the air at once (default 20)
|
|
16
|
+
*
|
|
17
|
+
* The same names, lower-cased without the prefix, can be kept in config.json
|
|
18
|
+
* under "limits" (e.g. {"limits": {"runningStations": 30}}); the environment
|
|
19
|
+
* wins when both are set. A daemon is restarted by every update, and an
|
|
20
|
+
* environment variable typed at a terminal does not survive that.
|
|
16
21
|
* NIXAMP_STATION_MONTHLY_GB delivered per station per month (default 0: no allowance)
|
|
17
22
|
*
|
|
18
23
|
* When an allowance runs out the policy is "pause": nobody new is admitted
|
|
@@ -32,16 +37,21 @@ export interface Limits {
|
|
|
32
37
|
monthlyBytes: number;
|
|
33
38
|
}
|
|
34
39
|
|
|
35
|
-
export function limitsFromEnv(env: Record<string, string | undefined> = process.env): Limits {
|
|
36
|
-
const whole = (name: string, fallback: number): number => {
|
|
37
|
-
const
|
|
38
|
-
|
|
40
|
+
export function limitsFromEnv(env: Record<string, string | undefined> = process.env, saved: Partial<Record<keyof Limits | "monthlyGb", unknown>> = {}): Limits {
|
|
41
|
+
const whole = (name: string, key: keyof typeof saved, fallback: number): number => {
|
|
42
|
+
for (const raw of [env[name], saved[key]]) {
|
|
43
|
+
if (raw === undefined || raw === "") continue;
|
|
44
|
+
const value = Number(raw);
|
|
45
|
+
if (Number.isFinite(value) && value >= 0) return Math.floor(value);
|
|
46
|
+
}
|
|
47
|
+
return fallback;
|
|
39
48
|
};
|
|
49
|
+
const gb = env["NIXAMP_STATION_MONTHLY_GB"] ?? saved.monthlyGb;
|
|
40
50
|
return {
|
|
41
|
-
stationListeners: whole("NIXAMP_STATION_MAX_LISTENERS", 200),
|
|
42
|
-
totalListeners: whole("NIXAMP_MAX_LISTENERS", 500),
|
|
43
|
-
runningStations: whole("NIXAMP_MAX_RUNNING_STATIONS",
|
|
44
|
-
monthlyBytes: Math.round(Number(
|
|
51
|
+
stationListeners: whole("NIXAMP_STATION_MAX_LISTENERS", "stationListeners", 200),
|
|
52
|
+
totalListeners: whole("NIXAMP_MAX_LISTENERS", "totalListeners", 500),
|
|
53
|
+
runningStations: whole("NIXAMP_MAX_RUNNING_STATIONS", "runningStations", 20),
|
|
54
|
+
monthlyBytes: Math.round(Number(gb ?? 0) * 1024 ** 3) || 0,
|
|
45
55
|
};
|
|
46
56
|
}
|
|
47
57
|
|
package/src/station-routes.ts
CHANGED
|
@@ -42,6 +42,12 @@ export interface StationContext {
|
|
|
42
42
|
trackFor: (file: string) => { title: string; artist: string; album: string } | null;
|
|
43
43
|
/** This server's address as the asker reached it, for links. */
|
|
44
44
|
base: string;
|
|
45
|
+
/**
|
|
46
|
+
* This server's public https address, for links that leave this request's
|
|
47
|
+
* host: the guide is often shown under another name (a Moshpit name through
|
|
48
|
+
* a gateway), and a station is listened to here, not there.
|
|
49
|
+
*/
|
|
50
|
+
publicBase?: string;
|
|
45
51
|
json: (response: ServerResponse, status: number, body: unknown) => void;
|
|
46
52
|
readBody: (request: IncomingMessage) => Promise<string>;
|
|
47
53
|
/** Headers every answer carries (CORS). */
|
|
@@ -63,11 +69,11 @@ function fail(ctx: StationContext, response: ServerResponse, error: unknown): vo
|
|
|
63
69
|
ctx.json(response, 500, { error: error instanceof Error ? error.message : String(error), code: "internal" });
|
|
64
70
|
}
|
|
65
71
|
|
|
66
|
-
function links(ctx: StationContext, station: Station): { page: string; stream: string; m3u: string; state: string } {
|
|
72
|
+
function links(ctx: StationContext, station: Station, base = ctx.base): { page: string; stream: string; m3u: string; state: string } {
|
|
67
73
|
const query = `t=${encodeURIComponent(station.listenToken)}`;
|
|
68
|
-
const at = `${
|
|
74
|
+
const at = `${base}/api/v1/stations/${station.id}`;
|
|
69
75
|
return {
|
|
70
|
-
page: `${
|
|
76
|
+
page: `${base}/station/${station.id}?${query}`,
|
|
71
77
|
stream: `${at}/stream?${query}`,
|
|
72
78
|
m3u: `${at}/listen.m3u?${query}`,
|
|
73
79
|
state: `${at}/state?${query}`,
|
|
@@ -102,6 +108,14 @@ export function publicView(ctx: StationContext, station: Station): PublicStation
|
|
|
102
108
|
};
|
|
103
109
|
}
|
|
104
110
|
|
|
111
|
+
/** What the public guide shows: public, listed stations, linked at this server's public address. */
|
|
112
|
+
export function guideEntries(ctx: StationContext): Array<PublicStation & { page: string; m3u: string }> {
|
|
113
|
+
const base = ctx.publicBase || ctx.base;
|
|
114
|
+
return ctx.store.list()
|
|
115
|
+
.filter((one) => one.visibility === "public" && one.listed)
|
|
116
|
+
.map((one) => ({ ...publicView(ctx, one), page: links(ctx, one, base).page, m3u: links(ctx, one, base).m3u }));
|
|
117
|
+
}
|
|
118
|
+
|
|
105
119
|
export function ownerView(ctx: StationContext, station: Station): OwnerStation & { links: ReturnType<typeof links>; nowPlaying: string } {
|
|
106
120
|
const { failures, idempotencyKey: _key, ...rest } = station;
|
|
107
121
|
return {
|
|
@@ -133,10 +147,7 @@ export async function handleStations(
|
|
|
133
147
|
// The public guide: only stations their owner made public and listed, with
|
|
134
148
|
// their links, because public is what that means. Nothing else, ever.
|
|
135
149
|
if (path === "/api/v1/stations/guide" && (method === "GET" || method === "HEAD")) {
|
|
136
|
-
|
|
137
|
-
ctx.json(response, 200, {
|
|
138
|
-
stations: listed.map((one) => ({ ...publicView(ctx, one), page: links(ctx, one).page, m3u: links(ctx, one).m3u })),
|
|
139
|
-
});
|
|
150
|
+
ctx.json(response, 200, { stations: guideEntries(ctx) });
|
|
140
151
|
return true;
|
|
141
152
|
}
|
|
142
153
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e}from"./main-
|
|
1
|
+
import{n as e}from"./main-C5IsPzDk.js";var t={...e,"No parties live right now.":`لا توجد جلسات مباشرة الآن.`,"Could not refresh parties.":`تعذر تحديث الجلسات.`,"Pick a server in the directory, or paste its link here.":`اختر خادمًا من الدليل أو الصق رابطه هنا.`,"Interface language":`لغة الواجهة`,Language:`اللغة`,"Translation language":`لغة الترجمة`,"Original (auto-detect)":`الأصل (اكتشاف تلقائي)`,Play:`تشغيل`,Pause:`إيقاف مؤقت`,Stop:`إيقاف`,Next:`التالي`,Previous:`السابق`,Select:`اختيار`,"Next/Prev":`التالي/السابق`,Quit:`خروج`,"Now Playing":`قيد التشغيل`,"Spectrum Analyser":`محلل الطيف`,Playlist:`قائمة التشغيل`,Files:`الملفات`,"Open files":`فتح ملفات`,"Open folder":`فتح مجلد`,"Add to library":`إضافة إلى المكتبة`,"Replace playlist":`استبدال قائمة التشغيل`,Filter:`تصفية`,Search:`بحث`,"Nothing loaded.":`لم يُحمّل أي محتوى.`,"Empty.":`فارغ.`,"Loading…":`جارٍ التحميل…`,"Connecting…":`جارٍ الاتصال…`,Connected:`متصل`,"Not connected":`غير متصل`,"No source":`لا يوجد مصدر`,Playing:`يعمل`,Stopped:`متوقف`,Volume:`مستوى الصوت`,Seek:`موضع التشغيل`,"Full screen":`ملء الشاشة`,Download:`تنزيل`,Share:`مشاركة`,Copy:`نسخ`,"Copy link":`نسخ الرابط`,Copied:`تم النسخ`,Save:`حفظ`,Cancel:`إلغاء`,Close:`إغلاق`,Remove:`إزالة`,Delete:`حذف`,Edit:`تعديل`,Add:`إضافة`,Send:`إرسال`,Retry:`إعادة المحاولة`,Back:`رجوع`,"Next page":`الصفحة التالية`,"Previous page":`الصفحة السابقة`,"Show more":`عرض المزيد`,Panels:`اللوحات`,"Reset layout":`إعادة ضبط التخطيط`,Show:`إظهار`,Hide:`إخفاء`,Collapse:`طي`,Expand:`توسيع`,"Move up":`نقل لأعلى`,"Move down":`نقل لأسفل`,Install:`تثبيت`,"TV mode":`وضع التلفاز`,On:`مفعّل`,Off:`معطّل`,Account:`الحساب`,"Sign in":`تسجيل الدخول`,"Sign out":`تسجيل الخروج`,"Create account":`إنشاء حساب`,Email:`البريد الإلكتروني`,Password:`كلمة المرور`,"Forgot password?":`نسيت كلمة المرور؟`,"Welcome back":`مرحبًا بعودتك`,Profile:`الملف الشخصي`,Handle:`اسم المستخدم`,"Your servers":`خوادمك`,Server:`الخادم`,Connect:`اتصال`,Disconnect:`قطع الاتصال`,Directory:`الدليل`,Favourites:`المفضلة`,Follow:`متابعة`,Unfollow:`إلغاء المتابعة`,Notifications:`الإشعارات`,"Phone number":`رقم الهاتف`,"Save number":`حفظ الرقم`,Transcript:`النص المفرغ`,Captions:`الترجمة النصية`,"Translate audio":`ترجمة الصوت`,"Audio language":`لغة الصوت`,"Audio options":`خيارات الصوت`,"Keep background sound":`الاحتفاظ بأصوات الخلفية`,"Background level":`مستوى صوت الخلفية`,"Speaker voices":`أصوات المتحدثين`,"Any voice":`أي صوت`,"Male voice":`صوت رجالي`,"Female voice":`صوت نسائي`,"Original audio.":`الصوت الأصلي.`,"Buy translated audio":`شراء الصوت المترجم`,"Audio credit":`رصيد الصوت`,"Buy pass":`شراء تصريح`,Pass:`تصريح`,"Pay with":`الدفع باستخدام`,"Check payment":`التحقق من الدفع`,"Open checkout":`الانتقال للدفع`,"Free sessions":`جلسات مجانية`,"Usage rates and expiry":`الأسعار ومدة الصلاحية`,Catalogs:`الكتالوجات`,"Add catalog":`إضافة كتالوج`,"Catalog name":`اسم الكتالوج`,Link:`الرابط`,"Play link":`تشغيل الرابط`,"Go live":`بدء بث مباشر`,Publish:`نشر`,Listen:`استماع`,"Live now":`مباشر الآن`,Upcoming:`قريبًا`,Parties:`حفلات المشاهدة`,"Join party":`الانضمام للحفلة`,"Invite code":`رمز الدعوة`,Invite:`دعوة`,Chat:`الدردشة`,"Chat message":`رسالة دردشة`,People:`الأشخاص`,Speaker:`متحدث`,Speakers:`المتحدثون`,Listener:`مستمع`,Moderator:`مشرف`,"Raise hand":`رفع اليد`,"Hand raises":`الأيدي المرفوعة`,Questions:`الأسئلة`,Resources:`الموارد`,Replay:`إعادة العرض`,Schedule:`الجدول`,Event:`الفعالية`,Host:`المضيف`,About:`حول`,Stage:`المنصة`,Title:`العنوان`,Description:`الوصف`,Topic:`الموضوع`,Public:`عام`,"Anyone with the link":`أي شخص لديه الرابط`,"Invited people":`الأشخاص المدعوون`,"Who can join":`من يمكنه الانضمام`,"Date and time":`التاريخ والوقت`,"Expected length":`المدة المتوقعة`,Repeat:`تكرار`,"Does not repeat":`لا يتكرر`,"Every day":`كل يوم`,"Every week":`كل أسبوع`,Homepage:`الموقع الإلكتروني`,"Host name":`اسم المضيف`,"Profile photo URL":`رابط صورة الملف الشخصي`,"Broadcast link":`رابط البث`,"Edit event":`تعديل الفعالية`,"Save changes":`حفظ التغييرات`,"Create live":`إنشاء بث مباشر`,"Schedule class":`جدولة درس`,"Start class":`بدء الدرس`,"End event":`إنهاء الفعالية`,"End session":`إنهاء الجلسة`,"Session ended":`انتهت الجلسة`,"Event ended":`انتهت الفعالية`,Cancelled:`ملغاة`,"Replay available":`إعادة العرض متاحة`,Join:`انضمام`,"Create invite":`إنشاء دعوة`,"Invite as":`الدعوة بصفة`,"Watch now":`شاهد الآن`,"Start a room":`إنشاء غرفة`,"Recent replays":`إعادات العرض الأخيرة`,"Your account":`حسابك`,"Write with AI":`الكتابة بالذكاء الاصطناعي`,"Suggested title":`العنوان المقترح`,"Suggested description":`الوصف المقترح`,"Suggested topic":`الموضوع المقترح`,"Use these details":`استخدام هذه التفاصيل`,"Learn something live.":`تعلّم شيئًا مباشرة.`,"Screen share":`مشاركة الشاشة`,"Upload and broadcast":`رفع وبث`,Help:`مساعدة`,"Reload Player":`إعادة تحميل المشغل`,"Copy Bundled CLI Path":`نسخ مسار أداة سطر الأوامر المضمنة`,"Developer tools":`أدوات المطور`,Undo:`تراجع`,Redo:`إعادة`,Cut:`قص`,Paste:`لصق`,"Select all":`تحديد الكل`,Status:`الحالة`,"Activity log":`سجل النشاط`,Admin:`الإدارة`,"Playback controls":`عناصر التحكم بالتشغيل`,"Tracks and folders":`المقاطع والمجلدات`,"Original-language captions.":`ترجمة نصية باللغة الأصلية.`,"Skip to playback controls":`الانتقال إلى عناصر التحكم بالتشغيل`,"Skip to playlist":`الانتقال إلى قائمة التشغيل`,"Skip to transcript and translated audio":`الانتقال إلى النص المفرغ والصوت المترجم`};export{t as default};
|