channel-worker 1.6.17 → 1.6.19

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/api-client.js CHANGED
@@ -65,7 +65,7 @@ class ApiClient {
65
65
 
66
66
  // Commands
67
67
  async getNextCommand(workerId) {
68
- const workerTypes = 'launch_profile,close_profile,launch_veo3_profile,save_file,set_thumbnail,set_tags,set_file_input,click_and_upload,type_text,verify_logins,update_extension,sync_youtube_stats,restart_worker';
68
+ const workerTypes = 'launch_profile,close_profile,launch_veo3_profile,set_profile_proxy,save_file,set_thumbnail,set_tags,set_file_input,click_and_upload,type_text,verify_logins,update_extension,sync_youtube_stats,restart_worker';
69
69
  return this.request('GET', `/workers/commands?worker_id=${workerId}&types=${encodeURIComponent(workerTypes)}`);
70
70
  }
71
71
 
@@ -117,29 +117,21 @@ class NstManager {
117
117
  async setProxy(profileId, proxyUrl) {
118
118
  if (!proxyUrl) return;
119
119
  console.log(`[nst] Setting proxy for ${profileId}: ${proxyUrl}`);
120
- // Parse proxy URL: protocol://user:pass@host:port
121
- const parsed = new URL(proxyUrl);
122
- const proxyConfig = {
123
- proxy: {
124
- type: parsed.protocol.replace(':', '').replace('socks5', 'socks5'), // http, https, socks5
125
- host: parsed.hostname,
126
- port: parsed.port,
127
- ...(parsed.username && { username: decodeURIComponent(parsed.username) }),
128
- ...(parsed.password && { password: decodeURIComponent(parsed.password) }),
129
- },
130
- };
131
- // Try PATCH first, fallback to PUT
132
- for (const method of ['PATCH', 'PUT']) {
133
- try {
134
- const res = await fetch(`${this.baseUrl}/profiles/${profileId}`, {
135
- method,
136
- headers: { 'Content-Type': 'application/json', 'x-api-key': this.apiKey },
137
- body: JSON.stringify(proxyConfig),
138
- });
139
- if (res.ok) { console.log(`[nst] Proxy saved to profile (${method})`); return; }
140
- } catch {}
120
+ try {
121
+ const res = await fetch(`${this.baseUrl}/profiles/${profileId}/proxy`, {
122
+ method: 'PUT',
123
+ headers: { 'Content-Type': 'application/json', 'x-api-key': this.apiKey },
124
+ body: JSON.stringify({ url: proxyUrl }),
125
+ });
126
+ const text = await res.text();
127
+ if (res.ok) {
128
+ console.log(`[nst] Proxy saved to profile`);
129
+ } else {
130
+ console.warn(`[nst] setProxy failed ${res.status}: ${text.substring(0, 200)}`);
131
+ }
132
+ } catch (e) {
133
+ console.warn(`[nst] setProxy error: ${e.message}`);
141
134
  }
142
- console.warn(`[nst] Failed to save proxy to profile — will still use at launch time`);
143
135
  }
144
136
 
145
137
  // Launch browser — skip if already running, set proxy if provided
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "channel-worker",
3
- "version": "1.6.17",
3
+ "version": "1.6.19",
4
4
  "description": "Channel Manager worker daemon — runs on remote machines to execute video pipeline jobs",
5
5
  "main": "lib/daemon.js",
6
6
  "bin": {