fix(presets/stremthru-store): add Usenet stream type handling and info hash extraction

This commit is contained in:
Viren070
2025-09-29 18:41:49 +01:00
parent 028e77288b
commit aa3ae2478a
@@ -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 {