mirror of
https://github.com/imputnet/cobalt.git
synced 2025-07-16 18:28:29 +00:00
add default url option
This commit is contained in:
parent
e906904645
commit
2250d23e19
@ -17,7 +17,7 @@ const switchers = {
|
||||
"dubLang": ["original", "auto"],
|
||||
"vimeoDash": ["false", "true"],
|
||||
"audioMode": ["false", "true"],
|
||||
"serverPicker": ["co.wuk.sh", "api.c0ba.lt", "co-api.blueb.me", "wukko.wolfdo.gg", "api.co.749.city", "cobalt-api.fluffy.tools", "capi.oak.li"]
|
||||
"serverPicker": [getDefaultAPI(), "https://co.wuk.sh", "https://api.c0ba.lt", "https://wukko.wolfdo.gg", "https://api.co.749.city", "https://cobalt-api.fluffy.tools", "https://capi.oak.li"]
|
||||
};
|
||||
const checkboxes = ["disableTikTokWatermark", "fullTikTokAudio", "muteAudio", "reduceTransparency", "disableAnimations"];
|
||||
const exceptions = { // used for mobile devices
|
||||
@ -31,6 +31,9 @@ function changeAPI(url) {
|
||||
apiURL = url;
|
||||
return true
|
||||
}
|
||||
function getDefaultAPI() {
|
||||
return defaultApiURL;
|
||||
}
|
||||
function eid(id) {
|
||||
return document.getElementById(id)
|
||||
}
|
||||
@ -256,8 +259,8 @@ function popup(type, action, text) {
|
||||
function changeSwitcher(li, b) {
|
||||
if (switchers.serverPicker.includes(b)) {
|
||||
if (!switchers[li].includes(b)) b = switchers[li][0];
|
||||
changeAPI("https://"+b);
|
||||
sSet(li, "https://"+b);
|
||||
changeAPI(b);
|
||||
sSet(li, b);
|
||||
for (let i in switchers[li]) {
|
||||
(switchers[li][i] === b) ? enable(`${li}-${b}`) : disable(`${li}-${switchers[li][i]}`)
|
||||
}
|
||||
|
@ -42,6 +42,7 @@
|
||||
"SettingsThemeDark": "dark",
|
||||
"SettingsKeepDownloadButton": "keep >> visible",
|
||||
"SettingsServerPicker": "server picker",
|
||||
"SettingsServerPickerDefault": "default",
|
||||
"SettingsServerPickerDescription": "choose which server to download from",
|
||||
"AccessibilityKeepDownloadButton": "keep the download button always visible",
|
||||
"SettingsEnableDownloadPopup": "ask how to save",
|
||||
|
@ -460,25 +460,25 @@ export default function(obj) {
|
||||
explanation: t(['SettingsServerPickerDescription']),
|
||||
vertical: true,
|
||||
items: [{
|
||||
action: "co.wuk.sh",
|
||||
action: process.env.apiURL ? process.env.apiURL.slice(0, -1) : '',
|
||||
text: t('SettingsServerPickerDefault')
|
||||
}, {
|
||||
action: "https://co.wuk.sh",
|
||||
text: "co.wuk.sh"
|
||||
}, {
|
||||
action: "api.c0ba.lt",
|
||||
action: "https://api.c0ba.lt",
|
||||
text: "api.c0ba.lt"
|
||||
}, {
|
||||
action: "co-api.blueb.me",
|
||||
text: "co-api.blueb.me"
|
||||
}, {
|
||||
action: "wukko.wolfdo.gg",
|
||||
action: "https://wukko.wolfdo.gg",
|
||||
text: "wukko.wolfdo.gg"
|
||||
}, {
|
||||
action: "api.co.749.city",
|
||||
action: "https://api.co.749.city",
|
||||
text: "api.co.749.city"
|
||||
}, {
|
||||
action: "cobalt-api.fluffy.tools",
|
||||
action: "https://cobalt-api.fluffy.tools",
|
||||
text: "cobalt-api.fluffy.tools"
|
||||
}, {
|
||||
action: "capi.oak.li",
|
||||
action: "https://capi.oak.li",
|
||||
text: "capi.oak.li"
|
||||
}]
|
||||
})
|
||||
@ -598,7 +598,7 @@ export default function(obj) {
|
||||
clipboardErrorNoPermission: ` + "`" + t('ClipboardErrorNoPermission') + "`" + `,
|
||||
clipboardErrorFirefox: ` + "`" + t('ClipboardErrorFirefox') + "`" + `,
|
||||
};
|
||||
let apiURL = '${process.env.apiURL ? process.env.apiURL.slice(0, -1) : ''}';
|
||||
let defaultApiURL = '${process.env.apiURL ? process.env.apiURL.slice(0, -1) : ''}';
|
||||
</script>
|
||||
<script type="text/javascript" src="cobalt.js"></script>
|
||||
</html>
|
||||
|
Loading…
Reference in New Issue
Block a user