mirror of
https://github.com/Viren070/AIOStreams.git
synced 2025-12-01 23:14:04 +01:00
feat: add private torrent detection for stremthru torz (#499)
Co-authored-by: Viren070 <viren070@protonmail.com>
This commit is contained in:
committed by
Viren070
parent
49610148ca
commit
32d21193b1
@@ -695,7 +695,8 @@ export const ParsedStreamSchema = z.object({
|
||||
infoHash: z.string().min(1).optional(),
|
||||
fileIdx: z.number().optional(),
|
||||
seeders: z.number().optional(),
|
||||
sources: z.array(z.string().min(1)).optional(), // array of tracker urls and DHT nodes
|
||||
sources: z.array(z.string().min(1)).optional(),
|
||||
private: z.boolean().optional(),
|
||||
})
|
||||
.optional(),
|
||||
countryWhitelist: z.array(z.string().length(3)).optional(),
|
||||
@@ -899,7 +900,8 @@ export const AIOStream = StreamSchema.extend({
|
||||
infoHash: z.string().min(1).optional(),
|
||||
fileIdx: z.number().optional(),
|
||||
seeders: z.number().optional(),
|
||||
sources: z.array(z.string().min(1)).optional(), // array of tracker urls and DHT nodes
|
||||
sources: z.array(z.string().min(1)).optional(),
|
||||
private: z.boolean().optional(),
|
||||
})
|
||||
.optional(),
|
||||
duration: z.number().optional(),
|
||||
|
||||
@@ -96,6 +96,7 @@ export interface ParseValue {
|
||||
seasonEpisode: string[] | null;
|
||||
seasonPack: boolean;
|
||||
seeders: number | null;
|
||||
private: boolean;
|
||||
age: string | null;
|
||||
ageHours: number | null;
|
||||
duration: number | null;
|
||||
@@ -296,6 +297,7 @@ export abstract class BaseFormatter {
|
||||
audioChannels: stream.parsedFile?.audioChannels || null,
|
||||
indexer: stream.indexer || null,
|
||||
seeders: stream.torrent?.seeders ?? null,
|
||||
private: stream.torrent?.private ?? false,
|
||||
year: stream.parsedFile?.year || null,
|
||||
type: stream.type || null,
|
||||
title: stream.parsedFile?.title || null,
|
||||
|
||||
@@ -137,6 +137,7 @@ class StreamParser {
|
||||
sources: stream.sources ?? undefined,
|
||||
fileIdx:
|
||||
stream.fileIdx ?? this.getFileIdx(stream, parsedStream) ?? undefined,
|
||||
private: this.isPrivate(stream, parsedStream),
|
||||
};
|
||||
|
||||
return parsedStream;
|
||||
@@ -327,6 +328,13 @@ class StreamParser {
|
||||
return false;
|
||||
}
|
||||
|
||||
protected isPrivate(
|
||||
stream: Stream,
|
||||
currentParsedStream: ParsedStream
|
||||
): boolean | undefined {
|
||||
return false;
|
||||
}
|
||||
|
||||
protected getIndexer(
|
||||
stream: Stream,
|
||||
currentParsedStream: ParsedStream
|
||||
|
||||
@@ -13,6 +13,13 @@ export const stremthruSpecialCases: Partial<
|
||||
};
|
||||
|
||||
export class StremThruStreamParser extends StreamParser {
|
||||
protected override isPrivate(
|
||||
stream: Stream,
|
||||
_currentParsedStream: ParsedStream
|
||||
): boolean | undefined {
|
||||
return stream.name?.includes('🔑') ? true : false;
|
||||
}
|
||||
|
||||
protected override getIndexer(
|
||||
stream: Stream,
|
||||
currentParsedStream: ParsedStream
|
||||
|
||||
Reference in New Issue
Block a user