refactor: odysee downloading

This commit is contained in:
ihatespawn 2024-06-01 14:01:28 +02:00
parent a562f4f477
commit a8c89c19a0

View File

@ -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 {