web & api: rename stream to tunnel
- updated the endpoint to /tunnel - updated status to tunnel - fixed one incorrectly named error in web
This commit is contained in:
@@ -4,7 +4,7 @@
|
||||
"import.unknown": "couldn't load data from the file. it may be corrupted or of wrong format. here's the error i got:\n\n{{ value }}",
|
||||
|
||||
"remux.corrupted": "couldn't read the metadata from this file, it may be corrupted.",
|
||||
"stream.probe": "couldn't verify whether you can download this file. try again in a few seconds!",
|
||||
"tunnel.probe": "couldn't verify whether you can download this file. try again in a few seconds!",
|
||||
|
||||
"api.auth.jwt.missing": "couldn't confirm whether you're not a robot because the processing server didn't receive the human access token. try again in a few seconds or reload the page!",
|
||||
"api.auth.jwt.invalid": "couldn't confirm whether you're not a robot because your human access token expired and wasn't renewed. try again in a few seconds or reload the page!",
|
||||
|
||||
@@ -87,10 +87,10 @@
|
||||
return downloadFile(response.url);
|
||||
}
|
||||
|
||||
if (response.status === "stream") {
|
||||
if (response.status === "tunnel") {
|
||||
changeDownloadButton("check");
|
||||
|
||||
const probeResult = await API.probeCobaltStream(response.url);
|
||||
const probeResult = await API.probeCobaltTunnel(response.url);
|
||||
|
||||
if (probeResult === 200) {
|
||||
changeDownloadButton("done");
|
||||
@@ -101,7 +101,7 @@
|
||||
|
||||
return createDialog({
|
||||
...defaultErrorPopup,
|
||||
bodyText: $t("error.stream.failed_probe"),
|
||||
bodyText: $t("error.tunnel.probe"),
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -79,7 +79,7 @@ const request = async (url: string) => {
|
||||
return response;
|
||||
}
|
||||
|
||||
const probeCobaltStream = async (url: string) => {
|
||||
const probeCobaltTunnel = async (url: string) => {
|
||||
const request = await fetch(`${url}&p=1`).catch(() => {});
|
||||
if (request?.status === 200) {
|
||||
return request?.status;
|
||||
@@ -89,5 +89,5 @@ const probeCobaltStream = async (url: string) => {
|
||||
|
||||
export default {
|
||||
request,
|
||||
probeCobaltStream,
|
||||
probeCobaltTunnel,
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@ enum CobaltResponseType {
|
||||
Error = 'error',
|
||||
Picker = 'picker',
|
||||
Redirect = 'redirect',
|
||||
Stream = 'stream',
|
||||
Tunnel = 'tunnel',
|
||||
}
|
||||
|
||||
export type CobaltErrorResponse = {
|
||||
@@ -34,8 +34,8 @@ type CobaltRedirectResponse = {
|
||||
status: CobaltResponseType.Redirect,
|
||||
} & CobaltPartialURLResponse;
|
||||
|
||||
type CobaltStreamResponse = {
|
||||
status: CobaltResponseType.Stream,
|
||||
type CobaltTunnelResponse = {
|
||||
status: CobaltResponseType.Tunnel,
|
||||
} & CobaltPartialURLResponse;
|
||||
|
||||
export type CobaltSession = {
|
||||
@@ -64,4 +64,4 @@ export type CobaltServerInfoResponse = CobaltServerInfo | CobaltErrorResponse;
|
||||
export type CobaltAPIResponse = CobaltErrorResponse
|
||||
| CobaltPickerResponse
|
||||
| CobaltRedirectResponse
|
||||
| CobaltStreamResponse;
|
||||
| CobaltTunnelResponse;
|
||||
|
||||
Reference in New Issue
Block a user