🔐 Implement robust session persistence to avoid 'are you human' captcha checks

- Add comprehensive session persistence with cookies, localStorage, and sessionStorage
- Implement stealth browser features to reduce bot detection
- Add smartLogin() method that prioritizes saved sessions over fresh logins
- Create session management utilities (refresh, clear, test validity)
- Update enhanced screenshot service to use session persistence
- Add comprehensive documentation and test script
- Support manual login fallback when captcha is encountered
- Sessions stored in .tradingview-session/ directory for Docker compatibility

This solves the captcha problem by avoiding repeated logins through persistent sessions.
This commit is contained in:
mindesbunister
2025-07-12 21:39:53 +02:00
parent 483d4c6576
commit cf58d41444
8 changed files with 976 additions and 26 deletions

View File

@@ -11,9 +11,9 @@ async function testAIAnalysis() {
try {
console.log('🔍 Testing AI analysis with a real screenshot...')
// Use one of the existing screenshots
// Use the specific screenshot you mentioned
const screenshotsDir = path.join(process.cwd(), 'screenshots')
const testImage = 'SOLUSD_60_1752324455391_ai.png'
const testImage = 'debug_before_timeframe_change_1752324987294.png'
const imagePath = path.join(screenshotsDir, testImage)
console.log(`📸 Using screenshot: ${imagePath}`)