api: add an option to always proxy files
This commit is contained in:
parent
2f63f6bab7
commit
a9e65b0da0
3 changed files with 8 additions and 1 deletions
|
@ -4,7 +4,7 @@ import { createResponse } from "./request.js";
|
|||
import { audioIgnore } from "./service-config.js";
|
||||
import { createStream } from "../stream/manage.js";
|
||||
|
||||
export default function({ r, host, audioFormat, isAudioOnly, isAudioMuted, disableMetadata, filenameStyle, twitterGif, requestIP, audioBitrate }) {
|
||||
export default function({ r, host, audioFormat, isAudioOnly, isAudioMuted, disableMetadata, filenameStyle, twitterGif, requestIP, audioBitrate, alwaysProxy }) {
|
||||
let action,
|
||||
responseType = "stream",
|
||||
defaultParams = {
|
||||
|
@ -192,5 +192,10 @@ export default function({ r, host, audioFormat, isAudioOnly, isAudioMuted, disab
|
|||
break;
|
||||
}
|
||||
|
||||
if (alwaysProxy && responseType === "redirect") {
|
||||
responseType = "stream";
|
||||
params.type = "proxy";
|
||||
}
|
||||
|
||||
return createResponse(responseType, {...defaultParams, ...params})
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue