api/stream: rename bridge mode to proxy

This commit is contained in:
wukko 2024-08-15 19:58:40 +06:00
parent 9d577f23b1
commit c1813aa33f
No known key found for this signature in database
GPG key ID: 3E30B3F26C7B4AA2
5 changed files with 10 additions and 8 deletions

View file

@ -59,7 +59,7 @@ export default function({ r, host, audioFormat, isAudioOnly, isAudioMuted, disab
case "muteVideo":
let muteType = "mute";
if (Array.isArray(r.urls) && !r.isM3U8) {
muteType = "bridge";
muteType = "proxy";
}
params = {
type: muteType,
@ -82,7 +82,7 @@ export default function({ r, host, audioFormat, isAudioOnly, isAudioMuted, disab
let audioStreamType = "render";
if (r.bestAudio === "mp3" && (audioFormat === "mp3" || audioFormat === "best")) {
audioFormat = "mp3";
audioStreamType = "bridge"
audioStreamType = "proxy"
}
params = {
picker: r.picker,
@ -130,7 +130,7 @@ export default function({ r, host, audioFormat, isAudioOnly, isAudioMuted, disab
case "vk":
case "tiktok":
params = { type: "bridge" };
params = { type: "proxy" };
break;
case "facebook":
@ -172,7 +172,7 @@ export default function({ r, host, audioFormat, isAudioOnly, isAudioMuted, disab
if (isBestAudioDefined || isBestHostAudio) {
audioFormat = serviceBestAudio;
processType = "bridge";
processType = "proxy";
if (isSoundCloud || (isTiktok && audioFormat === "m4a")) {
processType = "render"
copy = true
@ -184,7 +184,7 @@ export default function({ r, host, audioFormat, isAudioOnly, isAudioMuted, disab
if (isTumblrAudio && isBestOrMp3) {
audioFormat = "mp3";
processType = "bridge"
processType = "proxy"
}
if (r.isM3U8 || host === "vimeo") {

View file

@ -34,6 +34,7 @@ export function createResponse(responseType, responseData) {
}
}
break;
case "redirect":
response = {
url: responseData?.u,
@ -59,6 +60,7 @@ export function createResponse(responseType, responseData) {
default:
throw "unreachable"
}
return {
status,
body: {

View file

@ -64,7 +64,7 @@ export default async function (obj) {
let format = formats.find(f => f.quality === obj.quality) || formats[0];
return {
type: "bridge",
type: "proxy",
urls: `${format.sourceURL}?${new URLSearchParams({
sig: req_token[0].data.clip.playbackAccessToken.signature,
token: req_token[0].data.clip.playbackAccessToken.value

View file

@ -258,7 +258,7 @@ export default async function(o) {
if (!o.isAudioOnly && !o.isAudioMuted && format === 'h264') {
match = info.streaming_data.formats.find(checkSingle);
type = "bridge";
type = "proxy";
urls = match?.decipher(yt.session.player);
}

View file

@ -4,7 +4,7 @@ import { closeResponse } from "./shared.js";
export default async function(res, streamInfo) {
try {
if (streamInfo.isAudioOnly && streamInfo.type !== "bridge") {
if (streamInfo.isAudioOnly && streamInfo.type !== "proxy") {
streamAudioOnly(streamInfo, res);
return;
}