This repository contains Python modules to automate the login, extraction, and download of videos from Hotmart's 101 Karate Games platform. For personal use only, of course. It requires a paid login.
- Automates login to Hotmart
- Extracts video URL from lesson pages using advanced techniques
- Supports MP4 and HLS (.m3u8) downloads
- Handles multi-part videos (automatically downloads all parts)
- Extracts and saves text descriptions of games (instructions, materials needed, setup)
- Uses Selenium for browser automation
- Handles cookie policy popups and other overlays
- Comprehensive test suite for reliability
- Python 3 installed
- Google Chrome installed
- WebDriver (managed automatically via
webdriver-manager) ffmpeginstalled (for HLS video downloads)
- Clone the repository:
git clone https://github.com/cloudartisan/101kg.git cd 101kg - Create a virtual environment:
python3 -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate
- Install dependencies:
pip install -r requirements.txt
-
First Time Run (creates a config file with your credentials):
python 101kg.py
This will prompt for your email and password and store them securely in
config.json. -
Run with Command Line Credentials (alternative to config file):
python 101kg.py --email your_email@example.com --password your_password
-
Downloaded videos will be saved in the
videos/directory.
--email: Your Hotmart email/username--password: Your Hotmart password--config: Path to config file with credentials (default: config.json in script directory)
--log-level: Logging level - debug, info, warning, error (default: info)--no-log-file: Disable logging to file--verbose: Use the same log level for console as for the log file--headless: Run browser in headless mode
--list: List available videos without downloading anything--single NAME_OR_NUMBER: Download a specific video by name or index number (including all parts if multi-part)--url DIRECT_URL: Download from a direct video URL--output FILENAME: Specify output filename for downloads (part suffix will be added for multi-part videos)--indexes "1,3,5": Download specific videos by index numbers (comma-separated list, all parts will be downloaded for each index)
# List all available videos
python 101kg.py --list
# Download a specific video by name (substring match, case-insensitive)
python 101kg.py --single "Clock Game"
# Download a specific video by index number
python 101kg.py --single 1
# Download a specific multi-part video (automatically downloads all parts)
python 101kg.py --single "Fundamental Movement"
# Download video and its text description with game instructions and setup
python 101kg.py --single "Puppy Race"
# Description is saved to videos/022_21 - Puppy Race.txt
# Download from a direct URL
python 101kg.py --url "https://vod-akm.play.hotmart.com/video/..." --output "clock_game"
# Download multiple specific videos by index
python 101kg.py --indexes "1,3,5"
# Enable debug logging
python 101kg.py --log-level debug
# Run in headless mode
python 101kg.py --headless101kg.py- Main entry point scriptbrowser_manager.py- Browser initialization and managementlogger.py- Logging configuration and utilitiesurl_extractor.py- Specialized URL extraction logicurl_utils.py- Shared URL utility functionsvideo_downloader.py- Core downloader class handling authentication and video extractionscripts/- Utility scriptscheck_firefox.py- Helper tool to verify Firefox configuration with Video Downloader Helper extensionbrowser_audio_diagnostic.py- Tool to diagnose browser audio capture capabilities
To run the unit tests:
# Run all tests
pytest
# Run tests and check for failing tests (look for FAILED in output)
pytest -v | grep FAILED || echo "All tests passed"
# Generate coverage report for all modules
pytest --cov=.
# Get module-specific coverage reports
pytest --cov=url_extractor
pytest --cov=browser_manager
pytest --cov=video_downloader
# Generate detailed coverage report with line numbers of missing coverage
pytest --cov=. --cov-report=term-missing
# Run specific test file
pytest tests/test_url_utils.py
# Run specific test class or method
pytest tests/test_url_extractor.py::TestJavaScriptGeneration
pytest tests/test_url_extractor.py::TestJavaScriptGeneration::test_resolution_script
# Run tests in verbose mode to see individual test results
pytest -v
# Generate HTML coverage report (creates htmlcov directory)
pytest --cov=. --cov-report=htmlTo generate the current test coverage report:
# Generate coverage summary
pytest --cov=.
# Generate detailed coverage with missing lines
pytest --cov=. --cov-report=term-missing
# Generate HTML coverage report
pytest --cov=. --cov-report=htmlKey modules to focus on for coverage improvements:
- url_extractor.py: Handles specialized URL extraction
- url_utils.py: Provides shared URL utility functions
- browser_manager.py: Manages browser initialization and interaction
- logger.py: Configures logging utilities
- 101kg.py: Main entry point script
- video_downloader.py: Core downloader class with complex functionality
- The script logs in, navigates to the lesson page, extracts the video URL, and downloads it.
- For multi-part videos (with "Part 1", "Part 2", etc.), all parts are automatically detected and downloaded.
- Each part of a multi-part video is saved with an appropriate suffix in the filename.
- Game descriptions including instructions, materials needed, and setup steps are saved as text files with the same base filename as the video.
- If the video is in
.m3u8format,ffmpegis required to convert it to MP4. - This script is for personal use only and should not be used to distribute copyrighted material.
- Ensure that your Hotmart credentials are correct.
- If Chrome or WebDriver issues arise, update them:
pip install --upgrade selenium webdriver-manager
- If login fails, Hotmart may have changed its authentication flow, requiring script adjustments.
- For cookie popup issues, the script includes automatic handling - if this fails, please report the issue.
- Run with
--log-level debugfor detailed logs to help troubleshoot issues.
If you encounter download issues with a specific video:
-
First list the available videos:
python 101kg.py --list
Note the index of the problematic video.
-
Try downloading it directly:
python 101kg.py --single 3 --log-level debug
-
If you have a specific URL to test:
python 101kg.py --url "https://vod-akm.play.hotmart.com/video/..." --output "test_video" --log-level debug
-
For Firefox-related issues, use the Firefox configuration checker:
python scripts/check_firefox.py
Or specify a Firefox profile path:
python scripts/check_firefox.py --profile "/path/to/firefox/profile" -
For audio capture problems (when direct browser recording is used):
python scripts/browser_audio_diagnostic.py
This will test if your browser can capture audio from video elements.
-
The script will attempt multiple download methods in sequence:
- Helper approach (mimics browser download helper extensions)
- Direct page navigation and video extraction
- Browser-based download with authenticated session
- Standard HTTP methods with token authentication
- Direct video recording via browser (as last resort)
This project is licensed under the MIT License - see the LICENSE file for details.