channel-worker 1.6.6 → 1.6.8
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/command-poller.js +4 -7
- package/lib/nst-manager.js +18 -5
- package/package.json +1 -1
package/lib/command-poller.js
CHANGED
|
@@ -204,11 +204,7 @@ class CommandPoller {
|
|
|
204
204
|
const uniqueExtPath = baseExtPath + '-' + nst_profile_id + '-' + ts;
|
|
205
205
|
try {
|
|
206
206
|
fs.mkdirSync(uniqueExtPath, { recursive: true });
|
|
207
|
-
|
|
208
|
-
for (const f of files) {
|
|
209
|
-
const src = path.join(baseExtPath, f);
|
|
210
|
-
if (fs.statSync(src).isFile()) fs.copyFileSync(src, path.join(uniqueExtPath, f));
|
|
211
|
-
}
|
|
207
|
+
fs.cpSync(baseExtPath, uniqueExtPath, { recursive: true });
|
|
212
208
|
// Write Veo3-specific config.json
|
|
213
209
|
fs.writeFileSync(path.join(uniqueExtPath, 'config.json'), JSON.stringify({
|
|
214
210
|
channelManagerApi: 'https://api.channel.tunasm.art',
|
|
@@ -291,8 +287,9 @@ class CommandPoller {
|
|
|
291
287
|
fs.mkdirSync(tmpExtract, { recursive: true });
|
|
292
288
|
execSync(`tar -xzf "${tmpArchive}" -C "${tmpExtract}"`, { timeout: 30000 });
|
|
293
289
|
|
|
294
|
-
|
|
295
|
-
const
|
|
290
|
+
// Tar extracts into subfolder — find it (could be content-creator or content-creator-ext)
|
|
291
|
+
const subdirs = fs.readdirSync(tmpExtract).filter(f => fs.statSync(path.join(tmpExtract, f)).isDirectory());
|
|
292
|
+
const sourceDir = subdirs.length === 1 ? path.join(tmpExtract, subdirs[0]) : tmpExtract;
|
|
296
293
|
|
|
297
294
|
// Replace extension dir
|
|
298
295
|
if (fs.existsSync(extPath)) {
|
package/lib/nst-manager.js
CHANGED
|
@@ -149,11 +149,6 @@ class NstManager {
|
|
|
149
149
|
}
|
|
150
150
|
} catch {}
|
|
151
151
|
|
|
152
|
-
// Set proxy before launch
|
|
153
|
-
if (options.proxy) {
|
|
154
|
-
await this.setProxy(profileId, options.proxy);
|
|
155
|
-
}
|
|
156
|
-
|
|
157
152
|
const connectConfig = {
|
|
158
153
|
headless: false,
|
|
159
154
|
autoClose: false,
|
|
@@ -163,6 +158,24 @@ class NstManager {
|
|
|
163
158
|
},
|
|
164
159
|
};
|
|
165
160
|
|
|
161
|
+
// Pass proxy in connect config
|
|
162
|
+
if (options.proxy) {
|
|
163
|
+
try {
|
|
164
|
+
const proxyUrl = new URL(options.proxy);
|
|
165
|
+
connectConfig.proxy = {
|
|
166
|
+
proxyMethod: 'custom',
|
|
167
|
+
proxyType: proxyUrl.protocol.replace(':', '') || 'http',
|
|
168
|
+
host: proxyUrl.hostname,
|
|
169
|
+
port: proxyUrl.port,
|
|
170
|
+
username: decodeURIComponent(proxyUrl.username || ''),
|
|
171
|
+
password: decodeURIComponent(proxyUrl.password || ''),
|
|
172
|
+
};
|
|
173
|
+
console.log(`[nst] Proxy: ${proxyUrl.hostname}:${proxyUrl.port}`);
|
|
174
|
+
} catch (e) {
|
|
175
|
+
console.warn(`[nst] Invalid proxy URL: ${options.proxy}`);
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
|
|
166
179
|
if (options.extensionPath) {
|
|
167
180
|
connectConfig.args['--load-extension'] = options.extensionPath;
|
|
168
181
|
connectConfig.args['--disable-extensions-except'] = options.extensionPath;
|