feat: configurable proxy
feat: dont include yt-dlp and config
This commit is contained in:
parent
a4e457eb52
commit
ea12f95ec0
|
|
@ -133,4 +133,6 @@ dist
|
||||||
data/
|
data/
|
||||||
cache/
|
cache/
|
||||||
cacheStore/
|
cacheStore/
|
||||||
tmpStore/
|
tmpStore/
|
||||||
|
config.yml
|
||||||
|
yt-dlp.sh
|
||||||
|
|
@ -4,4 +4,9 @@ export type Config = {
|
||||||
api_base_url: string;
|
api_base_url: string;
|
||||||
web_base_url: string;
|
web_base_url: string;
|
||||||
jwt_privkey: string;
|
jwt_privkey: string;
|
||||||
|
proxy: {
|
||||||
|
host: string;
|
||||||
|
port: number;
|
||||||
|
protocol: string;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
@ -2,4 +2,5 @@ api_port: 33223
|
||||||
api_base_url: http://localhost:33223
|
api_base_url: http://localhost:33223
|
||||||
web_port: 8888
|
web_port: 8888
|
||||||
web_base_url: http://localhost:8888
|
web_base_url: http://localhost:8888
|
||||||
jwt_privkey: AfhrynxvaH7XevethWCLzzp3Xq49NpqeENdgVVPJnqKNfdAJFuRNdPosAJXYznez
|
jwt_privkey: AfhrynxvaH7XevethWCLzzp3Xq49NpqeENdgVVPJnqKNfdAJFuRNdPosAJXYznez
|
||||||
|
proxy: null
|
||||||
|
|
@ -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
|
||||||
|
|
@ -1,11 +1,8 @@
|
||||||
import YTMusic from "ytmusic-api";
|
import YTMusic from "ytmusic-api";
|
||||||
|
import { config } from "../index.js";
|
||||||
|
|
||||||
const ytmApi = new YTMusic({
|
const ytmApi = new YTMusic({
|
||||||
proxy: {
|
proxy: config.proxy
|
||||||
protocol: 'http',
|
|
||||||
host: 'localhost',
|
|
||||||
port: 12334
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
ytmApi.initialize().then(() => {
|
ytmApi.initialize().then(() => {
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,3 @@
|
||||||
|
#!/usr/bin/sh
|
||||||
|
|
||||||
|
yt-dlp --proxy socks5://localhost:12334 $@
|
||||||
Loading…
Reference in New Issue