🔐 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:
@@ -53,14 +53,14 @@ export async function POST(req: NextRequest) {
|
||||
}
|
||||
|
||||
let result
|
||||
if (screenshots.length === 1) {
|
||||
// Single screenshot analysis
|
||||
// For now, always use single screenshot analysis to debug the issue
|
||||
if (screenshots.length > 0) {
|
||||
// Always use single screenshot analysis - get the first/most recent screenshot
|
||||
const filename = path.basename(screenshots[0])
|
||||
console.log(`Analyzing single screenshot: ${filename}`)
|
||||
result = await aiAnalysisService.analyzeScreenshot(filename)
|
||||
} else {
|
||||
// Multiple screenshots analysis
|
||||
const filenames = screenshots.map((screenshot: string) => path.basename(screenshot))
|
||||
result = await aiAnalysisService.analyzeMultipleScreenshots(filenames)
|
||||
return NextResponse.json({ error: 'No screenshots available for analysis' }, { status: 404 })
|
||||
}
|
||||
|
||||
if (!result) {
|
||||
|
||||
Reference in New Issue
Block a user