-
Notifications
You must be signed in to change notification settings - Fork 69
feat(youtube): add cookiePath config support #203
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: dev
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -19,6 +19,7 @@ import { | |
| getVersion, | ||
| initLogger, | ||
| logger, | ||
| makeRequest, | ||
| parseClient, | ||
| verifyDiscordID | ||
| } from './utils.ts' | ||
|
|
@@ -595,6 +596,26 @@ class NodelinkServer extends EventEmitter { | |
| 'Server', | ||
| `git branch: ${this.gitInfo.branch}, commit: ${this.gitInfo.commit}, committed on: ${new Date(this.gitInfo.commitTime).toISOString()}` | ||
| ) | ||
|
|
||
| // global-http-proxy: log proxy and test connectivity at startup | ||
| const proxyCfg = options?.server?.httpProxy | ||
| if (proxyCfg?.enabled && proxyCfg.url) { | ||
| logger('info', 'Proxy', `HTTP proxy enabled: ${proxyCfg.url}`) | ||
| this._testProxyConnectivity(proxyCfg.url) | ||
| } | ||
| } | ||
|
|
||
| /** @internal */ | ||
| private _testProxyConnectivity(proxyUrl: string): void { | ||
| makeRequest('http://connectivitycheck.gstatic.com/generate_204', { | ||
| proxy: { url: proxyUrl } | ||
| }) | ||
| .then(() => { | ||
| logger('info', 'Proxy', `Connected successfully via ${proxyUrl}`) | ||
| }) | ||
| .catch((err: Error) => { | ||
| logger('warn', 'Proxy', `Proxy connectivity check failed (${proxyUrl}): ${err.message}`) | ||
| }) | ||
|
Comment on lines
+599
to
+618
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. bad practices |
||
| } | ||
|
|
||
| /** | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3111,9 +3111,11 @@ export abstract class BaseClient { | |
| * @internal | ||
| */ | ||
| _getQualityPriority(): Record<string, number[]> { | ||
| // 774 = Opus ~260-360 kbps (premium HQ, requires cookiePath) | ||
| // 141 = AAC 256 kbps (premium HQ fallback, requires cookiePath) | ||
| return { | ||
| high: [251, 250, 140], | ||
| medium: [250, 140], | ||
| high: [774, 141, 251, 250, 140], | ||
| medium: [141, 251, 250, 140], | ||
|
Comment on lines
+3117
to
+3118
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. A question was raised about ITAgs; it doesn't mean they should be added as a standard feature, it's something that only appears on YouTube Premium accounts to complete the setup, and NodeLink already has a system for selecting the best ITAgs, so this is redundant. |
||
| low: [249, 250, 140], | ||
| lowest: [249, 139] | ||
| } | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -32,6 +32,17 @@ export interface ServerConfig { | |
| * @experimental | ||
| */ | ||
| useBunServer?: boolean | ||
|
|
||
| /** | ||
| * Global HTTP proxy for all outbound NodeLink requests. | ||
| * Supports http, https, and socks5 URLs. | ||
| */ | ||
| httpProxy?: { | ||
| enabled: boolean | ||
| url: string | ||
| username?: string | ||
| password?: string | ||
| } | ||
|
Comment on lines
+35
to
+45
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I will not accept a global proxy; there are already separate systems for that. |
||
| } | ||
|
|
||
| /** | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -353,6 +353,17 @@ export interface NodelinkRuntime { | |
| routePlanner?: RoutePlannerRuntime | ||
| /** Optional stats manager instance. */ | ||
| statsManager?: StatsManager | ||
| /** Global HTTP proxy server options. */ | ||
| options?: { | ||
| server?: { | ||
| httpProxy?: { | ||
| enabled: boolean | ||
| url: string | ||
| username?: string | ||
| password?: string | ||
| } | ||
| } | ||
| } | ||
|
Comment on lines
+356
to
+366
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I will not accept a global proxy; there are already separate systems for that. |
||
| } | ||
|
|
||
| /** | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will not accept a global proxy; there are already separate systems for that.