mirror of
https://github.com/Viren070/AIOStreams.git
synced 2025-12-01 23:14:04 +01:00
feat: adjust default timeout env var behaviour so that DEFAULT_TIMEOUT appplies to all timeouts unless overriden by addon specific env var timeout
This commit is contained in:
@@ -917,11 +917,11 @@ export class AIOStreams {
|
||||
const wrapper = new BaseWrapper(
|
||||
addon.options.overrideName || 'GDrive',
|
||||
addon.options.addonUrl,
|
||||
addonId,
|
||||
this.config,
|
||||
addon.options.indexerTimeout
|
||||
? parseInt(addon.options.indexerTimeout)
|
||||
: undefined,
|
||||
addonId,
|
||||
this.config
|
||||
: Settings.DEFAULT_GDRIVE_TIMEOUT
|
||||
);
|
||||
return await wrapper.getParsedStreams(streamRequest);
|
||||
}
|
||||
@@ -934,11 +934,11 @@ export class AIOStreams {
|
||||
const wrapper = new BaseWrapper(
|
||||
addon.options.name || 'Custom',
|
||||
addon.options.url.trim(),
|
||||
addonId,
|
||||
this.config,
|
||||
addon.options.indexerTimeout
|
||||
? parseInt(addon.options.indexerTimeout)
|
||||
: undefined,
|
||||
addonId,
|
||||
this.config
|
||||
: undefined
|
||||
);
|
||||
return await wrapper.getParsedStreams(streamRequest);
|
||||
}
|
||||
|
||||
@@ -71,47 +71,51 @@ export class Settings {
|
||||
public static readonly DEFAULT_TORRENTIO_TIMEOUT = process.env
|
||||
.DEFAULT_TORRENTIO_TIMEOUT
|
||||
? parseInt(process.env.DEFAULT_TORRENTIO_TIMEOUT)
|
||||
: 5000;
|
||||
: undefined;
|
||||
public static readonly DEFAULT_TORBOX_TIMEOUT = process.env
|
||||
.DEFAULT_TORBOX_TIMEOUT
|
||||
? parseInt(process.env.DEFAULT_TORBOX_TIMEOUT)
|
||||
: 15000;
|
||||
: undefined;
|
||||
public static readonly DEFAULT_COMET_TIMEOUT = process.env
|
||||
.DEFAULT_COMET_TIMEOUT
|
||||
? parseInt(process.env.DEFAULT_COMET_TIMEOUT)
|
||||
: 15000;
|
||||
: undefined;
|
||||
public static readonly DEFAULT_MEDIAFUSION_TIMEOUT = process.env
|
||||
.DEFAULT_MEDIAFUSION_TIMEOUT
|
||||
? parseInt(process.env.DEFAULT_MEDIAFUSION_TIMEOUT)
|
||||
: 15000;
|
||||
: undefined;
|
||||
public static readonly DEFAULT_JACKETTIO_TIMEOUT = process.env
|
||||
.DEFAULT_JACKETTIO_TIMEOUT
|
||||
? parseInt(process.env.DEFAULT_JACKETTIO_TIMEOUT)
|
||||
: 15000;
|
||||
: undefined;
|
||||
public static readonly DEFAULT_ORION_TIMEOUT = process.env
|
||||
.DEFAULT_ORION_TIMEOUT
|
||||
? parseInt(process.env.DEFAULT_ORION_TIMEOUT)
|
||||
: 15000;
|
||||
: undefined;
|
||||
public static readonly DEFAULT_PEERFLIX_TIMEOUT = process.env
|
||||
.DEFAULT_PEERFLIX_TIMEOUT
|
||||
? parseInt(process.env.DEFAULT_PEERFLIX_TIMEOUT)
|
||||
: 15000;
|
||||
: undefined;
|
||||
public static readonly DEFAULT_EASYNEWS_TIMEMOUT = process.env
|
||||
.DEFAULT_EASYNEWS_TIMEMOUT
|
||||
? parseInt(process.env.DEFAULT_EASYNEWS_TIMEMOUT)
|
||||
: 15000;
|
||||
: undefined;
|
||||
public static readonly DEFAULT_EASYNEWS_PLUS_TIMEMOUT = process.env
|
||||
.DEFAULT_EASYNEWS_PLUS_TIMEMOUT
|
||||
? parseInt(process.env.DEFAULT_EASYNEWS_PLUS_TIMEMOUT)
|
||||
: 15000;
|
||||
: undefined;
|
||||
public static readonly DEFAULT_DEBRIDIO_TIMEOUT = process.env
|
||||
.DEFAULT_DEBRIDIO_TIMEOUT
|
||||
? parseInt(process.env.DEFAULT_DEBRIDIO_TIMEOUT)
|
||||
: 15000;
|
||||
: undefined;
|
||||
public static readonly DEFAULT_DMM_CAST_TIMEOUT = process.env
|
||||
.DEFAULT_DMM_CAST_TIMEOUT
|
||||
? parseInt(process.env.DEFAULT_DMM_CAST_TIMEOUT)
|
||||
: 15000;
|
||||
: undefined;
|
||||
public static readonly DEFAULT_GDRIVE_TIMEOUT = process.env
|
||||
.DEFAULT_GDRIVE_TIMEOUT
|
||||
? parseInt(process.env.DEFAULT_GDRIVE_TIMEOUT)
|
||||
: undefined;
|
||||
public static readonly SHOW_DIE = process.env.SHOW_DIE
|
||||
? process.env.SHOW_DIE === 'true'
|
||||
: false;
|
||||
|
||||
@@ -24,15 +24,15 @@ export class BaseWrapper {
|
||||
constructor(
|
||||
addonName: string,
|
||||
addonUrl: string,
|
||||
indexerTimeout: number = Settings.DEFAULT_TIMEOUT,
|
||||
addonId: string,
|
||||
userConfig: Config
|
||||
userConfig: Config,
|
||||
indexerTimeout?: number
|
||||
) {
|
||||
this.addonName = addonName;
|
||||
this.addonUrl = this.standardizeManifestUrl(addonUrl);
|
||||
this.addonId = addonId;
|
||||
this.indexerTimeout = indexerTimeout || 3000;
|
||||
this.userConfig = userConfig;
|
||||
(this.indexerTimeout = indexerTimeout || Settings.DEFAULT_TIMEOUT),
|
||||
(this.userConfig = userConfig);
|
||||
}
|
||||
|
||||
protected standardizeManifestUrl(url: string): string {
|
||||
@@ -98,7 +98,7 @@ export class BaseWrapper {
|
||||
const urlParts = url.split('/');
|
||||
const sanitisedUrl = `${urlParts[0]}//${urlParts[2]}/*************/${urlParts.slice(-3).join('/')}`;
|
||||
console.log(
|
||||
`|INF| wrappers > base > ${this.addonName}: GET ${sanitisedUrl}`
|
||||
`|INF| wrappers > base > ${this.addonName}: Fetching with timeout ${this.indexerTimeout}ms from ${sanitisedUrl}`
|
||||
);
|
||||
let response;
|
||||
try {
|
||||
|
||||
@@ -14,16 +14,22 @@ export class Comet extends BaseWrapper {
|
||||
constructor(
|
||||
configString: string | null,
|
||||
overrideUrl: string | null,
|
||||
indexerTimeout: number = Settings.DEFAULT_COMET_TIMEOUT,
|
||||
addonName: string = 'Comet',
|
||||
addonId: string,
|
||||
userConfig: Config
|
||||
userConfig: Config,
|
||||
indexerTimeout?: number
|
||||
) {
|
||||
let url = overrideUrl
|
||||
? overrideUrl
|
||||
: Settings.COMET_URL + (configString ? configString + '/' : '');
|
||||
|
||||
super(addonName, url, indexerTimeout, addonId, userConfig);
|
||||
super(
|
||||
addonName,
|
||||
url,
|
||||
addonId,
|
||||
userConfig,
|
||||
indexerTimeout || Settings.DEFAULT_COMET_TIMEOUT
|
||||
);
|
||||
}
|
||||
|
||||
protected parseStream(stream: CometStream): ParsedStream {
|
||||
@@ -107,10 +113,10 @@ export async function getCometStreams(
|
||||
const comet = new Comet(
|
||||
null,
|
||||
cometOptions.overrideUrl as string,
|
||||
indexerTimeout,
|
||||
cometOptions.overrideName,
|
||||
addonId,
|
||||
config
|
||||
config,
|
||||
indexerTimeout
|
||||
);
|
||||
return comet.getParsedStreams(streamRequest);
|
||||
}
|
||||
@@ -160,10 +166,10 @@ export async function getCometStreams(
|
||||
const comet = new Comet(
|
||||
configString,
|
||||
null,
|
||||
indexerTimeout,
|
||||
cometOptions.overrideName,
|
||||
addonId,
|
||||
config
|
||||
config,
|
||||
indexerTimeout
|
||||
);
|
||||
|
||||
return comet.getParsedStreams(streamRequest);
|
||||
@@ -183,10 +189,10 @@ export async function getCometStreams(
|
||||
const comet = new Comet(
|
||||
configString,
|
||||
null,
|
||||
indexerTimeout,
|
||||
cometOptions.overrideName,
|
||||
addonId,
|
||||
config
|
||||
config,
|
||||
indexerTimeout
|
||||
);
|
||||
return comet.getParsedStreams(streamRequest);
|
||||
});
|
||||
|
||||
@@ -10,16 +10,22 @@ export class Debridio extends BaseWrapper {
|
||||
constructor(
|
||||
configString: string | null,
|
||||
overrideUrl: string | null,
|
||||
indexerTimeout: number = Settings.DEFAULT_DEBRIDIO_TIMEOUT,
|
||||
addonName: string = 'Debridio',
|
||||
addonId: string,
|
||||
userConfig: Config
|
||||
userConfig: Config,
|
||||
indexerTimeout?: number
|
||||
) {
|
||||
let url = overrideUrl
|
||||
? overrideUrl
|
||||
: Settings.DEBRIDIO_URL + (configString ? configString + '/' : '');
|
||||
|
||||
super(addonName, url, indexerTimeout, addonId, userConfig);
|
||||
super(
|
||||
addonName,
|
||||
url,
|
||||
addonId,
|
||||
userConfig,
|
||||
indexerTimeout || Settings.DEFAULT_DEBRIDIO_TIMEOUT
|
||||
);
|
||||
}
|
||||
|
||||
protected parseStream(stream: Stream): ParsedStream {
|
||||
@@ -118,10 +124,10 @@ export async function getDebridioStreams(
|
||||
const debridio = new Debridio(
|
||||
null,
|
||||
debridioOptions.overrideUrl as string,
|
||||
indexerTimeout,
|
||||
debridioOptions.overrideName,
|
||||
addonId,
|
||||
config
|
||||
config,
|
||||
indexerTimeout
|
||||
);
|
||||
return debridio.getParsedStreams(streamRequest);
|
||||
}
|
||||
@@ -170,10 +176,10 @@ export async function getDebridioStreams(
|
||||
const debridio = new Debridio(
|
||||
debridioConfigString,
|
||||
null,
|
||||
indexerTimeout,
|
||||
debridioOptions.overrideName,
|
||||
addonId,
|
||||
config
|
||||
config,
|
||||
indexerTimeout
|
||||
);
|
||||
|
||||
return debridio.getParsedStreams(streamRequest);
|
||||
@@ -193,10 +199,10 @@ export async function getDebridioStreams(
|
||||
const debridio = new Debridio(
|
||||
debridioConfigString,
|
||||
null,
|
||||
indexerTimeout,
|
||||
debridioOptions.overrideName,
|
||||
addonId,
|
||||
config
|
||||
config,
|
||||
indexerTimeout
|
||||
);
|
||||
return debridio.getParsedStreams(streamRequest);
|
||||
});
|
||||
|
||||
@@ -16,10 +16,16 @@ export class DMMCast extends BaseWrapper {
|
||||
installationUrl: string,
|
||||
addonId: string,
|
||||
userConfig: Config,
|
||||
indexerTimeout: number = Settings.DEFAULT_DMM_CAST_TIMEOUT,
|
||||
addonName: string = 'DMM Cast'
|
||||
addonName: string = 'DMM Cast',
|
||||
indexerTimeout?: number
|
||||
) {
|
||||
super(addonName, installationUrl, indexerTimeout, addonId, userConfig);
|
||||
super(
|
||||
addonName,
|
||||
installationUrl,
|
||||
addonId,
|
||||
userConfig,
|
||||
indexerTimeout || Settings.DEFAULT_DMM_CAST_TIMEOUT
|
||||
);
|
||||
}
|
||||
|
||||
protected parseStream(stream: Stream): ParsedStream {
|
||||
@@ -74,8 +80,10 @@ export async function getDMMCastStreams(
|
||||
dmmCastOptions.installationUrl,
|
||||
addonId,
|
||||
config,
|
||||
parseInt(dmmCastOptions.indexerTimeout || '0'),
|
||||
dmmCastOptions.overrideName
|
||||
dmmCastOptions.overrideName,
|
||||
dmmCastOptions.indexerTimeout
|
||||
? parseInt(dmmCastOptions.indexerTimeout)
|
||||
: undefined
|
||||
);
|
||||
return dmmCast.getParsedStreams(streamRequest);
|
||||
}
|
||||
|
||||
@@ -13,16 +13,22 @@ export class Easynews extends BaseWrapper {
|
||||
constructor(
|
||||
configString: string | null,
|
||||
overrideUrl: string | null,
|
||||
indexerTimeout: number = Settings.DEFAULT_EASYNEWS_TIMEMOUT,
|
||||
addonName: string = 'Easynews',
|
||||
addonId: string,
|
||||
userConfig: Config
|
||||
userConfig: Config,
|
||||
indexerTimeout?: number
|
||||
) {
|
||||
let url = overrideUrl
|
||||
? overrideUrl
|
||||
: Settings.EASYNEWS_URL + (configString ? configString + '/' : '');
|
||||
|
||||
super(addonName, url, indexerTimeout, addonId, userConfig);
|
||||
super(
|
||||
addonName,
|
||||
url,
|
||||
addonId,
|
||||
userConfig,
|
||||
indexerTimeout || Settings.DEFAULT_EASYNEWS_TIMEMOUT
|
||||
);
|
||||
}
|
||||
|
||||
protected parseStream(stream: Stream): ParsedStream {
|
||||
@@ -98,12 +104,12 @@ export async function getEasynewsStreams(
|
||||
const easynews = new Easynews(
|
||||
easynewsConfigString,
|
||||
easynewsOptions.overrideUrl ?? null,
|
||||
easynewsOptions.indexerTimeout
|
||||
? parseInt(easynewsOptions.indexerTimeout)
|
||||
: undefined,
|
||||
easynewsOptions.overrideName,
|
||||
addonId,
|
||||
config
|
||||
config,
|
||||
easynewsOptions.indexerTimeout
|
||||
? parseInt(easynewsOptions.indexerTimeout)
|
||||
: undefined
|
||||
);
|
||||
|
||||
const streams = await easynews.getParsedStreams(streamRequest);
|
||||
|
||||
@@ -13,16 +13,22 @@ export class EasynewsPlus extends BaseWrapper {
|
||||
constructor(
|
||||
configString: string | null,
|
||||
overrideUrl: string | null,
|
||||
indexerTimeout: number = Settings.DEFAULT_EASYNEWS_PLUS_TIMEMOUT,
|
||||
addonName: string = 'Easynews+',
|
||||
addonId: string,
|
||||
userConfig: Config
|
||||
userConfig: Config,
|
||||
indexerTimeout?: number
|
||||
) {
|
||||
let url = overrideUrl
|
||||
? overrideUrl
|
||||
: Settings.EASYNEWS_PLUS_URL + (configString ? configString + '/' : '');
|
||||
|
||||
super(addonName, url, indexerTimeout, addonId, userConfig);
|
||||
super(
|
||||
addonName,
|
||||
url,
|
||||
addonId,
|
||||
userConfig,
|
||||
indexerTimeout || Settings.DEFAULT_EASYNEWS_PLUS_TIMEMOUT
|
||||
);
|
||||
}
|
||||
|
||||
protected parseStream(stream: Stream): ParsedStream {
|
||||
@@ -100,12 +106,12 @@ export async function getEasynewsPlusStreams(
|
||||
const easynews = new EasynewsPlus(
|
||||
easynewsPlusConfigString,
|
||||
easynewsPlusOptions.overrideUrl ?? null,
|
||||
easynewsPlusOptions.indexerTimeout
|
||||
? parseInt(easynewsPlusOptions.indexerTimeout)
|
||||
: undefined,
|
||||
easynewsPlusOptions.overrideName,
|
||||
addonId,
|
||||
config
|
||||
config,
|
||||
easynewsPlusOptions.indexerTimeout
|
||||
? parseInt(easynewsPlusOptions.indexerTimeout)
|
||||
: undefined
|
||||
);
|
||||
|
||||
const streams = await easynews.getParsedStreams(streamRequest);
|
||||
|
||||
@@ -13,16 +13,22 @@ export class Jackettio extends BaseWrapper {
|
||||
constructor(
|
||||
configString: string | null,
|
||||
overrideUrl: string | null,
|
||||
indexerTimeout: number = Settings.DEFAULT_JACKETTIO_TIMEOUT,
|
||||
addonName: string = 'Jackettio',
|
||||
addonId: string,
|
||||
userConfig: Config
|
||||
userConfig: Config,
|
||||
indexerTimeout?: number
|
||||
) {
|
||||
let url = overrideUrl
|
||||
? overrideUrl
|
||||
: Settings.JACKETTIO_URL + (configString ? configString + '/' : '');
|
||||
|
||||
super(addonName, url, indexerTimeout, addonId, userConfig);
|
||||
super(
|
||||
addonName,
|
||||
url,
|
||||
addonId,
|
||||
userConfig,
|
||||
indexerTimeout || Settings.DEFAULT_JACKETTIO_TIMEOUT
|
||||
);
|
||||
}
|
||||
|
||||
protected parseStream(stream: Stream): ParsedStream {
|
||||
@@ -142,10 +148,10 @@ export async function getJackettioStreams(
|
||||
const jackettio = new Jackettio(
|
||||
null,
|
||||
jackettioOptions.overrideUrl as string,
|
||||
indexerTimeout,
|
||||
jackettioOptions.overrideName,
|
||||
addonId,
|
||||
config
|
||||
config,
|
||||
indexerTimeout
|
||||
);
|
||||
return jackettio.getParsedStreams(streamRequest);
|
||||
}
|
||||
@@ -194,10 +200,10 @@ export async function getJackettioStreams(
|
||||
const jackettio = new Jackettio(
|
||||
configString,
|
||||
null,
|
||||
indexerTimeout,
|
||||
jackettioOptions.overrideName,
|
||||
addonId,
|
||||
config
|
||||
config,
|
||||
indexerTimeout
|
||||
);
|
||||
|
||||
return jackettio.getParsedStreams(streamRequest);
|
||||
@@ -217,10 +223,10 @@ export async function getJackettioStreams(
|
||||
const jackettio = new Jackettio(
|
||||
configString,
|
||||
null,
|
||||
indexerTimeout,
|
||||
jackettioOptions.overrideName,
|
||||
addonId,
|
||||
config
|
||||
config,
|
||||
indexerTimeout
|
||||
);
|
||||
return jackettio.getParsedStreams(streamRequest);
|
||||
});
|
||||
|
||||
@@ -9,16 +9,22 @@ export class MediaFusion extends BaseWrapper {
|
||||
constructor(
|
||||
configString: string | null,
|
||||
overrideUrl: string | null,
|
||||
indexerTimeout: number = Settings.DEFAULT_MEDIAFUSION_TIMEOUT,
|
||||
addonName: string = 'MediaFusion',
|
||||
addonId: string,
|
||||
userConfig: Config
|
||||
userConfig: Config,
|
||||
indexerTimeout?: number
|
||||
) {
|
||||
let url = overrideUrl
|
||||
? overrideUrl
|
||||
: Settings.MEDIAFUSION_URL + (configString ? configString + '/' : '');
|
||||
|
||||
super(addonName, url, indexerTimeout, addonId, userConfig);
|
||||
super(
|
||||
addonName,
|
||||
url,
|
||||
addonId,
|
||||
userConfig,
|
||||
indexerTimeout || Settings.DEFAULT_MEDIAFUSION_TIMEOUT
|
||||
);
|
||||
}
|
||||
|
||||
protected parseStream(stream: Stream): ParsedStream {
|
||||
@@ -116,10 +122,10 @@ export async function getMediafusionStreams(
|
||||
const mediafusion = new MediaFusion(
|
||||
null,
|
||||
mediafusionOptions.overrideUrl as string,
|
||||
indexerTimeout,
|
||||
mediafusionOptions.overrideName,
|
||||
addonId,
|
||||
config
|
||||
config,
|
||||
indexerTimeout
|
||||
);
|
||||
return mediafusion.getParsedStreams(streamRequest);
|
||||
}
|
||||
@@ -140,10 +146,10 @@ export async function getMediafusionStreams(
|
||||
const mediafusion = new MediaFusion(
|
||||
configString,
|
||||
null,
|
||||
indexerTimeout,
|
||||
mediafusionOptions.overrideName,
|
||||
addonId,
|
||||
config
|
||||
config,
|
||||
indexerTimeout
|
||||
);
|
||||
return mediafusion.getParsedStreams(streamRequest);
|
||||
}
|
||||
@@ -184,10 +190,10 @@ export async function getMediafusionStreams(
|
||||
const mediafusion = new MediaFusion(
|
||||
encryptedStr,
|
||||
null,
|
||||
indexerTimeout,
|
||||
mediafusionOptions.overrideName,
|
||||
addonId,
|
||||
config
|
||||
config,
|
||||
indexerTimeout
|
||||
);
|
||||
|
||||
return mediafusion.getParsedStreams(streamRequest);
|
||||
@@ -209,10 +215,10 @@ export async function getMediafusionStreams(
|
||||
const mediafusion = new MediaFusion(
|
||||
encryptedStr,
|
||||
null,
|
||||
indexerTimeout,
|
||||
mediafusionOptions.overrideName,
|
||||
addonId,
|
||||
config
|
||||
config,
|
||||
indexerTimeout
|
||||
);
|
||||
return mediafusion.getParsedStreams(streamRequest);
|
||||
});
|
||||
|
||||
@@ -11,17 +11,23 @@ export class OrionStremioAddon extends BaseWrapper {
|
||||
constructor(
|
||||
configString: string | null,
|
||||
overrideUrl: string | null,
|
||||
indexerTimeout: number = Settings.DEFAULT_ORION_TIMEOUT,
|
||||
addonName: string = 'Orion',
|
||||
addonId: string,
|
||||
userConfig: Config
|
||||
userConfig: Config,
|
||||
indexerTimeout?: number
|
||||
) {
|
||||
let url = overrideUrl
|
||||
? overrideUrl
|
||||
: Settings.ORION_STREMIO_ADDON_URL +
|
||||
(configString ? configString + '/' : '');
|
||||
|
||||
super(addonName, url, indexerTimeout, addonId, userConfig);
|
||||
super(
|
||||
addonName,
|
||||
url,
|
||||
addonId,
|
||||
userConfig,
|
||||
indexerTimeout || Settings.DEFAULT_ORION_TIMEOUT
|
||||
);
|
||||
}
|
||||
|
||||
protected parseStream(stream: Stream): ParsedStream {
|
||||
@@ -130,11 +136,11 @@ export async function getOrionStreams(
|
||||
if (orionOptions.overrideUrl) {
|
||||
const orion = new OrionStremioAddon(
|
||||
null,
|
||||
orionOptions.overrideUrl as string,
|
||||
indexerTimeout,
|
||||
orionOptions.overrideUrl,
|
||||
orionOptions.overrideName,
|
||||
addonId,
|
||||
config
|
||||
config,
|
||||
indexerTimeout
|
||||
);
|
||||
return orion.getParsedStreams(streamRequest);
|
||||
}
|
||||
@@ -155,10 +161,10 @@ export async function getOrionStreams(
|
||||
const orion = new OrionStremioAddon(
|
||||
configString,
|
||||
null,
|
||||
indexerTimeout,
|
||||
orionOptions.overrideName,
|
||||
addonId,
|
||||
config
|
||||
config,
|
||||
indexerTimeout
|
||||
);
|
||||
return await orion.getParsedStreams(streamRequest);
|
||||
}
|
||||
@@ -177,10 +183,10 @@ export async function getOrionStreams(
|
||||
const orion = new OrionStremioAddon(
|
||||
configString,
|
||||
null,
|
||||
indexerTimeout,
|
||||
orionOptions.overrideName,
|
||||
addonId,
|
||||
config
|
||||
config,
|
||||
indexerTimeout
|
||||
);
|
||||
return await orion.getParsedStreams(streamRequest);
|
||||
}
|
||||
|
||||
@@ -17,16 +17,22 @@ export class Peerflix extends BaseWrapper {
|
||||
constructor(
|
||||
configString: string | null,
|
||||
overrideUrl: string | null,
|
||||
indexerTimeout: number = Settings.DEFAULT_PEERFLIX_TIMEOUT,
|
||||
addonName: string = 'Peerflix',
|
||||
addonId: string,
|
||||
userConfig: Config
|
||||
userConfig: Config,
|
||||
indexerTimeout?: number
|
||||
) {
|
||||
let url = overrideUrl
|
||||
? overrideUrl
|
||||
: Settings.PEERFLIX_URL + (configString ? configString + '/' : '');
|
||||
|
||||
super(addonName, url, indexerTimeout, addonId, userConfig);
|
||||
super(
|
||||
addonName,
|
||||
url,
|
||||
addonId,
|
||||
userConfig,
|
||||
indexerTimeout || Settings.DEFAULT_PEERFLIX_TIMEOUT
|
||||
);
|
||||
}
|
||||
|
||||
protected parseStream(stream: PeerflixStream): ParsedStream {
|
||||
@@ -103,10 +109,10 @@ export async function getPeerflixStreams(
|
||||
const peerflix = new Peerflix(
|
||||
null,
|
||||
peerflixOptions.overrideUrl as string,
|
||||
indexerTimeout,
|
||||
peerflixOptions.overrideName,
|
||||
addonId,
|
||||
config
|
||||
config,
|
||||
indexerTimeout
|
||||
);
|
||||
return peerflix.getParsedStreams(streamRequest);
|
||||
}
|
||||
@@ -124,10 +130,10 @@ export async function getPeerflixStreams(
|
||||
const peerflix = new Peerflix(
|
||||
null,
|
||||
null,
|
||||
indexerTimeout,
|
||||
peerflixOptions.overrideName,
|
||||
addonId,
|
||||
config
|
||||
config,
|
||||
indexerTimeout
|
||||
);
|
||||
return await peerflix.getParsedStreams(streamRequest);
|
||||
}
|
||||
@@ -161,10 +167,10 @@ export async function getPeerflixStreams(
|
||||
const peerflix = new Peerflix(
|
||||
configString,
|
||||
null,
|
||||
indexerTimeout,
|
||||
peerflixOptions.overrideName,
|
||||
addonId,
|
||||
config
|
||||
config,
|
||||
indexerTimeout
|
||||
);
|
||||
return await peerflix.getParsedStreams(streamRequest);
|
||||
});
|
||||
@@ -186,10 +192,10 @@ export async function getPeerflixStreams(
|
||||
const peerflix = new Peerflix(
|
||||
configString,
|
||||
null,
|
||||
indexerTimeout,
|
||||
peerflixOptions.overrideName,
|
||||
addonId,
|
||||
config
|
||||
config,
|
||||
indexerTimeout
|
||||
);
|
||||
return await peerflix.getParsedStreams(streamRequest);
|
||||
}
|
||||
|
||||
@@ -30,17 +30,17 @@ interface TorboxStream extends Stream {
|
||||
export class Torbox extends BaseWrapper {
|
||||
constructor(
|
||||
apiKey: string,
|
||||
indexerTimeout: number = Settings.DEFAULT_TORBOX_TIMEOUT,
|
||||
addonName: string = 'Torbox',
|
||||
addonId: string,
|
||||
userConfig: Config
|
||||
userConfig: Config,
|
||||
indexerTimeout?: number
|
||||
) {
|
||||
super(
|
||||
addonName,
|
||||
Settings.TORBOX_STREMIO_URL + apiKey + '/',
|
||||
indexerTimeout,
|
||||
addonId,
|
||||
userConfig
|
||||
userConfig,
|
||||
indexerTimeout || Settings.DEFAULT_TORBOX_TIMEOUT
|
||||
);
|
||||
}
|
||||
|
||||
@@ -172,12 +172,12 @@ export async function getTorboxStreams(
|
||||
|
||||
const torbox = new Torbox(
|
||||
torboxApiKey,
|
||||
torboxOptions.indexerTimeout
|
||||
? parseInt(torboxOptions.indexerTimeout)
|
||||
: undefined,
|
||||
torboxOptions.overrideName,
|
||||
addonId,
|
||||
config
|
||||
config,
|
||||
torboxOptions.indexerTimeout
|
||||
? parseInt(torboxOptions.indexerTimeout)
|
||||
: undefined
|
||||
);
|
||||
return await torbox.getParsedStreams(streamRequest);
|
||||
}
|
||||
|
||||
@@ -10,16 +10,22 @@ export class Torrentio extends BaseWrapper {
|
||||
constructor(
|
||||
configString: string | null,
|
||||
overrideUrl: string | null,
|
||||
indexerTimeout: number = Settings.DEFAULT_TORRENTIO_TIMEOUT,
|
||||
addonName: string = 'Torrentio',
|
||||
addonId: string,
|
||||
userConfig: Config
|
||||
userConfig: Config,
|
||||
indexerTimeout?: number
|
||||
) {
|
||||
let url = overrideUrl
|
||||
? overrideUrl
|
||||
: Settings.TORRENTIO_URL + (configString ? configString + '/' : '');
|
||||
|
||||
super(addonName, url, indexerTimeout, addonId, userConfig);
|
||||
super(
|
||||
addonName,
|
||||
url,
|
||||
addonId,
|
||||
userConfig,
|
||||
indexerTimeout || Settings.DEFAULT_TORRENTIO_TIMEOUT
|
||||
);
|
||||
}
|
||||
|
||||
protected parseStream(stream: Stream): ParsedStream {
|
||||
@@ -112,10 +118,10 @@ export async function getTorrentioStreams(
|
||||
const torrentio = new Torrentio(
|
||||
null,
|
||||
torrentioOptions.overrideUrl as string,
|
||||
indexerTimeout,
|
||||
torrentioOptions.overrideName,
|
||||
addonId,
|
||||
config
|
||||
config,
|
||||
indexerTimeout
|
||||
);
|
||||
return torrentio.getParsedStreams(streamRequest);
|
||||
}
|
||||
@@ -130,10 +136,10 @@ export async function getTorrentioStreams(
|
||||
const torrentio = new Torrentio(
|
||||
null,
|
||||
null,
|
||||
indexerTimeout,
|
||||
torrentioOptions.overrideName,
|
||||
addonId,
|
||||
config
|
||||
config,
|
||||
indexerTimeout
|
||||
);
|
||||
return await torrentio.getParsedStreams(streamRequest);
|
||||
}
|
||||
@@ -159,10 +165,10 @@ export async function getTorrentioStreams(
|
||||
const torrentio = new Torrentio(
|
||||
configString,
|
||||
null,
|
||||
indexerTimeout,
|
||||
torrentioOptions.overrideName,
|
||||
addonId,
|
||||
config
|
||||
config,
|
||||
indexerTimeout
|
||||
);
|
||||
return await torrentio.getParsedStreams(streamRequest);
|
||||
});
|
||||
@@ -180,10 +186,10 @@ export async function getTorrentioStreams(
|
||||
const torrentio = new Torrentio(
|
||||
configString,
|
||||
null,
|
||||
indexerTimeout,
|
||||
torrentioOptions.overrideName,
|
||||
addonId,
|
||||
config
|
||||
config,
|
||||
indexerTimeout
|
||||
);
|
||||
return await torrentio.getParsedStreams(streamRequest);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user