Get YT
This commit is contained in:
parent
2af9a5a902
commit
bede398f0a
3 changed files with 118 additions and 3 deletions
|
@ -1,7 +1,8 @@
|
|||
const path = require('path'),
|
||||
fs = require('fs'),
|
||||
WebSocket = require('ws'),
|
||||
minify = require('minify-html')
|
||||
minify = require('minify-html'),
|
||||
ytjs = require('youtubei.js')
|
||||
|
||||
var config = JSON.parse(fs.readFileSync(path.join(__dirname, 'config.json')))
|
||||
|
||||
|
@ -9,12 +10,24 @@ var highlightedWords = config.highlightedWords
|
|||
var quotes = config.quotes
|
||||
var titles = config.titles
|
||||
|
||||
var mostRecentVideo = undefined
|
||||
|
||||
var commitCount = "300+"
|
||||
|
||||
var lanyardData = undefined
|
||||
|
||||
var uptime = Date.now()
|
||||
|
||||
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
|
||||
}
|
||||
|
||||
getMostRecentVid()
|
||||
|
||||
function converter(html) {
|
||||
if (lanyardData) {
|
||||
var statusData = config.discStatuses[lanyardData.discord_status]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue