remove try catch

This commit is contained in:
Ashley 2022-11-07 21:07:18 +01:00
parent 016b89830b
commit 6f5f580777

View file

@ -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;
@ -76,13 +75,13 @@ 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) {