Fix dynamic YouTube cookies detection
Allow cookies uploaded after server start to be detected by checking process.env.YOUTUBE_COOKIES_PATH dynamically instead of relying only on the cached COOKIES_PATH constant. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
parent
14706e2589
commit
4bb8b85c0e
@ -69,7 +69,8 @@ function addCookiesArg(args, cookiesPath = null) {
|
||||
}
|
||||
|
||||
// Option 2: Use static cookies file (may expire)
|
||||
const cookies = cookiesPath || COOKIES_PATH;
|
||||
// Check dynamically in case cookies were uploaded after server started
|
||||
const cookies = cookiesPath || process.env.YOUTUBE_COOKIES_PATH || COOKIES_PATH;
|
||||
if (cookies && fs.existsSync(cookies)) {
|
||||
console.log(`Using cookies file: ${cookies}`);
|
||||
return ['--cookies', cookies, ...args];
|
||||
|
||||
Loading…
Reference in New Issue
Block a user