From aa3ae2478aa3ce632cb5bb782cd94c7ee5965d47 Mon Sep 17 00:00:00 2001 From: Viren070 Date: Mon, 29 Sep 2025 18:41:49 +0100 Subject: [PATCH] fix(presets/stremthru-store): add Usenet stream type handling and info hash extraction --- packages/core/src/presets/stremthruStore.ts | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/packages/core/src/presets/stremthruStore.ts b/packages/core/src/presets/stremthruStore.ts index b4afd018..7c5091a8 100644 --- a/packages/core/src/presets/stremthruStore.ts +++ b/packages/core/src/presets/stremthruStore.ts @@ -40,6 +40,26 @@ class StremthruStoreStreamParser extends StremThruStreamParser { } return super.applyUrlModifications(url); } + + protected getStreamType( + stream: Stream, + service: ParsedStream['service'], + currentParsedStream: ParsedStream + ): ParsedStream['type'] { + if (stream.name?.includes('Usenet')) { + return constants.USENET_STREAM_TYPE; + } + return super.getStreamType(stream, service, currentParsedStream); + } + + protected getInfoHash( + stream: Stream, + currentParsedStream: ParsedStream + ): string | undefined { + return currentParsedStream.type !== 'usenet' + ? stream.behaviorHints?.bingeGroup?.match(/[a-fA-F0-9]{40}$/)?.[0] + : undefined; + } } export class StremthruStorePreset extends StremThruPreset {