Skip to content

best way to save what you love

merge: changes from main

wukko0b29121c5374
diff --cc api/src/core/api.js
index 84f814e4,82449c30..8e18c929
--- a/api/src/core/api.js
+++ b/api/src/core/api.js
@@@ -16,11 -16,12 +16,13 @@@ import { createStore } from "../store/r
import { randomizeCiphers } from "../misc/randomize-ciphers.js";
import { verifyTurnstileToken } from "../security/turnstile.js";
import { friendlyServiceName } from "../processing/service-alias.js";
-import { verifyStream, getInternalStream } from "../stream/manage.js";
+import { verifyStream } from "../stream/manage.js";
import { createResponse, normalizeRequest, getIP } from "../processing/request.js";
++import { setupTunnelHandler } from "./itunnel.js";
+
import * as APIKeys from "../security/api-keys.js";
import * as Cookies from "../processing/cookie/manager.js";
- import { setupTunnelHandler } from "./itunnel.js";
+ import * as YouTubeSession from "../processing/helpers/youtube-session.js";
const git = {
branch: await getBranch(),
@@@ -362,7 -378,23 +364,11 @@@ export const runAPI = async (express, a
if (env.cookiePath) {
Cookies.setup(env.cookiePath);
}
+
+ if (env.ytSessionServer) {
+ YouTubeSession.setup();
+ }
});
- if (isCluster) {
- const istreamer = express();
- istreamer.get('/itunnel', itunnelHandler);
- const server = istreamer.listen({
- port: 0,
- host: '127.0.0.1',
- exclusive: true
- }, () => {
- const { port } = server.address();
- console.log(`${Green('[✓]')} cobalt sub-instance running on 127.0.0.1:${port}`);
- setTunnelPort(port);
- });
- }
+ setupTunnelHandler();
}