An intelligent video downloader that automatically downloads and upscales your favorite videos. The program uses Playwright for browser automation and is fully configurable.
- 🚀 Automatic Download - Automatically downloads all videos from favorites
- 🔍 Duplicate Detection - Detects and skips already downloaded videos
- 📈 Automatic Upscale - Upscales videos to HD quality before download
- 🌐 Multi-language Support - English and Hungarian language support
- ⚙️ Fully Configurable - Extensive configuration options
- 🎯 Smart Waiting - Random wait times to avoid detection
- 🔄 Error Handling - Robust error handling and retry logic
- 📱 Browser Emulation - Real browser behavior simulation
- Python 3.12+
- Google Chrome or Chromium browser
- Internet connection
-
Clone the repository:
git clone https://github.com/richardfoltin/AI-video-downloader.git cd AI-video-downloader -
Install dependencies:
pip install pipenv pipenv install
-
Install Playwright browser:
pipenv run playwright install chrome
-
Copy the example configuration:
cp .env.example .env
-
Edit the .env file:
# Basic settings LANGUAGE=en # or hu COOKIE_FILE=cookies.txt DOWNLOAD_DIR=downloads DOWNLOAD_IMAGES=false DOWNLOAD_VIDEOS=true UPSCALE_VIDEOS=true # Browser settings HEADLESS=false BROWSER_CHANNEL=chrome
DOWNLOAD_IMAGES: set totrueto save the card preview image before each video and process image-only cards. Existing files are skipped automatically.DOWNLOAD_VIDEOS: set tofalseto skip downloading videos (only images will be processed when enabled).UPSCALE_VIDEOS: leavetrueto trigger the upscale menu before downloads; set tofalseto skip upscale entirely.UPSCALE_VIDEO_WIDTH: videos with width greater or equal to this threshold are treated as already upscaled and skipped.
The program needs valid cookies to access your videos.
-
Open in your browser:
https://grok.com/imagine/favorites -
Sign in (if needed)
-
Open developer tools:
- Chrome/Edge:
F12orCtrl+Shift+I - Firefox:
F12orCtrl+Shift+I
- Chrome/Edge:
-
Go to Application/Storage → Cookies → .grok.com
-
Copy all cookies and save them to
cookies.txtfile in the following format:name1=value1; name2=value2; name3=value3Example:
sso=abc123; sso-rw=def456; x-anonuserid=xyz789
-
Activate virtual environment:
pipenv shell
-
Run the program:
python download.py
The program will automatically:
- Open the favorites page
- Browse through all videos
- Upscale them to HD quality
- Download videos to the
downloads/folder
- Check your cookie file
- Generate new cookies
- Make sure you're using the same user-agent
- Check if there's content on the favorites page
- Verify cookie validity
- Try increasing the
INITIAL_PAGE_WAIT_MSvalue
- Increase wait times
- Use
HEADLESS=falsefor visual feedback
- Reduce
VIEWPORT_WIDTH/HEIGHTvalues - Use
HEADLESS=truemode
This project is licensed under the MIT License - see the LICENSE file for details.