(buffer)
| 489 | } |
| 490 | |
| 491 | writeCustomCookiesFile(buffer) { |
| 492 | const configDir = path.dirname(this.configPath); |
| 493 | const customPath = path.join(configDir, 'cookies.user.txt'); |
| 494 | |
| 495 | // Write the file |
| 496 | fs.writeFileSync(customPath, buffer); |
| 497 | |
| 498 | // Set restrictive permissions (owner read/write only) |
| 499 | fs.chmodSync(customPath, 0o600); |
| 500 | |
| 501 | // Update config |
| 502 | this.config.customCookiesUploaded = true; |
| 503 | this.config.cookiesEnabled = true; |
| 504 | this.saveConfig(); |
| 505 | this.emit('change'); |
| 506 | |
| 507 | return customPath; |
| 508 | } |
| 509 | |
| 510 | deleteCustomCookiesFile() { |
| 511 | const configDir = path.dirname(this.configPath); |
no test coverage detected