feat: configurable proxy

feat: dont include yt-dlp and config
This commit is contained in:
OfficialDakari 2024-10-18 20:36:00 +05:00
parent a4e457eb52
commit ea12f95ec0
6 changed files with 21 additions and 7 deletions

4
.gitignore vendored
View File

@ -133,4 +133,6 @@ dist
data/
cache/
cacheStore/
tmpStore/
tmpStore/
config.yml
yt-dlp.sh

View File

@ -4,4 +4,9 @@ export type Config = {
api_base_url: string;
web_base_url: string;
jwt_privkey: string;
proxy: {
host: string;
port: number;
protocol: string;
};
};

View File

@ -2,4 +2,5 @@ api_port: 33223
api_base_url: http://localhost:33223
web_port: 8888
web_base_url: http://localhost:8888
jwt_privkey: AfhrynxvaH7XevethWCLzzp3Xq49NpqeENdgVVPJnqKNfdAJFuRNdPosAJXYznez
jwt_privkey: AfhrynxvaH7XevethWCLzzp3Xq49NpqeENdgVVPJnqKNfdAJFuRNdPosAJXYznez
proxy: null

6
config.yml.example Normal file
View File

@ -0,0 +1,6 @@
api_port: 33223
api_base_url: http://localhost:33223
web_port: 8888
web_base_url: http://localhost:8888
jwt_privkey: AfhrynxvaH7XevethWCLzzp3Xq49NpqeENdgVVPJnqKNfdAJFuRNdPosAJXYznez
proxy: null

View File

@ -1,11 +1,8 @@
import YTMusic from "ytmusic-api";
import { config } from "../index.js";
const ytmApi = new YTMusic({
proxy: {
protocol: 'http',
host: 'localhost',
port: 12334
}
proxy: config.proxy
});
ytmApi.initialize().then(() => {

3
yt-dlp.sh.example Executable file
View File

@ -0,0 +1,3 @@
#!/usr/bin/sh
yt-dlp --proxy socks5://localhost:12334 $@