Laracasts Downloader
A robust Go application that downloads Laracasts topics, series and bits. This tool helps you organize and manage your Laracasts content offline for convenient access and learning.
Note: This project is still in beta mode, not fully implemented yet it downloads all topics, series and bits from Laracasts.
Features
Topic-Based Organization
- Automatically organizes downloads by topics (e.g., Laravel, Vue, Testing, etc.)
- Creates a clean directory structure for easy navigation
- Generates summary files for each topic and an overall download summary
- Maintains metadata for all downloaded content
Concurrent Downloads
- Uses worker pools for efficient parallel downloading
- Handles multiple topics and series simultaneously
- Implements rate limiting to prevent server overload
- Optimizes bandwidth usage with configurable concurrency
Smart Error Handling
- Retries failed downloads with exponential backoff
- Maintains download state to resume interrupted operations
- Creates detailed logs of successes and failures
- Validates downloaded files for integrity
Progress Tracking
- Shows real-time download progress with ETA
- Provides detailed statistics for each topic and series
- Creates summary files with download status and metadata
- Displays bandwidth usage and download speeds
Directory Structure
downloads/
βββ topics/
β βββ Laravel/
β β βββ Laravel Basics/
β β β βββ 01-Introduction-to-Laravel.mp4
β β β βββ 02-Routing-Basics.mp4
β β β βββ series-info.json
β β βββ Advanced Laravel/
β β βββ 01-Service-Containers.mp4
β β βββ series-info.json
β βββ Vue/
β β βββ Vue3-Essentials/
β β βββ 01-Getting-Started.mp4
β β βββ series-info.json
β βββ Testing/
β βββ PHPUnit-Testing/
β βββ 01-Introduction.mp4
β βββ series-info.json
βββ .cache/
βββ downloads/
β βββ download-state.json
βββ series/
β βββ series-metadata.json
βββ state/
βββ app-state.json
Installation
- Ensure you have Go 1.18 or higher installed:
go version
- Install ffmpeg (required for video processing):
# Ubuntu/Debian
sudo apt-get install ffmpeg
# macOS
brew install ffmpeg
# Windows
choco install ffmpeg
- Clone the repository:
git clone https://github.com/sajjadanwar0/laracasts-downloader.git
cd laracasts-downloader
- Install dependencies:
go mod download
Configuration
- Copy the example environment file:
cp .env.example .env
- Configure your environment variables in .env:
EMAIL=your@email.com
PASSWORD=your_password
DOWNLOAD_PATH=/path/to/downloads
VIDEO_QUALITY=1080p # Options: 360p, 540p, 720p, 1080p
CONCURRENT_DOWNLOADS=3
RETRY_ATTEMPTS=3
BUFFER_SIZE=8192
Usage
Basic Usage
Run the downloader to fetch all available content:
go run main.go
The application will:
- Log in to your Laracasts account
- Fetch all available topics
- Create topic directories
- Download all series for each topic
- Generate summary files
Download Specific Series
To download a specific series, use the series flag with the slug:
go run main.go -s the-definition-series
Download All Topics
To download all topics:
go run main.go
Environment Variables
| Variable | Description | Required | Default |
|---|---|---|---|
| Laracasts account email | Yes | - | |
| PASSWORD | Laracasts account password | Yes | - |
| DOWNLOAD_PATH | Download directory path | Yes | - |
| VIDEO_QUALITY | Preferred video quality | No | 1080p |
| CONCURRENT_DOWNLOADS | Number of parallel downloads | No | 3 |
| RETRY_ATTEMPTS | Number of download retry attempts | No | 3 |
| BUFFER_SIZE | Download buffer size in bytes | No | 8192 |
Performance Optimization
The downloader implements several performance optimization strategies:
Buffered Downloads
- Uses buffered I/O for efficient file operations
- Implements configurable buffer sizes
- Minimizes system calls during downloads
Concurrent Processing
- Parallel processing of topics and series
- Worker pools for download management
- Rate limiting to prevent overload
Memory Management
- Efficient memory usage with buffer pools
- Garbage collection optimization
- Memory-conscious file handling
State Management
- Persistent download state
- Resume capability for interrupted downloads
- Efficient metadata caching
Error Handling
The application implements comprehensive error handling:
- Download Retry: Automatically retries failed downloads with exponential backoff
- State Recovery: Maintains download state for recovery after interruptions
- Validation: Checks file integrity after download
- Logging: Creates detailed logs for debugging and troubleshooting
- Error Classification: Categorizes errors for appropriate handling:
- Network errors
- Authentication failures
- File system errors
- Rate limiting issues
Contributing
Contributions are welcome! Please follow these steps:
- Fork the repository
- Create your feature branch:
git checkout -b feature/my-new-feature
- Commit your changes:
git commit -am 'Add some feature'
- Push to the branch:
git push origin feature/my-new-feature
- Submit a pull request
License
This project is licensed under the MIT License - see the LICENSE file for details.
Support
For support, please:
- Create a new issue if your problem isnβt already reported
- Provide detailed information about your problem
- Include relevant logs and configuration
Disclaimer
This tool is for personal use only. Please respect Laracastsβ terms of service and only download content you have access to through a valid subscription.
GitHub:
Thanks.
!