api/stream: rename bridge
mode to proxy
This commit is contained in:
parent
9d577f23b1
commit
c1813aa33f
5 changed files with 10 additions and 8 deletions
|
@ -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") {
|
||||
|
|
|
@ -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: {
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue