mirror of
https://codeberg.org/ashley/poke.git
synced 2024-11-22 21:17:58 +01:00
update stuff :p
This commit is contained in:
parent
a0215abb1e
commit
c90622a3b9
1 changed files with 7 additions and 3 deletions
|
@ -19,6 +19,8 @@ const fetcher = require("../libpoketube/libpoketube-fetcher.js");
|
||||||
const getColors = require("get-image-colors");
|
const getColors = require("get-image-colors");
|
||||||
|
|
||||||
const wiki = require("wikipedia");
|
const wiki = require("wikipedia");
|
||||||
|
const sqp =
|
||||||
|
"-oaymwEbCKgBEF5IVfKriqkDDggBFQAAiEIYAXABwAEG&rs=AOn4CLBy_x4UUHLNDZtJtH0PXeQGoRFTgw";
|
||||||
|
|
||||||
const config = {
|
const config = {
|
||||||
tubeApi: "https://tube-srv.ashley143.gay/api/",
|
tubeApi: "https://tube-srv.ashley143.gay/api/",
|
||||||
|
@ -69,6 +71,7 @@ async function video(v) {
|
||||||
|
|
||||||
let nightlyRes;
|
let nightlyRes;
|
||||||
var desc = "";
|
var desc = "";
|
||||||
|
|
||||||
try {
|
try {
|
||||||
var inv_comments = await fetch(`${config.invapi}/comments/${v}`).then(
|
var inv_comments = await fetch(`${config.invapi}/comments/${v}`).then(
|
||||||
(res) => res.text()
|
(res) => res.text()
|
||||||
|
@ -78,6 +81,7 @@ async function video(v) {
|
||||||
} catch {
|
} catch {
|
||||||
var comments = "";
|
var comments = "";
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
var video_new_info = await fetch(`${config.invapi}/videos/${v}`).then(
|
var video_new_info = await fetch(`${config.invapi}/videos/${v}`).then(
|
||||||
(res) => res.text()
|
(res) => res.text()
|
||||||
|
@ -114,7 +118,7 @@ async function video(v) {
|
||||||
const nightlyJsonData = getJson(nightlyRes);
|
const nightlyJsonData = getJson(nightlyRes);
|
||||||
|
|
||||||
return {
|
return {
|
||||||
json: data.video.Player,
|
json: data?.video?.Player,
|
||||||
video: await fetch(`${config.tubeApi}video?v=${v}`)
|
video: await fetch(`${config.tubeApi}video?v=${v}`)
|
||||||
.then((res) => res.text())
|
.then((res) => res.text())
|
||||||
.then((xml) => getJson(toJson(xml))),
|
.then((xml) => getJson(toJson(xml))),
|
||||||
|
@ -124,10 +128,10 @@ async function video(v) {
|
||||||
wiki: summary,
|
wiki: summary,
|
||||||
desc: desc,
|
desc: desc,
|
||||||
color: await getColors(
|
color: await getColors(
|
||||||
`https://i.ytimg.com/vi/${v}/hqdefault.jpg?sqp=-oaymwEbCKgBEF5IVfKriqkDDggBFQAAiEIYAXABwAEG&rs=AOn4CLBy_x4UUHLNDZtJtH0PXeQGoRFTgw`
|
`https://i.ytimg.com/vi/${v}/hqdefault.jpg?sqp=${sqp}`
|
||||||
).then((colors) => colors[0].hex()),
|
).then((colors) => colors[0].hex()),
|
||||||
color2: await getColors(
|
color2: await getColors(
|
||||||
`https://i.ytimg.com/vi/${v}/hqdefault.jpg?sqp=-oaymwEbCKgBEF5IVfKriqkDDggBFQAAiEIYAXABwAEG&rs=AOn4CLBy_x4UUHLNDZtJtH0PXeQGoRFTgw`
|
`https://i.ytimg.com/vi/${v}/hqdefault.jpg?sqp=${sqp}`
|
||||||
).then((colors) => colors[1].hex()),
|
).then((colors) => colors[1].hex()),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue