updated readme and fixed some things

This commit is contained in:
wukko
2022-12-17 17:22:39 +06:00
parent 7f1ba6b36b
commit 13c2884a41
9 changed files with 34 additions and 31 deletions

View File

@@ -7,7 +7,7 @@ export default async function(obj) {
let html;
html = await fetch(`https://vk.com/video-${obj.userId}_${obj.videoId}`, {
headers: {"user-agent": genericUserAgent}
}).then(async (r) => {return r.text()}).catch(() => {return false});
}).then((r) => {return r.text()}).catch(() => {return false});
if (!html) return { error: 'ErrorCouldntFetch' };
if (html.includes(`{"lang":`)) {
let js = JSON.parse('{"lang":' + html.split(`{"lang":`)[1].split(']);')[0]);