mirror of
https://github.com/imputnet/cobalt.git
synced 2025-07-18 19:28:29 +00:00
refactor: odysee downloading
This commit is contained in:
parent
a562f4f477
commit
a8c89c19a0
@ -10,10 +10,8 @@ export default async function({ id }) {
|
|||||||
.then(req => {return req.text()})
|
.then(req => {return req.text()})
|
||||||
.catch(() => {});
|
.catch(() => {});
|
||||||
|
|
||||||
// i couldn't find any other way to do this
|
if (!requestText.includes('"contentUrl": ')) return { error: 'ErrorEmptyDownload' };
|
||||||
var requestLines = requestText.split('\n');
|
var videoUrl = requestText.split('"contentUrl": "')[1].split('"')[0];
|
||||||
var contentline = requestLines[requestLines.length - 32];
|
|
||||||
var videoUrl = contentline.split('"')[3];
|
|
||||||
|
|
||||||
if (videoUrl?.includes('.mp4')) {
|
if (videoUrl?.includes('.mp4')) {
|
||||||
return {
|
return {
|
||||||
|
Loading…
Reference in New Issue
Block a user