1
Fork 0

add try catch :p

This commit is contained in:
Ashley 2022-12-21 15:42:06 +00:00
parent 8d613c2652
commit 7975435277

View file

@ -38,10 +38,17 @@ module.exports = async function (video_id) {
*/ */
async function parsexml(id) { async function parsexml(id) {
async function fetchxmlvideo() {
try {
const player = await fetch(`${new_api_url}?v=${id}`, headers); const player = await fetch(`${new_api_url}?v=${id}`, headers);
var h = await player.text(); var h = await player.text();
var j = toJson(h); var j = toJson(h);
return getJson(j); return getJson(j);
} catch {}
}
const a = await fetchxmlvideo();
return a;
} }
async function ryd() { async function ryd() {