mirror of
https://github.com/Tzahi12345/YoutubeDL-Material.git
synced 2026-04-15 02:41:28 +03:00
Attempted to fix heroku server port
This commit is contained in:
@@ -107,13 +107,13 @@ function File(id, title, thumbnailURL, isAudio, duration, url, uploader, size, p
|
|||||||
|
|
||||||
// actual functions
|
// actual functions
|
||||||
|
|
||||||
function startServer() {
|
async function startServer() {
|
||||||
if (process.env.USING_HEROKU && process.env.PORT) {
|
if (process.env.USING_HEROKU && process.env.PORT) {
|
||||||
// default to heroku port if using heroku
|
// default to heroku port if using heroku
|
||||||
backendPort = process.env.PORT || backendPort;
|
backendPort = process.env.PORT || backendPort;
|
||||||
|
|
||||||
// set config to port
|
// set config to port
|
||||||
config_api.setConfigItem('ytdl_port', backendPort);
|
await setPortItemFromENV();
|
||||||
}
|
}
|
||||||
if (usingEncryption)
|
if (usingEncryption)
|
||||||
{
|
{
|
||||||
@@ -129,6 +129,13 @@ function startServer() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async function setPortItemFromENV() {
|
||||||
|
return new Promise(resolve => {
|
||||||
|
config_api.setConfigItem('ytdl_port', backendPort.toString());
|
||||||
|
setTimeout(() => resolve(true), 100);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
async function setAndLoadConfig() {
|
async function setAndLoadConfig() {
|
||||||
await setConfigFromEnv();
|
await setConfigFromEnv();
|
||||||
await loadConfig();
|
await loadConfig();
|
||||||
|
|||||||
Reference in New Issue
Block a user