mirror of
https://codeberg.org/ashley/poke.git
synced 2024-11-13 02:58:12 +01:00
add != "assets"
This commit is contained in:
parent
6e9abcf324
commit
c66863e69a
1 changed files with 49 additions and 43 deletions
|
@ -36,7 +36,7 @@ function getJson(str) {
|
|||
}
|
||||
}
|
||||
|
||||
function checkUnexistingObject(obj) {
|
||||
function checkUnexistingObject(obj) {
|
||||
if (obj !== undefined) {
|
||||
if (obj.authorId !== undefined) {
|
||||
return true;
|
||||
|
@ -80,15 +80,18 @@ async function video(v) {
|
|||
);
|
||||
|
||||
var vid = await getJson(video_new_info);
|
||||
if(checkUnexistingObject(vid)) {
|
||||
|
||||
const a = await fetch(`${config.tubeApi}channel?id=${vid.authorId}&tab=about`)
|
||||
if (checkUnexistingObject(vid)) {
|
||||
const a = await fetch(
|
||||
`${config.tubeApi}channel?id=${vid.authorId}&tab=about`
|
||||
)
|
||||
.then((res) => res.text())
|
||||
.then((xml) => getJson(toJson(xml)));
|
||||
|
||||
const summary = await wiki
|
||||
.summary(vid.author + " ")
|
||||
.then((summary_) => (summary_.title !== "Not found." ? summary_ : "none"));
|
||||
.then((summary_) =>
|
||||
summary_.title !== "Not found." ? summary_ : "none"
|
||||
);
|
||||
|
||||
const desc = a.Channel?.Contents.ItemSection.About.Description;
|
||||
|
||||
|
@ -128,7 +131,9 @@ async function search(query, cnt) {
|
|||
}
|
||||
|
||||
async function isvalidvideo(v) {
|
||||
if (v != "assets") {
|
||||
var status;
|
||||
|
||||
const vld = await fetch(`${config.dislikes}${v}`).then((res) => {
|
||||
status = res.status;
|
||||
return res.json();
|
||||
|
@ -139,6 +144,7 @@ async function isvalidvideo(v) {
|
|||
} else {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
|
|
Loading…
Reference in a new issue