mirror of
https://github.com/Viren070/AIOStreams.git
synced 2025-12-01 23:14:04 +01:00
feat: add personal stream identification to formatters and wrappers
This commit is contained in:
@@ -24,7 +24,7 @@ export function gdriveFormat(stream: ParsedStream): {
|
||||
name += `[P2P] `;
|
||||
}
|
||||
|
||||
name += `${stream.addon.name} ${stream.resolution}`;
|
||||
name += `${stream.addon.name} ${stream.personal ? '(Your Media) ' : ''}${stream.resolution}`;
|
||||
|
||||
let description: string = `${stream.quality !== 'Unknown' ? '🎥 ' + stream.quality + ' ' : ''}${stream.encode !== 'Unknown' ? '🎞️ ' + stream.encode : ''}`;
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ export function torboxFormat(stream: ParsedStream): {
|
||||
name += ` (P2P)`;
|
||||
}
|
||||
|
||||
name += ` (${stream.resolution})`;
|
||||
name += `${stream.personal ? '(Your Media) ' : ''}(${stream.resolution})`;
|
||||
|
||||
let description: string = '';
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@ export function torrentioFormat(stream: ParsedStream): {
|
||||
name += '[P2P] ';
|
||||
}
|
||||
|
||||
name += `${stream.addon.name} ${stream.resolution} `;
|
||||
name += `${stream.addon.name} ${stream.personal ? '(Your Media) ' : ''}${stream.resolution} `;
|
||||
|
||||
if (stream.visualTags.length > 0) {
|
||||
name += stream.visualTags.join(' | ');
|
||||
|
||||
@@ -34,6 +34,7 @@ export interface ParsedStream extends ParsedNameData {
|
||||
url?: string;
|
||||
externalUrl?: string;
|
||||
indexers?: string;
|
||||
personal?: boolean;
|
||||
stream?: {
|
||||
subtitles?: Subtitle[];
|
||||
behaviorHints?: {
|
||||
|
||||
@@ -130,7 +130,8 @@ export class BaseWrapper {
|
||||
seeders?: number,
|
||||
usenetAge?: string,
|
||||
indexer?: string,
|
||||
duration?: number
|
||||
duration?: number,
|
||||
personal?: boolean
|
||||
): ParsedStream {
|
||||
return {
|
||||
...parsedInfo,
|
||||
@@ -154,6 +155,7 @@ export class BaseWrapper {
|
||||
},
|
||||
indexers: indexer,
|
||||
duration: duration,
|
||||
personal: personal,
|
||||
stream: {
|
||||
subtitles: stream.subtitles,
|
||||
behaviorHints: {
|
||||
|
||||
@@ -46,6 +46,13 @@ export class Torbox extends BaseWrapper {
|
||||
|
||||
protected parseStream(stream: TorboxStream): ParsedStream | undefined {
|
||||
let type = stream.type;
|
||||
let personal = false;
|
||||
if (stream.name.includes('Your Media')) {
|
||||
console.log(
|
||||
`|INF| wrappers > torbox > detected personal stream in ${stream.name}`
|
||||
);
|
||||
personal = true;
|
||||
}
|
||||
const [dQuality, dFilename, dSize, dLanguage, dAgeOrSeeders] =
|
||||
stream.description.split('\n').map((field: string) => {
|
||||
if (field.startsWith('Type')) {
|
||||
@@ -126,7 +133,10 @@ export class Torbox extends BaseWrapper {
|
||||
sizeInBytes,
|
||||
provider,
|
||||
seeders,
|
||||
age
|
||||
age,
|
||||
undefined,
|
||||
undefined,
|
||||
personal
|
||||
);
|
||||
|
||||
return parsedStream;
|
||||
|
||||
Reference in New Issue
Block a user