Skip to content

Commit eca6973

Browse files
committed
add: eternalbox source integration with streaming
1 parent 30ee35c commit eca6973

4 files changed

Lines changed: 1286 additions & 1 deletion

File tree

config.default.js

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,38 @@ export default {
164164
http: {
165165
enabled: true
166166
},
167+
eternalbox: {
168+
enabled: true,
169+
baseUrl: 'https://eternalboxmirror.xyz',
170+
searchResults: 30,
171+
enrichSpotify: true,
172+
includeAnalysis: true,
173+
includeAnalysisSummary: true,
174+
eternalStream: true,
175+
cacheMaxBytes: 20 * 1024 * 1024,
176+
maxBranches: 4,
177+
maxBranchThreshold: 75,
178+
branchThresholdStart: 10,
179+
branchThresholdStep: 5,
180+
branchTargetDivisor: 6,
181+
addLastEdge: true,
182+
justBackwards: false,
183+
justLongBranches: false,
184+
removeSequentialBranches: true,
185+
useFilteredSegments: true,
186+
minRandomBranchChance: 0.18,
187+
maxRandomBranchChance: 0.5,
188+
randomBranchChanceDelta: 0.09,
189+
timbreWeight: 1,
190+
pitchWeight: 10,
191+
loudStartWeight: 1,
192+
loudMaxWeight: 1,
193+
durationWeight: 100,
194+
confidenceWeight: 1,
195+
infiniteStream: true,
196+
maxReconnects: 0,
197+
reconnectDelayMs: 1000
198+
},
167199
vimeo: {
168200
// Note: not 100% of the songs are currently working (but most should.), because i need to code a different extractor for every year (2010, 2011, etc. not all are done)
169201
enabled: true,

src/constants.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,9 @@ export const GatewayEvents = {
2525
PLAYER_RECONNECTING: 'PlayerReconnectingEvent',
2626
PLAYER_CONNECTED: 'PlayerConnectedEvent',
2727
MIX_STARTED: 'MixStartedEvent',
28-
MIX_ENDED: 'MixEndedEvent'
28+
MIX_ENDED: 'MixEndedEvent',
29+
ETERNALBOX_INFO: 'EternalBoxInfoEvent',
30+
ETERNALBOX_JUMP: 'EternalBoxJumpEvent'
2931
}
3032
export const EndReasons = {
3133
STOPPED: 'stopped',

src/playback/player.js

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -402,6 +402,29 @@ export class Player {
402402
playingQuality: this.streamInfo?.format?.itag || null
403403
})
404404

405+
if (trackToEmit?.info?.sourceName === 'eternalbox') {
406+
const info = trackToEmit.info
407+
const pluginInfo = trackToEmit.pluginInfo || {}
408+
const links = {
409+
jukeboxPage: `https://eternalboxmirror.xyz/jukebox_go.html?id=${info.identifier}`,
410+
analysisUrl: pluginInfo.analysisUrl || null,
411+
streamUrl: pluginInfo.streamUrl || null,
412+
ogAudioSource: pluginInfo.ogAudioSource || null,
413+
spotifyUrl: pluginInfo.spotify?.url || info.uri || null
414+
}
415+
416+
this.emitEvent(GatewayEvents.ETERNALBOX_INFO, {
417+
track: trackToEmit,
418+
eternalbox: {
419+
id: info.identifier,
420+
service: pluginInfo.service || null,
421+
analysisSummary: pluginInfo.analysisSummary || null,
422+
spotify: pluginInfo.spotify || null,
423+
links
424+
}
425+
})
426+
}
427+
405428
if (this.isLyricsSubscribed) {
406429
this._loadLyrics()
407430
}
@@ -467,6 +490,14 @@ export class Player {
467490
additionalData
468491
)
469492
if (fetched.exception) return fetched
493+
if (fetched.stream?.on) {
494+
fetched.stream.on('eternalboxJump', (data) => {
495+
this.emitEvent(GatewayEvents.ETERNALBOX_JUMP, {
496+
track: this.holoTrack || this.track,
497+
eternalbox: data
498+
})
499+
})
500+
}
470501
const resource = createAudioResource(
471502
fetched.stream,
472503
fetched.type || urlData.format,

0 commit comments

Comments
 (0)