Moving stuff

This commit is contained in:
Bingus_Violet 2024-02-13 13:21:53 -06:00
parent bede398f0a
commit a66a3a9198
2 changed files with 15 additions and 15 deletions

View file

@ -1,7 +1,8 @@
const express = require('express'),
path = require('path'),
fs = require('fs'),
pageUpdater = require('./pageUpdater.js')
pageUpdater = require('./pageUpdater.js'),
ytjs = require("youtubei.js")
var app = express()
@ -9,6 +10,7 @@ const PORT = process.env.PORT || 8080
const staticpath = path.join(__dirname, 'static')
var mostRecentVideo = undefined
var lanyardData = undefined
var config = JSON.parse(fs.readFileSync(path.join(__dirname, 'config.json')))
@ -22,6 +24,17 @@ function getThumbor() {
return thumborInstances[thumbCount % thumborInstances.length] + "unsafe"
}
async function getMostRecentVid() {
innertube = await ytjs.Innertube.create()
var video = await (await (await ytjs.Innertube.create()).getChannel('UChcrBJNJLZucy3TPyGyAY2g'))
video = video.current_tab.content.contents[1].contents[0].content.items[0]
mostRecentVideo = video.endpoint.payload.videoId
console.log(mostRecentVideo)
}
getMostRecentVid()
app.listen(PORT, () => {
console.log("Violet's Purgatory is now listening on port: " + PORT)
})