mirror of
https://github.com/imputnet/cobalt.git
synced 2024-12-28 02:26:10 +00:00
api/bluesky: use hls video cdn directly
This commit is contained in:
parent
09c66fead0
commit
b61b8c82a2
|
@ -3,9 +3,16 @@ import { cobaltUserAgent } from "../../config.js";
|
||||||
import { createStream } from "../../stream/manage.js";
|
import { createStream } from "../../stream/manage.js";
|
||||||
|
|
||||||
const extractVideo = async ({ media, filename, dispatcher }) => {
|
const extractVideo = async ({ media, filename, dispatcher }) => {
|
||||||
const urlMasterHLS = media?.playlist;
|
let urlMasterHLS = media?.playlist;
|
||||||
if (!urlMasterHLS) return { error: "fetch.empty" };
|
|
||||||
if (!urlMasterHLS.startsWith("https://video.bsky.app/")) return { error: "fetch.empty" };
|
if (!urlMasterHLS || !urlMasterHLS.startsWith("https://video.bsky.app/")) {
|
||||||
|
return { error: "fetch.empty" };
|
||||||
|
}
|
||||||
|
|
||||||
|
urlMasterHLS = urlMasterHLS.replace(
|
||||||
|
"video.bsky.app/watch/",
|
||||||
|
"video.cdn.bsky.app/hls/"
|
||||||
|
);
|
||||||
|
|
||||||
const masterHLS = await fetch(urlMasterHLS, { dispatcher })
|
const masterHLS = await fetch(urlMasterHLS, { dispatcher })
|
||||||
.then(r => {
|
.then(r => {
|
||||||
|
|
Loading…
Reference in a new issue