diff --git a/src/config.ts b/src/config.ts index 83e2fa1..ce6265e 100644 --- a/src/config.ts +++ b/src/config.ts @@ -195,7 +195,12 @@ addDefaults(config, { useCacheForSegmentGroups: false, maxConnections: 100, maxResponseTime: 1000, - maxResponseTimeWhileLoadingCache: 2000 + maxResponseTimeWhileLoadingCache: 2000, + etagExpiry: 5000, + youTubeKeys: { + visitorData: null, + poToken: null + } }); loadFromEnv(config); migrate(config); diff --git a/src/types/config.model.ts b/src/types/config.model.ts index da33810..43041cc 100644 --- a/src/types/config.model.ts +++ b/src/types/config.model.ts @@ -109,6 +109,11 @@ export interface SBSConfig { maxConnections: number; maxResponseTime: number; maxResponseTimeWhileLoadingCache: number; + etagExpiry: number; + youTubeKeys: { + visitorData: string | null; + poToken: string | null; + } } export interface WebhookConfig { diff --git a/src/utils/innerTubeAPI.ts b/src/utils/innerTubeAPI.ts index 1d75ccc..be7cd9e 100644 --- a/src/utils/innerTubeAPI.ts +++ b/src/utils/innerTubeAPI.ts @@ -2,6 +2,7 @@ import axios from "axios"; import { Logger } from "./logger"; import { innerTubeVideoDetails } from "../types/innerTubeApi.model"; import DiskCache from "./diskCache"; +import { config } from "../config"; const privateResponse = (videoId: string, reason: string): innerTubeVideoDetails => ({ videoId, @@ -34,13 +35,20 @@ export async function getFromITube (videoID: string): Promise