Python Developer - Browser Automation & Video Download System Fix

Заказчик: AI | Опубликовано: 22.12.2025

# Project Overview We have a Python-based video generation automation system that uses Playwright to automate Google Flow (AI video generation platform). The system processes YouTube videos, extracts frames, generates AI videos with prompts, and downloads them. Currently, the download functionality has critical bugs that need to be fixed. ## Technology Stack Required - **Python 3.8+** (Advanced level) - **Playwright** (Browser automation - CRITICAL) - **Flask** (Web framework) - **SQLite** (Database) - **JavaScript/DOM Manipulation** (Understanding of browser DOM, element selection) - **Browser DevTools** (Debugging browser automation issues) - **Git** (Version control) ## Key Responsibilities ### Primary Task: Fix Video Download System The main issue is that the video download functionality is not working reliably. The system should download ALL videos generated on the page, but currently: - Only partial videos are being downloaded (e.g., 4 out of 6) - Download buttons are not found for off-screen videos - Browser crashes during download operations - Download loop terminates prematurely ### Specific Issues to Fix 1. **Off-Screen Video Download Failure** - Problem: Videos with negative Y coordinates (off-screen) fail to download - Error: "Download button not found after hovering" - Location: `flow_automation.py` - `download_video_by_position()` method - Fix Required: Implement proper scroll-to-view logic before hover 2. **Incomplete Download Loop** - Problem: Download loop stops before all videos are downloaded - Example: 6 videos generated, only 4 downloaded - Location: `flow_automation.py` - `download_all_videos()` method - Fix Required: Ensure loop continues until ALL videos on page are downloaded 3. **Download Button Detection Issues** - Problem: Download buttons not found even when visible - Distance threshold too strict (400px) - Multiple buttons on page causing confusion - Location: `flow_automation.py` - Button search logic - Fix Required: Improve button detection with better selectors and position filtering 4. **Browser Crash During Download** - Problem: Browser crashes when clicking download buttons rapidly - Location: Multiple places in download flow - Fix Required: Add proper delays, browser health checks, retry logic 5. **Video Count Mismatch** - Problem: System counts photos instead of actual videos on page - Location: `flow_automation.py` - Final verification logic - Fix Required: Always check actual videos on page, not expected count 6. **Refresh Logic Causing Duplicates** - Problem: Complex refresh after failure causes duplicate download attempts - Location: `flow_automation.py` - Download failure handling - Fix Required: Simplify refresh logic, prevent duplicate attempts ## Required Skills & Experience ### Must Have: 1. **Playwright Expertise** (3+ years) - Advanced knowledge of Playwright browser automation - Experience with complex DOM manipulation - Understanding of browser events (hover, click, scroll) - Debugging browser automation issues 2. **Python Advanced Skills** (5+ years) - Object-oriented programming - Exception handling and error recovery - Async/await patterns - Logging and debugging 3. **Browser Automation Experience** - Handling dynamic content - Element waiting strategies - Browser crash recovery - Retry mechanisms 4. **Problem-Solving Skills** - Ability to debug complex automation issues - Understanding of browser behavior - Systematic approach to fixing bugs ### Nice to Have: - Experience with video processing/automation - Knowledge of Google Flow or similar AI platforms - Experience with Flask web applications - Understanding of SQLite databases