@discord-player/plugin-host 8.0.0-dev.1 → 8.0.0-dev.2
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/README.md +73 -28
- package/dist/compat/base-extractor.d.ts +6 -0
- package/dist/compat/base-extractor.js.map +1 -1
- package/dist/compat/extractor-execution-context.js.map +1 -1
- package/dist/compat/extractor-plugin.js +107 -75
- package/dist/compat/extractor-plugin.js.map +1 -1
- package/dist/compat/utils.js.map +1 -1
- package/dist/errors.d.ts +0 -2
- package/dist/errors.js +0 -2
- package/dist/errors.js.map +1 -1
- package/dist/host.js +81 -20
- package/dist/host.js.map +1 -1
- package/dist/index.d.ts +4 -0
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/legacy-player.d.ts +1 -1
- package/dist/lyrics.d.ts +56 -0
- package/dist/lyrics.js +110 -0
- package/dist/lyrics.js.map +1 -0
- package/dist/media.js.map +1 -1
- package/dist/plugins/execution-options.d.ts +2 -0
- package/dist/plugins/operation-dispatch.js +10 -2
- package/dist/plugins/operation-dispatch.js.map +1 -1
- package/dist/plugins/plugin-error.js.map +1 -1
- package/dist/plugins/registry-internals.d.ts +2 -2
- package/dist/plugins/registry.d.ts +45 -5
- package/dist/plugins/registry.js +149 -15
- package/dist/plugins/registry.js.map +1 -1
- package/dist/plugins/stream-resolver.js +5 -2
- package/dist/plugins/stream-resolver.js.map +1 -1
- package/dist/plugins/types.d.ts +26 -23
- package/dist/plugins/types.js.map +1 -1
- package/dist/protocol.d.ts +35 -0
- package/dist/protocol.js.map +1 -1
- package/dist/providers/lrclib.d.ts +120 -0
- package/dist/providers/lrclib.js +183 -0
- package/dist/providers/lrclib.js.map +1 -0
- package/dist/remote.d.ts +29 -0
- package/dist/remote.js +142 -0
- package/dist/remote.js.map +1 -0
- package/dist/runtime.d.ts +0 -8
- package/dist/runtime.js +41 -43
- package/dist/runtime.js.map +1 -1
- package/dist/structures/search-result.js.map +1 -1
- package/dist/structures/track-types.d.ts +7 -3
- package/dist/structures/track.d.ts +4 -11
- package/dist/structures/track.js +8 -10
- package/dist/structures/track.js.map +1 -1
- package/dist/types.d.ts +2 -4
- package/dist/utils/legacy-serialization-schemas.d.ts +10 -0
- package/dist/utils/serialization-schemas.d.ts +15 -0
- package/dist/utils/serialization-schemas.js +1 -0
- package/dist/utils/serialization-schemas.js.map +1 -1
- package/dist/utils/serialization.js.map +1 -1
- package/docs/remedia-contract.md +9 -8
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -19,34 +19,32 @@ It is neither bundled nor automatically registered.
|
|
|
19
19
|
|
|
20
20
|
## Using a host from a bot
|
|
21
21
|
|
|
22
|
-
Normal applications
|
|
23
|
-
|
|
22
|
+
Normal applications register plugins locally. A metadata-only client descriptor can
|
|
23
|
+
register an existing standalone provider without repeating its host configuration:
|
|
24
24
|
|
|
25
25
|
```ts
|
|
26
|
-
const
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
sourceHosts: [
|
|
30
|
-
{
|
|
31
|
-
hostId: 'sources-1',
|
|
32
|
-
url: 'https://plugins.example.com',
|
|
33
|
-
token: process.env.SOURCE_TOKEN,
|
|
34
|
-
timeoutMs: 15000,
|
|
35
|
-
},
|
|
36
|
-
],
|
|
26
|
+
const remoteSource = definePlugin({
|
|
27
|
+
id: 'example.source',
|
|
28
|
+
remoteHost: { hostId: 'sources-1', url: 'https://plugins.example.test', token: process.env.SOURCE_TOKEN },
|
|
37
29
|
});
|
|
38
30
|
|
|
39
|
-
const
|
|
31
|
+
const player = new Player({ ...audioOptions, plugins: [remoteSource()] });
|
|
32
|
+
const result = await player.search('some song');
|
|
40
33
|
await player.play(channel, result);
|
|
41
34
|
```
|
|
42
35
|
|
|
43
|
-
|
|
36
|
+
Advanced clients may register every advertised provider with
|
|
37
|
+
`player.plugins.registerHost(hostOptions)`. The obsolete constructor `sourceHosts`
|
|
38
|
+
option has been removed. Registration validates live provider capabilities and
|
|
39
|
+
deployment identity; it does not install plugins on the service.
|
|
40
|
+
|
|
41
|
+
This requires `@remedia/client@0.1.0-dev.7` and a matching remote server configured
|
|
44
42
|
with the same `pluginHosts` ID and the `discord-player.source` / `source.stream`
|
|
45
43
|
operation. The bot searches over HTTP and sends an operation descriptor for play
|
|
46
44
|
and automatic crossfade staging. Encoded bytes flow directly from host to audio
|
|
47
45
|
node. Local sources run locally. Embedded nodes cannot play hosted Tracks.
|
|
48
46
|
|
|
49
|
-
See the [complete deployment example](https://discord-player.js.org/docs/plugins/remote-hosts).
|
|
47
|
+
See the [complete deployment example](https://discord-player.js.org/docs/v8/plugins/remote-hosts).
|
|
50
48
|
The direct HTTP examples below describe protocol consumers; a bot should use
|
|
51
49
|
`player.search()` and queue playback, without fetching media grants itself.
|
|
52
50
|
|
|
@@ -59,6 +57,7 @@ import { mySourcePlugin } from './my-source-plugin.js';
|
|
|
59
57
|
|
|
60
58
|
// Local-only handle() usage may omit hostId.
|
|
61
59
|
const host = createSourcePluginHost({ name: 'My Source Host' });
|
|
60
|
+
|
|
62
61
|
await host.extractors.register(MyExtractor);
|
|
63
62
|
await host.plugins.register(mySourcePlugin());
|
|
64
63
|
|
|
@@ -67,15 +66,20 @@ const response = await host.handle({
|
|
|
67
66
|
operation: 'source.search',
|
|
68
67
|
input: { query: 'example' },
|
|
69
68
|
});
|
|
69
|
+
|
|
70
70
|
if (response.handled) console.log(response.result);
|
|
71
|
+
|
|
71
72
|
// Or use typed source APIs directly:
|
|
72
73
|
const result = await host.runtime.search('example');
|
|
73
74
|
const track = result.first();
|
|
75
|
+
|
|
74
76
|
if (track) {
|
|
75
77
|
const source = await host.plugins.resolveStream(track);
|
|
78
|
+
|
|
76
79
|
// Caller owns consumption and destruction of returned Readables.
|
|
77
80
|
console.log(source);
|
|
78
81
|
}
|
|
82
|
+
|
|
79
83
|
await host.close();
|
|
80
84
|
```
|
|
81
85
|
|
|
@@ -99,10 +103,15 @@ import { createSourcePluginHost } from '@discord-player/plugin-host';
|
|
|
99
103
|
import { MyExtractor } from './my-extractor.js';
|
|
100
104
|
|
|
101
105
|
const host = createSourcePluginHost({ name: 'Sources', hostId: 'sources-eu-1', publicUrl: 'http://localhost:3000' });
|
|
106
|
+
|
|
102
107
|
await host.extractors.register(MyExtractor);
|
|
108
|
+
|
|
103
109
|
const app = new Hono();
|
|
110
|
+
|
|
104
111
|
app.all('*', (c) => host.fetch(c.req.raw));
|
|
112
|
+
|
|
105
113
|
const server = serve({ fetch: app.fetch, port: 3000 });
|
|
114
|
+
|
|
106
115
|
process.once('SIGTERM', () => {
|
|
107
116
|
server.close();
|
|
108
117
|
void host.close();
|
|
@@ -120,11 +129,16 @@ import { createSourcePluginHost } from '@discord-player/plugin-host';
|
|
|
120
129
|
import { MyExtractor } from './my-extractor.js';
|
|
121
130
|
|
|
122
131
|
const host = createSourcePluginHost({ name: 'Sources', hostId: 'sources-eu-1', publicUrl: 'http://localhost:3000' });
|
|
132
|
+
|
|
123
133
|
await host.extractors.register(MyExtractor);
|
|
134
|
+
|
|
124
135
|
const app = express();
|
|
136
|
+
|
|
125
137
|
app.use(createNodeMiddleware(host));
|
|
126
138
|
app.use(express.json());
|
|
139
|
+
|
|
127
140
|
const server = app.listen(3000);
|
|
141
|
+
|
|
128
142
|
process.once('SIGTERM', () => {
|
|
129
143
|
server.close();
|
|
130
144
|
void host.close();
|
|
@@ -140,12 +154,11 @@ Configure `token`, `mediaTtlMs`, and `maxMediaTokens` through the host options.
|
|
|
140
154
|
|
|
141
155
|
One aggregate registration, `discord-player.source`, advertises:
|
|
142
156
|
|
|
143
|
-
| Operation | Input
|
|
144
|
-
| ---------------- |
|
|
145
|
-
| `source.search` | `{ query, options? }`
|
|
146
|
-
| `source.
|
|
147
|
-
| `source.
|
|
148
|
-
| `source.stream` | `{ track }` | Deferred Remedia media descriptor |
|
|
157
|
+
| Operation | Input | Result |
|
|
158
|
+
| ---------------- | --------------------- | ------------------------------------------ |
|
|
159
|
+
| `source.search` | `{ query, options? }` | Metadata through normal provider matching |
|
|
160
|
+
| `source.related` | `{ track }` | Related metadata from the track's provider |
|
|
161
|
+
| `source.stream` | `{ track }` | Deferred Remedia media descriptor |
|
|
149
162
|
|
|
150
163
|
`source.stream` includes normal bridge fallback and post-stream transformations;
|
|
151
164
|
internal operation handlers are not separate Remedia registrations. HTTP options
|
|
@@ -161,10 +174,15 @@ const response = await fetch('http://localhost:3000/remedia/v1/execute', {
|
|
|
161
174
|
headers: { 'content-type': 'application/json' },
|
|
162
175
|
body: JSON.stringify({ pluginId: SOURCE_PLUGIN_ID, operation: 'source.search', input: { query: 'example' } }),
|
|
163
176
|
});
|
|
177
|
+
|
|
164
178
|
if (!response.ok) throw new Error(`Source search failed: ${response.status}`);
|
|
179
|
+
|
|
165
180
|
const search = (await response.json()) as { handled: boolean; result: PortableSourceResult };
|
|
181
|
+
|
|
166
182
|
if (!search.handled) throw new Error('Unhandled search');
|
|
183
|
+
|
|
167
184
|
const localModels = deserializeSourceResult(search.result);
|
|
185
|
+
|
|
168
186
|
console.log(localModels.first());
|
|
169
187
|
|
|
170
188
|
// Send the original portable representation back, including its optional state hint.
|
|
@@ -177,11 +195,16 @@ const mediaResponse = await fetch('http://localhost:3000/remedia/v1/execute', {
|
|
|
177
195
|
input: { track: search.result.tracks[0] },
|
|
178
196
|
}),
|
|
179
197
|
});
|
|
198
|
+
|
|
180
199
|
if (!mediaResponse.ok) throw new Error(`Source stream failed: ${mediaResponse.status}`);
|
|
200
|
+
|
|
181
201
|
const media = (await mediaResponse.json()) as { handled: boolean; result: { url: string; expiresAtMs: number } };
|
|
202
|
+
|
|
182
203
|
if (!media.handled) throw new Error('Unhandled media');
|
|
204
|
+
|
|
183
205
|
// Redeem media.result.url before expiresAtMs; this is a short-lived, single-use grant.
|
|
184
206
|
const bytes = await fetch(media.result.url);
|
|
207
|
+
|
|
185
208
|
console.log(bytes.body);
|
|
186
209
|
```
|
|
187
210
|
|
|
@@ -258,10 +281,10 @@ compatibility surface does not emulate the whole Player API.
|
|
|
258
281
|
|
|
259
282
|
## Remedia server integration boundary
|
|
260
283
|
|
|
261
|
-
Remedia dev.
|
|
284
|
+
Remedia dev.7 supports generic host discovery, authenticated operation execution,
|
|
262
285
|
native decoding of single-use grants, and cancellation. Configure the deployment
|
|
263
|
-
in the server's `pluginHosts` list and in the bot's `
|
|
264
|
-
`@remedia/plugin-host@0.1.0-dev.
|
|
286
|
+
in the server's `pluginHosts` list and in the bot plugin's `remoteHost` descriptor. Installing
|
|
287
|
+
`@remedia/plugin-host@0.1.0-dev.7` alone does not register a host with an audio node.
|
|
265
288
|
|
|
266
289
|
DiscordPlayer sends operation descriptors for playback and staged-next preparation;
|
|
267
290
|
the audio node invokes `source.stream` and consumes encoded bytes directly. The
|
|
@@ -340,9 +363,31 @@ registration. Provider URL expiration remains intact. The consuming node must st
|
|
|
340
363
|
independently enforce its DNS/redirect policy for direct URLs. Authentication or
|
|
341
364
|
byte transformations requiring the host must use proxy delivery.
|
|
342
365
|
|
|
343
|
-
Single-use media grants reject Range requests. Remedia dev.
|
|
344
|
-
|
|
345
|
-
|
|
366
|
+
Single-use media grants reject Range requests. Remedia dev.7 redeems each grant with one
|
|
367
|
+
plain GET and feeds a bounded sequential queue to the decoder, so it never issues Range
|
|
368
|
+
requests, reopens or reconnects a grant. Seeking is forward-only. This does not add random
|
|
369
|
+
access or turn grant URLs into durable source references.
|
|
346
370
|
See [the Remedia integration contract](docs/remedia-contract.md) for the current
|
|
347
371
|
protocol and validation limits. Native Remedia playback and Discord voice delivery
|
|
348
372
|
remain outside this repository's HTTP/client integration tests.
|
|
373
|
+
|
|
374
|
+
## Optional capabilities
|
|
375
|
+
|
|
376
|
+
`definePlugin()` has no kind discriminator. Its typed `OperationMap` includes
|
|
377
|
+
`lyrics.search` independently of source operations. A lyrics provider returns an
|
|
378
|
+
array of normalized records with `plain.available` and `synced.available` discriminants;
|
|
379
|
+
only synchronized records carry sorted `{ timestampMs, line }` values. The optional
|
|
380
|
+
`lrclibPlugin()` implementation lives here and is not automatically registered by
|
|
381
|
+
Discord Player. Legacy `BaseExtractor.resolveLyrics()` adapts into that same operation.
|
|
382
|
+
|
|
383
|
+
HTTP discovery advertises actual provider IDs, protocols, priorities and operation
|
|
384
|
+
handlers. `metadata.execute` carries a typed `MetadataRequest` for normalized search,
|
|
385
|
+
lyrics or related metadata. `source.search` remains the high-level search endpoint;
|
|
386
|
+
`source.resolve` was removed. Portable lyrics requests use versioned Track metadata
|
|
387
|
+
without expiring source-state hints. `source.stream` and native operation-source
|
|
388
|
+
playback retain their existing media policy, cancellation and grant behavior.
|
|
389
|
+
|
|
390
|
+
Metadata currently travels over direct HTTP. Remedia dev.7 can forward generic plugin
|
|
391
|
+
operations to server-configured hosts (`client.plugins.list` / `execute`), but Discord Player
|
|
392
|
+
does not use that path yet. `remote.ts` isolates this boundary for a future supported
|
|
393
|
+
transport without introducing a second search dispatcher.
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { LyricsResult } from '../lyrics.js';
|
|
1
2
|
import type { Readable } from 'node:stream';
|
|
2
3
|
import type { SourceRuntimeEvents } from '../legacy-player.js';
|
|
3
4
|
import type { Track } from '../structures/track.js';
|
|
@@ -30,6 +31,11 @@ export declare class BaseExtractor<Options extends object = object> {
|
|
|
30
31
|
get identifier(): string;
|
|
31
32
|
/** Obsolete demux support is unavailable. */
|
|
32
33
|
get supportsDemux(): boolean;
|
|
34
|
+
/** Optional lyrics capability, adapted into the shared operation dispatcher.
|
|
35
|
+
* @param input Track metadata or a raw lookup query.
|
|
36
|
+
* @returns Lyrics records, or null when no lyrics were found.
|
|
37
|
+
*/
|
|
38
|
+
resolveLyrics?(input: Track | string): Promise<LyricsResult | LyricsResult[] | null>;
|
|
33
39
|
/** Acquire extractor resources. */
|
|
34
40
|
activate(): Promise<void>;
|
|
35
41
|
/** Release extractor resources. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base-extractor.js","sourceRoot":"","sources":["../../src/compat/base-extractor.ts"],"names":[],"mappings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CAAC;QAEX,OAAO,SAAS,CAAC;IACnB,CAAC;IAED;;;OAGG;IACI,KAAK,CAAC,gBAAgB,CAAC,KAAY,EAAE,OAAiB;QAC3D,KAAK,KAAK,CAAC;QACX,KAAK,OAAO,CAAC;QAEb,OAAO,IAAI,CAAC,cAAc,EAAE,CAAC;IAC/B,CAAC;IAED;;;OAGG;IACI,KAAK,CAAC,MAAM,CAAC,KAAY,EAAE,eAA0C;QAC1E,KAAK,KAAK,CAAC;QACX,KAAK,eAAe,CAAC;QAErB,OAAO,IAAI,CAAC;IACd,CAAC;IAED;;;OAGG;IACI,gBAAgB,CAAC,MAAgB,EAAE,IAAkB;QAC1D,IAAI,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;IACrB,CAAC;IAED;;OAEG;IACI,iBAAiB,CAAC,KAAY;QACnC,OAAO,GAAG,KAAK,CAAC,KAAK,OAAO,KAAK,CAAC,MAAM,EAAE,CAAC;IAC7C,CAAC;IAED;;;OAGG;IACI,cAAc,CAAC,QAAQ,GAAoB,IAAI,EAAE,MAAM,GAAY,QAAQ,EAAE,MAAM,IAAI,EAAE;QAC9F,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,CAAC;IAC9B,CAAC;IAED;;OAEG;IACI,KAAK,CAAC,OAAe;QAC1B,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;IACrC,CAAC;IAED;;;OAGG;IACI,IAAI,CAAsC,KAAQ,EAAE,GAAG,IAA4B;QACxF,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,EAAE,GAAI,IAAc,CAAC,CAAC;IAC7D,CAAC;CACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"extractor-execution-context.js","sourceRoot":"","sources":["../../src/compat/extractor-execution-context.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAInD,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AAG9D,iFAAiF;AACjF,MAAM,OAAO,yBAAyB;
|
|
1
|
+
{"version":3,"file":"extractor-execution-context.js","sourceRoot":"","sources":["../../src/compat/extractor-execution-context.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAInD,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AAG9D,iFAAiF;AACjF,MAAM,OAAO,yBAAyB;IAoBlB,MAAM;IAnBhB,cAAc,GAAG,IAAI,iBAAiB,EAAe,CAAC;IAEtD,SAAS,GAAG,IAAI,UAAU,EAA8B,CAAC;IAEjE,qDAAqD;IACrD,IAAW,KAAK;QACd,OAAO,IAAI,CAAC,SAAS,CAAC;IACxB,CAAC;IAED,sCAAsC;IACtC,IAAW,IAAI;QACb,OAAO,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC;IAC7B,CAAC;IAED;;OAEG;IACH;IACE,0CAA0C;IAC1B,MAA2B;sBAA3B,MAAM;IACrB,CAAC;IAEJ;;OAEG;IACI,GAAG,CAAC,EAAU;QACnB,OAAO,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IAChC,CAAC;IAED;;OAEG;IACI,YAAY,CAAC,EAAU;QAC5B,OAAO,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IAChC,CAAC;IAED;;OAEG;IACI,UAAU,CAAC,EAAU;QAC1B,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,eAAe,EAAE,QAAQ,CAAC,EAAE,CAAC,IAAI,KAAK,C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MAAM,CAAC,OAAO,CAAC,eAAe,EAAE,CACjD,CAAC;QACJ,MAAM,MAAM,GAAG,IAAI,CAAC,cAAc,CAAC,QAAQ,EAAE;YAC3C,CAAC,CAAC,MAAM,QAAQ,EAAE;YAClB,CAAC,CAAC,MAAM,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,IAAI,GAAG,EAAU,EAAE,QAAQ,CAAC,CAAC;QAE/D,IAAI,MAAM,KAAK,SAAS,EAAE,CAAC;YACzB,MAAM,IAAI,KAAK,CAAC,uCAAuC,CAAC,CAAC;QAC3D,CAAC;QAED,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,CAAC,gBAAgB,EAAmD,CAAC;IACrH,CAAC;CACF"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Readable } from 'node:stream';
|
|
2
2
|
import { definePlugin } from '../plugins/types.js';
|
|
3
|
+
import { BaseExtractor } from './base-extractor.js';
|
|
3
4
|
function checkLegacyStream(result) {
|
|
4
5
|
if (result && typeof result === 'object' && '$fmt' in result && /^(?:pcm|opus)$/i.test(result.$fmt)) {
|
|
5
6
|
result.stream.destroy();
|
|
@@ -29,89 +30,120 @@ export function createExtractorPlugin(instance, context, getBridgeAttempts, onAc
|
|
|
29
30
|
};
|
|
30
31
|
return definePlugin({
|
|
31
32
|
id: instance.identifier,
|
|
32
|
-
kind: 'source',
|
|
33
33
|
setup: async (ctx) => {
|
|
34
34
|
await instance.activate();
|
|
35
35
|
onActivate();
|
|
36
|
+
if (instance.resolveLyrics) {
|
|
37
|
+
ctx.on('lyrics.search', async ({ input }) => {
|
|
38
|
+
const result = await instance.resolveLyrics?.(input);
|
|
39
|
+
return result == null ? null : Array.isArray(result) ? result : [result];
|
|
40
|
+
}, { priority: instance.priority });
|
|
41
|
+
}
|
|
36
42
|
const metadata = { priority: instance.priority, protocols: instance.protocols };
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
const
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
const
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
43
|
+
if (instance.handle !== BaseExtractor.prototype.handle &&
|
|
44
|
+
(instance.validate !== BaseExtractor.prototype.validate || instance.protocols.length > 0)) {
|
|
45
|
+
ctx.on('search.query.match', async ({ query, protocol, providerHint }) => {
|
|
46
|
+
if (protocol) {
|
|
47
|
+
return instance.protocols.includes(protocol) ? { score: 100 } : null;
|
|
48
|
+
}
|
|
49
|
+
return (await instance.validate(query, providerHint ?? (/^https?:\/\//i.test(query) ? 'arbitrary' : 'auto')))
|
|
50
|
+
? { score: 0 }
|
|
51
|
+
: null;
|
|
52
|
+
}, metadata);
|
|
53
|
+
}
|
|
54
|
+
if (instance.handle !== BaseExtractor.prototype.handle) {
|
|
55
|
+
ctx.on('search.query.resolve', async ({ query, options, protocol, providerHint }) => {
|
|
56
|
+
const result = stamp(await instance.handle(query, {
|
|
57
|
+
type: providerHint ?? (/^https?:\/\//i.test(query) ? 'arbitrary' : 'auto'),
|
|
58
|
+
requestedBy: options?.requestedBy,
|
|
59
|
+
requestOptions: options?.requestOptions,
|
|
60
|
+
protocol,
|
|
61
|
+
}));
|
|
62
|
+
for (const track of result.tracks) {
|
|
63
|
+
track.queryType ??= providerHint ?? (/^https?:\/\//i.test(query) ? 'arbitrary' : 'auto');
|
|
64
|
+
if (track.sourceReference &&
|
|
65
|
+
track.sourceReference.data &&
|
|
66
|
+
typeof track.sourceReference.data === 'object' &&
|
|
67
|
+
!Array.isArray(track.sourceReference.data))
|
|
68
|
+
track.sourceReference.data.queryType = track.queryType ?? null;
|
|
69
|
+
}
|
|
70
|
+
return result;
|
|
71
|
+
}, metadata);
|
|
72
|
+
}
|
|
73
|
+
if (instance.stream !== BaseExtractor.prototype.stream) {
|
|
74
|
+
ctx.on('track.stream', async ({ track }) => {
|
|
75
|
+
// Restored tracks reconstruct only the public legacy location fields.
|
|
76
|
+
if (!track.raw.engine) {
|
|
77
|
+
track.raw.engine = track.url;
|
|
78
|
+
}
|
|
79
|
+
track.queryType ??=
|
|
80
|
+
typeof track.sourceReference?.data === 'object' &&
|
|
81
|
+
track.sourceReference.data &&
|
|
82
|
+
'queryType' in track.sourceReference.data
|
|
83
|
+
? String(track.sourceReference.data.queryType ?? '')
|
|
84
|
+
: undefined;
|
|
85
|
+
return checkLegacyStream(await instance.stream(track));
|
|
86
|
+
}, metadata);
|
|
87
|
+
}
|
|
88
|
+
if (instance.getRelatedTracks !== BaseExtractor.prototype.getRelatedTracks) {
|
|
89
|
+
ctx.on('track.related', async ({ track, history }) => stamp(await instance.getRelatedTracks(track, history ?? { tracks: [] })), metadata);
|
|
90
|
+
}
|
|
91
|
+
if (instance.bridge !== BaseExtractor.prototype.bridge) {
|
|
92
|
+
ctx.on('track.bridge', async ({ track, sourcePluginId }) => {
|
|
93
|
+
const attempts = getBridgeAttempts();
|
|
94
|
+
if (sourcePluginId === instance.identifier || attempts?.has(instance.identifier)) {
|
|
95
|
+
return undefined;
|
|
96
|
+
}
|
|
97
|
+
attempts?.add(instance.identifier);
|
|
98
|
+
const result = checkLegacyStream((await instance.bridge(track, context.get(sourcePluginId ?? '') ?? null)) ?? undefined);
|
|
99
|
+
if (result === undefined) {
|
|
100
|
+
return undefined;
|
|
101
|
+
}
|
|
102
|
+
track.bridgedExtractor = instance;
|
|
103
|
+
// Object identity retains bridge ownership through nested legacy stream calls.
|
|
104
|
+
return typeof result === 'string'
|
|
105
|
+
? /^https?:\/\//i.test(result)
|
|
106
|
+
? { url: result }
|
|
107
|
+
: { file: result }
|
|
108
|
+
: result instanceof Readable
|
|
109
|
+
? { stream: result }
|
|
110
|
+
: result;
|
|
111
|
+
}, metadata);
|
|
112
|
+
}
|
|
113
|
+
if (instance.handlePostStream !== BaseExtractor.prototype.handlePostStream) {
|
|
114
|
+
ctx.on('stream.transform', async ({ track, stream }, { signal }) => ({
|
|
115
|
+
track,
|
|
116
|
+
stream: await new Promise((resolve, reject) => {
|
|
117
|
+
signal.throwIfAborted();
|
|
118
|
+
const abort = () => {
|
|
119
|
+
stream.destroy();
|
|
96
120
|
reject(signal.reason);
|
|
97
|
-
|
|
121
|
+
};
|
|
122
|
+
signal.addEventListener('abort', abort, { once: true });
|
|
123
|
+
const next = (error, result) => {
|
|
124
|
+
signal.removeEventListener('abort', abort);
|
|
125
|
+
if (signal.aborted) {
|
|
126
|
+
result?.destroy();
|
|
127
|
+
reject(signal.reason);
|
|
128
|
+
return;
|
|
129
|
+
}
|
|
130
|
+
if (error) {
|
|
131
|
+
reject(error);
|
|
132
|
+
}
|
|
133
|
+
else {
|
|
134
|
+
resolve(result ?? stream);
|
|
135
|
+
}
|
|
136
|
+
};
|
|
137
|
+
try {
|
|
138
|
+
(track.bridgedExtractor ?? instance).handlePostStream(stream, next);
|
|
98
139
|
}
|
|
99
|
-
|
|
140
|
+
catch (error) {
|
|
141
|
+
signal.removeEventListener('abort', abort);
|
|
100
142
|
reject(error);
|
|
101
143
|
}
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
};
|
|
106
|
-
try {
|
|
107
|
-
(track.bridgedExtractor ?? instance).handlePostStream(stream, next);
|
|
108
|
-
}
|
|
109
|
-
catch (error) {
|
|
110
|
-
signal.removeEventListener('abort', abort);
|
|
111
|
-
reject(error);
|
|
112
|
-
}
|
|
113
|
-
}),
|
|
114
|
-
}), metadata);
|
|
144
|
+
}),
|
|
145
|
+
}), metadata);
|
|
146
|
+
}
|
|
115
147
|
},
|
|
116
148
|
destroy: async () => {
|
|
117
149
|
try {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"extractor-plugin.js","sourceRoot":"","sources":["../../src/compat/extractor-plugin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,YAAY,EAAsB,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"extractor-plugin.js","sourceRoot":"","sources":["../../src/compat/extractor-plugin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,YAAY,EAAsB,MAAM,qBAAqB,CAAC;AACvE,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAIpD,SAAS,iBAAiB,CAAC,MAAuC;IAChE,IAAI,MAAM,IAAI,OAAO,MAAM,KAAK,QAAQ,IAAI,MAAM,IAAI,MAAM,IAAI,iBAAiB,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC;QACpG,MAAM,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;QAExB,MAAM,IAAI,KAAK,CAAC,cAAc,MAAM,CAAC,IAAI,0DAA0D,CAAC,CAAC;IACvG,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,UAAU,qBAAqB,CACnC,QAA4B,EAC5B,OAAkC,EAClC,iBAAgD,EAChD,UAAsB,EACtB,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C;gCAEtB,OAAO;4BACT,CAAC;4BAED,IAAI,KAAK,EAAE,CAAC;gCACV,MAAM,CAAC,KAAK,CAAC,CAAC;4BAChB,CAAC;iCAAM,CAAC;gCACN,OAAO,CAAC,MAAM,IAAI,MAAM,CAAC,CAAC;4BAC5B,CAAC;wBACH,CAAC,CAAC;wBAEF,IAAI,CAAC;4BACH,CAAC,KAAK,CAAC,gBAAgB,IAAI,QAAQ,CAAC,CAAC,gBAAgB,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;wBACtE,CAAC;wBAAC,OAAO,KAAK,EAAE,CAAC;4BACf,MAAM,CAAC,mBAAmB,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;4BAC3C,MAAM,CAAC,KAAK,CAAC,CAAC;wBAChB,CAAC;oBACH,CAAC,CAAC;iBACH,CAAC,EACF,QAAQ,CACT,CAAC;YACJ,CAAC;QACH,CAAC;QAED,OAAO,EAAE,KAAK,IAAI,EAAE;YAClB,IAAI,CAAC;gBACH,MAAM,QAAQ,CAAC,UAAU,EAAE,CAAC;YAC9B,CAAC;oBAAS,CAAC;gBACT,YAAY,EAAE,CAAC;YACjB,CAAC;QACH,CAAC;KACF,CAAC,CAAC;AACL,CAAC"}
|
package/dist/compat/utils.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/compat/utils.ts"],"names":[],"mappings":"AAkBA,oGAAoG;AACpG,MAAM,CAAC,MAAM,IAAI,GAAG;IAClB;;OAEG;IACH,IAAI,CAAC,GAAG,IAAe;QACrB,KAAK,IAAI,CAAC;IACZ,CAAC;
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/compat/utils.ts"],"names":[],"mappings":"AAkBA,oGAAoG;AACpG,MAAM,CAAC,MAAM,IAAI,GAAG;IAClB;;OAEG;IACH,IAAI,CAAC,GAAG,IAAe;QACrB,KAAK,IAAI,CAAC;IACZ,CAAC;IAED;;OAEG;IACH,OAAO,CAAC,YAAoB;QAC1B,MAAM,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,YAAY,CAAC,CAAC;QAExC,OAAO;YACL,IAAI,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK,GAAG,QAAQ,CAAC;YAClC,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK,GAAG,OAAO,CAAC,GAAG,EAAE;YACvC,OAAO,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK,GAAG,KAAK,CAAC,GAAG,EAAE;YACvC,OAAO,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK,GAAG,IAAI,CAAC,GAAG,EAAE;YACtC,YAAY,EAAE,KAAK,GAAG,IAAI;SAC3B,CAAC;IACJ,CAAC;IAED;;OAEG;IACH,aAAa,CAAC,IAAoB;QAChC,MAAM,KAAK,GAAG,IAAI,CAAC,IAAI,GAAG,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC;QAE1C,OAAO,GAAG,KAAK,CAAC,CAAC,CAAC,GAAG,KAAK,GAAG,CAAC,CAAC,CAAC,EAAE,GAAG,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,IAAI,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,EAAE,CAAC;IAC/I,CAAC;CACF,CAAC"}
|
package/dist/errors.d.ts
CHANGED
|
@@ -4,8 +4,6 @@ export declare const DiscordPlayerErrorCode: {
|
|
|
4
4
|
readonly QueueCapacity: 'ERR_QUEUE_CAPACITY';
|
|
5
5
|
/** A required queue, session, or track could not be resolved. */
|
|
6
6
|
readonly NoResult: 'ERR_NO_RESULT';
|
|
7
|
-
/** The installed Remedia client does not provide a requested capability. */
|
|
8
|
-
readonly UnsupportedRemediaCapability: 'ERR_UNSUPPORTED_REMEDIA_CAPABILITY';
|
|
9
7
|
/** A track has no source plugin to resolve a Remedia source. */
|
|
10
8
|
readonly SourceUnavailable: 'ERR_SOURCE_UNAVAILABLE';
|
|
11
9
|
/** Data could not be serialized or reconstructed. */
|
package/dist/errors.js
CHANGED
|
@@ -4,8 +4,6 @@ export const DiscordPlayerErrorCode = {
|
|
|
4
4
|
QueueCapacity: 'ERR_QUEUE_CAPACITY',
|
|
5
5
|
/** A required queue, session, or track could not be resolved. */
|
|
6
6
|
NoResult: 'ERR_NO_RESULT',
|
|
7
|
-
/** The installed Remedia client does not provide a requested capability. */
|
|
8
|
-
UnsupportedRemediaCapability: 'ERR_UNSUPPORTED_REMEDIA_CAPABILITY',
|
|
9
7
|
/** A track has no source plugin to resolve a Remedia source. */
|
|
10
8
|
SourceUnavailable: 'ERR_SOURCE_UNAVAILABLE',
|
|
11
9
|
/** Data could not be serialized or reconstructed. */
|
package/dist/errors.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA,0EAA0E;AAC1E,MAAM,CAAC,MAAM,sBAAsB,GAAG;IACpC,wDAAwD;IACxD,aAAa,EAAE,oBAAoB;IACnC,iEAAiE;IACjE,QAAQ,EAAE,eAAe;IACzB,
|
|
1
|
+
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA,0EAA0E;AAC1E,MAAM,CAAC,MAAM,sBAAsB,GAAG;IACpC,wDAAwD;IACxD,aAAa,EAAE,oBAAoB;IACnC,iEAAiE;IACjE,QAAQ,EAAE,eAAe;IACzB,gEAAgE;IAChE,iBAAiB,EAAE,wBAAwB;IAC3C,qDAAqD;IACrD,aAAa,EAAE,mBAAmB;CAC1B,CAAC;AAKX,8DAA8D;AAC9D,MAAM,OAAO,kBAAmB,SAAQ,KAAK;IAC3C,0CAA0C;IAC1B,IAAI,CAAyB;IAE7C;;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