mirror of
https://github.com/imputnet/cobalt.git
synced 2025-07-18 03:08:30 +00:00
odysee support
This commit is contained in:
parent
03fda93f96
commit
e88f2dc8e2
@ -25,6 +25,7 @@ import twitch from "./services/twitch.js";
|
||||
import rutube from "./services/rutube.js";
|
||||
import dailymotion from "./services/dailymotion.js";
|
||||
import loom from "./services/loom.js";
|
||||
import odysee from "./services/odysee.js";
|
||||
|
||||
let freebind;
|
||||
|
||||
@ -193,6 +194,11 @@ export default async function(host, patternMatch, lang, obj) {
|
||||
id: patternMatch.id
|
||||
});
|
||||
break;
|
||||
case "odysee":
|
||||
r = await odysee({
|
||||
id: patternMatch.id
|
||||
});
|
||||
break;
|
||||
default:
|
||||
return createResponse("error", {
|
||||
t: loc(lang, 'ErrorUnsupported')
|
||||
|
@ -130,6 +130,7 @@ export default function(r, host, userFormat, isAudioOnly, lang, isAudioMuted, di
|
||||
case "pinterest":
|
||||
case "streamable":
|
||||
case "loom":
|
||||
case "odysee":
|
||||
responseType = "redirect";
|
||||
break;
|
||||
}
|
||||
|
27
src/modules/processing/services/odysee.js
Normal file
27
src/modules/processing/services/odysee.js
Normal file
@ -0,0 +1,27 @@
|
||||
import { genericUserAgent } from "../../config.js";
|
||||
|
||||
export default async function({ id }) {
|
||||
const req = await fetch(`https://odysee.com/${id}`, {
|
||||
method: "GET",
|
||||
headers: {
|
||||
"user-agent": genericUserAgent
|
||||
}
|
||||
})
|
||||
.then(req => {return req.text()})
|
||||
.catch(() => {});
|
||||
|
||||
// i couldn't find any other way to do this
|
||||
var reqlines = req.split('\n');
|
||||
var contentline = reqlines[reqlines.length - 32];
|
||||
var videoUrl = contentline.split('"')[3];
|
||||
|
||||
if (videoUrl?.includes('.mp4')) {
|
||||
return {
|
||||
urls: videoUrl,
|
||||
filename: `odysee_${id}.mp4`,
|
||||
audioFilename: `odysee_${id}_audio`
|
||||
}
|
||||
}
|
||||
|
||||
return { error: 'ErrorEmptyDownload' }
|
||||
}
|
@ -1,5 +1,5 @@
|
||||
{
|
||||
"audioIgnore": ["vk", "ok", "loom"],
|
||||
"audioIgnore": ["vk", "ok", "loom", "odysee"],
|
||||
"hlsExceptions": ["dailymotion", "vimeo", "rutube"],
|
||||
"config": {
|
||||
"bilibili": {
|
||||
@ -117,6 +117,11 @@
|
||||
"alias": "loom videos",
|
||||
"patterns": ["share/:id"],
|
||||
"enabled": true
|
||||
},
|
||||
"odysee": {
|
||||
"alias": "odysee videos",
|
||||
"patterns": [":creator/:id", ":id"],
|
||||
"enabled": true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -15,6 +15,9 @@ export const testers = {
|
||||
"ok": (patternMatch) =>
|
||||
patternMatch.id?.length <= 16,
|
||||
|
||||
"odysee": (patternMatch) =>
|
||||
patternMatch.id?.length <= 255,
|
||||
|
||||
"pinterest": (patternMatch) =>
|
||||
patternMatch.id?.length <= 128 || patternMatch.shortLink?.length <= 32,
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user