AAAAAAAAAAA, im going to aaaa

This commit is contained in:
localhost 2025-09-24 20:51:13 +02:00
parent 0da18c1feb
commit b0a9d75a14
4 changed files with 9 additions and 5 deletions

4
config.json Normal file
View File

@ -0,0 +1,4 @@
{
"whitelist": [],
"player_id": "0004de42"
}

View File

@ -165,11 +165,11 @@ app.ws('/download/:id', async (ws, req) => {
const { streamResults } = await createSabrStream(req.params.id, streamOptions);
const { videoStream, audioStream, selectedFormats } = streamResults;
const whitelistedVideos = JSON.parse(fs.readFileSync('./whitelist.json', 'utf-8'))
const config = await Bun.file('config.json').json()
const videoSizeTotal = (selectedFormats.audioFormat.contentLength || 0)
+ (selectedFormats.videoFormat.contentLength || 0)
if (videoSizeTotal > (1_048_576 * 150) && !whitelistedVideos.includes(req.params.id)) {
if (videoSizeTotal > (1_048_576 * 150) && !config.whitelist.includes(req.params.id)) {
ws.send('Is this content considered high risk? If so, please email me at admin@preservetube.com.');
ws.send('This video is too large, and unfortunately, Preservetube does not have unlimited storage.');
return ws.close()
@ -325,5 +325,5 @@ setInterval(switchIps, 30 * 60000) // 30 minutes
app.listen(8008, () => {
console.log('the metadata server is up.')
switchIps()
// switchIps()
})

View File

@ -123,7 +123,8 @@ export async function createSabrStream(
innertube: Innertube;
streamResults: StreamResults;
}> {
const innertube = await Innertube.create({ cache: new UniversalCache(true) });
const json = await Bun.file('config.json').json()
const innertube = await Innertube.create({ cache: new UniversalCache(true), player_id: json.player_id });
const webPoTokenResult = await generateWebPoToken(innertube.session.context.client.visitorData || '');
console.log(`debugging -> ${JSON.stringify(webPoTokenResult)}, ${videoId}`)

View File

@ -1 +0,0 @@
["kgcYykfZOs8"]