mirror of
https://codeberg.org/ashley/poke.git
synced 2024-11-28 18:29:03 +01:00
remove try catch
This commit is contained in:
parent
016b89830b
commit
6f5f580777
1 changed files with 4 additions and 6 deletions
|
@ -57,7 +57,6 @@ async function channel(id, cnt) {
|
||||||
}
|
}
|
||||||
|
|
||||||
async function video(v) {
|
async function video(v) {
|
||||||
try {
|
|
||||||
if (v == null) return "Gib ID";
|
if (v == null) return "Gib ID";
|
||||||
|
|
||||||
let nightlyRes;
|
let nightlyRes;
|
||||||
|
@ -75,14 +74,14 @@ async function video(v) {
|
||||||
|
|
||||||
var vid = await JSON.parse(video_new_info);
|
var vid = await JSON.parse(video_new_info);
|
||||||
|
|
||||||
const a = await fetch(
|
const a = await fetch(
|
||||||
`${config.tubeApi}channel?id=${video.Video.Channel.id}&tab=about`
|
`${config.tubeApi}channel?id=${vid.authorId}&tab=about`
|
||||||
)
|
)
|
||||||
.then((res) => res.text())
|
.then((res) => res.text())
|
||||||
.then((xml) => JSON.parse(toJson(xml)));
|
.then((xml) => JSON.parse(toJson(xml)));
|
||||||
|
|
||||||
const summary = await wiki
|
const summary = await wiki
|
||||||
.summary(video.Video.Channel.Name + " ")
|
.summary(vid.author + " ")
|
||||||
.then((summary_) =>
|
.then((summary_) =>
|
||||||
summary_.title !== "Not found." ? summary_ : "none"
|
summary_.title !== "Not found." ? summary_ : "none"
|
||||||
);
|
);
|
||||||
|
@ -90,7 +89,6 @@ async function video(v) {
|
||||||
const data = await fetcher(v);
|
const data = await fetcher(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}`).then((res) => res.text()) .then((xml) => JSON.parse(toJson(xml))),
|
video: await fetch(`${config.tubeApi}video?v=${v}`).then((res) => res.text()) .then((xml) => JSON.parse(toJson(xml))),
|
||||||
|
@ -103,7 +101,7 @@ async function video(v) {
|
||||||
`https://i.ytimg.com/vi/${v}/maxresdefault.jpg`
|
`https://i.ytimg.com/vi/${v}/maxresdefault.jpg`
|
||||||
).then((colors) => colors[0].hex()),
|
).then((colors) => colors[0].hex()),
|
||||||
};
|
};
|
||||||
} catch (err) {}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async function search(query, cnt) {
|
async function search(query, cnt) {
|
||||||
|
|
Loading…
Reference in a new issue