mirror of
https://codeberg.org/ashley/poke.git
synced 2024-12-24 18:38:40 +01:00
add try catch :p
This commit is contained in:
parent
cdab6720ad
commit
7e5725064e
1 changed files with 11 additions and 4 deletions
|
@ -38,10 +38,17 @@ module.exports = async function (video_id) {
|
|||
*/
|
||||
|
||||
async function parsexml(id) {
|
||||
const player = await fetch(`${new_api_url}?v=${id}`, headers);
|
||||
var h = await player.text();
|
||||
var j = toJson(h);
|
||||
return getJson(j);
|
||||
async function fetchxmlvideo() {
|
||||
try {
|
||||
const player = await fetch(`${new_api_url}?v=${id}`, headers);
|
||||
var h = await player.text();
|
||||
var j = toJson(h);
|
||||
return getJson(j);
|
||||
} catch {}
|
||||
}
|
||||
|
||||
const a = await fetchxmlvideo();
|
||||
return a;
|
||||
}
|
||||
|
||||
async function ryd() {
|
||||
|
|
Loading…
Reference in a new issue