parent
8276e51dbc
commit
0fefc4ac27
1 changed files with 6 additions and 5 deletions
|
@ -20,14 +20,15 @@ export default async function(o) {
|
||||||
}).then(r => r.text()).catch(() => {});
|
}).then(r => r.text()).catch(() => {});
|
||||||
|
|
||||||
if (!html) return { error: 'ErrorCouldntFetch' };
|
if (!html) return { error: 'ErrorCouldntFetch' };
|
||||||
if (!html.includes(`<div data-module="OKVideo" data-options="{`)) {
|
|
||||||
|
let videoData = html.match(/<div data-module="OKVideo" .*? data-options="({.*?})"( .*?)>/)
|
||||||
|
?.[1]
|
||||||
|
?.replaceAll(""", '"');
|
||||||
|
|
||||||
|
if (!videoData) {
|
||||||
return { error: 'ErrorEmptyDownload' };
|
return { error: 'ErrorEmptyDownload' };
|
||||||
}
|
}
|
||||||
|
|
||||||
let videoData = html.split(`<div data-module="OKVideo" data-options="`)[1]
|
|
||||||
.split('" data-')[0]
|
|
||||||
.replaceAll(""", '"');
|
|
||||||
|
|
||||||
videoData = JSON.parse(JSON.parse(videoData).flashvars.metadata);
|
videoData = JSON.parse(JSON.parse(videoData).flashvars.metadata);
|
||||||
|
|
||||||
if (videoData.provider !== "UPLOADED_ODKL")
|
if (videoData.provider !== "UPLOADED_ODKL")
|
||||||
|
|
Loading…
Reference in a new issue