From 83d82f5da9f05f57c9cddf92e4d8de408a85931e Mon Sep 17 00:00:00 2001 From: wukko Date: Sat, 2 Dec 2023 22:51:08 +0600 Subject: [PATCH] web: saving cobalt streams via action chooser --- src/cobalt.js | 2 +- src/front/cobalt.js | 13 ++++++++++--- src/modules/setup.js | 3 --- 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/src/cobalt.js b/src/cobalt.js index 6a148860..2d90e07e 100644 --- a/src/cobalt.js +++ b/src/cobalt.js @@ -22,7 +22,7 @@ app.disable('x-powered-by'); await loadLoc(); const apiMode = process.env.apiURL && !process.env.webURL; -const webMode = process.env.webURL && !process.env.apiURL; +const webMode = process.env.webURL && process.env.apiURL; if (apiMode) { const { runAPI } = await import('./core/api.js'); diff --git a/src/front/cobalt.js b/src/front/cobalt.js index 4a3ad9e6..15ebaa8e 100644 --- a/src/front/cobalt.js +++ b/src/front/cobalt.js @@ -423,9 +423,16 @@ async function download(url) { let jp = await res.json(); if (jp.status === "continue") { changeDownloadButton(2, '>>>'); - if (isMobile || isSafari) { - window.location.href = j.url; - } else window.open(j.url, '_blank'); + if (sGet("downloadPopup") === "true") { + popup('download', 1, j.url) + setTimeout(() => { + popup('download', 0); + }, 90000) + } else { + if (isMobile || isSafari) { + window.location.href = j.url; + } else window.open(j.url, '_blank'); + } setTimeout(() => { changeButton(1) }, 2500); } else { changeButton(0, jp.text); diff --git a/src/modules/setup.js b/src/modules/setup.js index cb5aa184..8895d88c 100644 --- a/src/modules/setup.js +++ b/src/modules/setup.js @@ -29,9 +29,6 @@ console.log( `${Cyan(`Hey, this is cobalt v.${version}!`)}\n${Bright("Let's start by creating a new ")}${Cyan(".env")}${Bright(" file. You can always change it later.")}` ) -console.log( - `\n${Bright("⚠️ Please notice that since v.6.0 cobalt is hosted in two parts. API and web app are now separate.\nMerged hosting is no longer available.")}` -) function setup() { console.log(Bright("\nWhat kind of server will this instance be?\nOptions: api, web."));