mirror of
https://github.com/Viren070/AIOStreams.git
synced 2025-12-01 23:14:04 +01:00
32 lines
864 B
TypeScript
32 lines
864 B
TypeScript
export * from './base';
|
|
export * from './utils';
|
|
export * from './stremthru';
|
|
export * from './torbox';
|
|
|
|
import { ServiceId } from '../utils';
|
|
import { DebridService, DebridServiceConfig } from './base';
|
|
import { StremThruInterface } from './stremthru';
|
|
import { TorboxDebridService } from './torbox';
|
|
import { StremThruPreset } from '../presets/stremthru';
|
|
|
|
export function getDebridService(
|
|
serviceName: ServiceId,
|
|
token: string,
|
|
clientIp?: string
|
|
): DebridService {
|
|
const config: DebridServiceConfig = {
|
|
token,
|
|
clientIp,
|
|
};
|
|
|
|
switch (serviceName) {
|
|
case 'torbox':
|
|
return new TorboxDebridService(config);
|
|
default:
|
|
if (StremThruPreset.supportedServices.includes(serviceName)) {
|
|
return new StremThruInterface({ ...config, serviceName });
|
|
}
|
|
throw new Error(`Unknown debrid service: ${serviceName}`);
|
|
}
|
|
}
|