A single-commit snapshot of better-remote (7a8c4cb plus the uncommitted remote.js work), with every DRM-bearing piece replaced by a stub that keeps the same interface: - src/ui/drm.js: no DRM pipelines; needsDrm/isDrmUrl false, bestEncryptedTranscoding null, playDrmAudio rejects. The engine switcher and drmVjs* helpers stay as no-ops. - src/electron/drm.ts: initCdm/setupLicenseCors no-ops; the drm:license and api:stream:drm-info IPC handlers reject with "DRM is not available". - src/api/soundcloud.ts: resolveEncryptedStream keeps its signature, rejects. - src/electron/main.ts: license host dropped from the header rewrite. - src/ui/pb-lease.js: the expiry self-check uses a placeholder URL instead of a captured DRM manifest URL (same policy values, still passes). - scripts/vmp-sign.js, forge.config.js vmpSign: Widevine signing skipped, so no castLabs EVS account is needed to run or package. - README: says DRM is stubbed here. Go+ tracks SoundCloud only serves encrypted are unplayable and skipped; previews and everything else play as before. No history: the private branches' DRM code is not reachable from this commit. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
42 lines
1.2 KiB
JavaScript
Executable File
42 lines
1.2 KiB
JavaScript
Executable File
'use strict'
|
|
|
|
const { sendJson } = require('../lib/http')
|
|
const { proxyArtwork } = require('../lib/artwork')
|
|
|
|
// Read-only now-playing routes. Each route module is `(req, res, path, ctx) =>
|
|
// boolean`, returning true once it has handled (and answered) the request.
|
|
module.exports = async function stateRoutes(req, res, path, ctx) {
|
|
if (req.method !== 'GET') return false
|
|
const s = ctx.state() || {}
|
|
|
|
switch (path) {
|
|
case '/':
|
|
case '/ping':
|
|
sendJson(res, 200, { ok: true, app: 'CrossSound', service: 'crosssound-api' })
|
|
return true
|
|
case '/state':
|
|
sendJson(res, 200, s)
|
|
return true
|
|
case '/queue':
|
|
sendJson(res, 200, { queue: s.queue || [], queueIndex: s.queueIndex || 0 })
|
|
return true
|
|
case '/shuffle':
|
|
sendJson(res, 200, { shuffle: s.shuffle ?? false })
|
|
return true
|
|
case '/autoplay':
|
|
sendJson(res, 200, { autoplay: s.autoplay ?? false })
|
|
return true
|
|
case '/repeat':
|
|
sendJson(res, 200, { repeat: s.repeat ?? 'none' })
|
|
return true
|
|
case '/events':
|
|
ctx.sse.add(res, s)
|
|
return true
|
|
case '/artwork':
|
|
proxyArtwork(s.artwork ? s.artwork.replace(/-large|-t300x300|-t500x500/, '-t500x500') : null, res)
|
|
return true
|
|
default:
|
|
return false
|
|
}
|
|
}
|