Download the PHP package shamimstack/youtube-cloud-storage without Composer
On this page you can find all versions of the php package shamimstack/youtube-cloud-storage. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download shamimstack/youtube-cloud-storage
More information about shamimstack/youtube-cloud-storage
Files in shamimstack/youtube-cloud-storage
Package youtube-cloud-storage
Short Description A Laravel 12 package that turns YouTube into a file storage backend using sign-bit nudging of DCT coefficients and Wirehair fountain codes.
License MIT
Informations about the package youtube-cloud-storage
YouTube Cloud Storage
Transform YouTube into unlimited cloud storage using steganography and fountain codes.
๐ Features
- Unlimited Storage: Upload files to YouTube as private videos
- Steganographic Encoding: Hide data in DCT coefficient signs (invisible to viewers)
- Fountain Code Redundancy: Recover from YouTube's video compression with Wirehair O(N) erasure coding
- Zero-Config Setup: Auto-detects FFmpeg, yt-dlp, and compiles Wirehair if needed
- Laravel Flysystem Integration: Use
Storage::disk('youtube')like any other disk - Artisan Commands: CLI tools for upload/download operations
- Cross-Platform: Windows, Linux, macOS support
- Comprehensive Testing: 30+ test cases with 80%+ code coverage
- Interactive Documentation: Modern responsive website with Tailwind CSS
๐ Documentation
- Quick Start: QUICK_REFERENCE.md - Commands cheat sheet
- Contributing Guide: CONTRIBUTING.md - How to contribute
- Change History: CHANGELOG.md - Version history
- Workflow Diagram: WORKFLOW_DIAGRAM.md - Visual process flow
- Interactive Website: docs/index.html - Responsive documentation site
๐ฆ Installation
Requirements
- PHP 8.4+
- Laravel 12+
- FFI extension enabled (
extension=ffi) - GD extension for image processing (
extension=gd) - FFmpeg (for video encoding/decoding)
- yt-dlp (for YouTube uploads)
- Wirehair library (auto-compiled if not found)
โ๏ธ Quick Setup
Run the interactive setup wizard:
This will:
- โ Auto-detect system binaries (FFmpeg, FFprobe, yt-dlp)
- โ Compile Wirehair from source if needed
- โ Validate all dependencies via health check
- โ Prompt for YouTube OAuth credentials
- โ
Write configuration to
.env
Manual Configuration
Publish the config file:
Edit config/youtube-storage.php:
Add to your .env:
๐ Obtain YouTube Credentials
- Go to Google Cloud Console
- Create/select a project
- Enable YouTube Data API v3
- Go to Credentials โ Create Credentials โ OAuth client ID
- Application type: Web application
- Authorized redirect URIs:
http://localhost/callback - Copy Client ID and Client Secret
- Complete OAuth flow to get Refresh Token
๐พ Usage
Via Storage Facade
Via Artisan Commands
Upload:
Download:
Programmatic Access
๐ง How It Works
Architecture Overview
Package Structure
DCT Steganography
Each video frame undergoes Discrete Cosine Transform (DCT), converting spatial pixels into frequency coefficients. Data is embedded by nudging the sign of selected coefficients:
- Bit 0 โ Make coefficient positive
- Bit 1 โ Make coefficient negative
The magnitude is kept above a threshold (default: 10) to survive YouTube's re-encoding.
Mathematical Foundation:
Fountain Codes for Redundancy
Wirehair implements O(N) fountain codes, generating unlimited repair packets:
- Systematic packets: Original data chunks
- Repair packets: Linear combinations via XOR
Recovery guarantee: Any N + ฮต packets can reconstruct the original file, where ฮต โ 2%.
๐งช Testing
Run the test suite:
Test Suite Breakdown
-
UnitTest.php (372 lines) - Component functionality tests
- Auto-configurator binary detection
- Health check validation
- Property hook validation
- Serialization/deserialization
-
IntegrationTest.php (316 lines) - End-to-end pipeline tests
- Full encode/decode workflow
- Auto-configurator coordination
- Health check integration
- Encoder engine pipeline
- DctAlgorithmTest.php (207 lines) - Mathematical correctness tests
- Forward/inverse DCT roundtrip (pixel-perfect)
- Basis matrix orthonormality (< 0.0001 delta)
- Sign-bit embedding accuracy
- Frame generation validity
Tests cover:
- โ Auto-configurator binary detection
- โ Health check validation
- โ DCT forward/inverse roundtrip (pixel-perfect)
- โ Fountain code recovery thresholds
- โ Full pipeline (encode โ decode)
Composer Scripts
๐ Troubleshooting
Check Dependencies
Common Issues
FFmpeg not found:
Wirehair compilation failed:
YouTube upload quota exceeded:
- YouTube API has daily upload limits
- Use private videos to avoid public quota restrictions
- Wait 24 hours for quota reset
๐ Performance Benchmarks
| File Type | Size | Encode Time | Decode Time | Video Duration | Packets |
|---|---|---|---|---|---|
| Text | 1 MB | ~30s | ~25s | 10 sec | 12 |
| Image | 5 MB | ~2m 30s | ~2m 10s | 50 sec | 60 |
| Archive | 10MB | ~5m | ~4m 30s | 100 sec | 120 |
Benchmarks vary by CPU speed, DCT positions count, and network.
๐ Security Considerations
- Encryption: Files are NOT encrypted by default (steganography only)
- Privacy: Set videos to "private" to prevent public access
- Authentication: OAuth tokens stored in
.env(keep secure!) - Data Integrity: CRC32 checksums verify packet authenticity
๐ฏ Roadmap
- [ ] AES-256 encryption before encoding
- [ ] Batch upload (multiple files per video)
- [ ] Progress callbacks during encode/decode
- [ ] GPU acceleration for DCT operations
- [ ] Multi-threaded packet processing
- [ ] Resume interrupted uploads
- [ ] Automatic chunking for large files (>1GB)
๐ License
MIT License โ See LICENSE for details.
๐ค Contributing
Contributions welcome! Please see our Contributing Guidelines for details.
High Priority Areas
- [ ] AES-256 encryption before encoding
- [ ] Batch upload support (multiple files per video)
- [ ] Progress callbacks during encode/decode operations
- [ ] GPU acceleration for DCT operations via OpenCL
- [ ] Multi-threaded packet processing
- [ ] Automatic chunking for large files (>1GB)
- [ ] Resume interrupted uploads
Development Setup
Code Quality Standards
We maintain high code quality standards:
- PSR-12 coding standards
- PHP 8.4+ features (property hooks, typed constants, readonly classes)
- Strict types enabled everywhere
- PHPStan level 8 static analysis
- Laravel Pint for auto-formatting
๐ Changelog
Version 0.3.0-beta (2026-03-09)
Added:
- Comprehensive test suite (895 lines across 3 files)
- Automated test runner with color-coded output
- Interactive documentation website (Tailwind CSS + Alpine.js)
- Contributing guidelines with code of conduct
- Project overview and implementation summary documents
- Composer scripts for common tasks (test, analyse, format)
- Dev tools: PHPStan ^1.10, Laravel Pint ^1.13
Changed:
- Enhanced documentation structure across all files
- Improved test coverage to estimated 80%+
- Updated composer.json with comprehensive scripts section
Fixed:
- Critical bug: Removed 1,814 lines of duplicate class definitions
- Process streaming in VideoProcessor (now uses Symfony InputStream)
- StorageConfig binary detection errors
Version 0.2.0-beta (2026-03-09)
Added:
- AutoConfigurator class (408 lines) - auto-detects binaries
- HealthCheck class (417 lines) - validates dependencies
- SetupCommand (344 lines) - interactive setup wizard
- YouTubeStorageDriver - Flysystem adapter
- Artisan commands: yt:store, yt:restore, yt:setup
Changed:
- Fixed property hooks for graceful binary handling
- Replaced broken Process::signal() with Symfony InputStream
- Enhanced imports to use proper Symfony components
Fixed:
- Duplicate code removal (1,814 lines across 7 files)
- Process streaming implementation
- Binary detection error handling
Version 0.1.0-alpha (2026-03-09)
Added:
- Initial package structure
- Core components: Service provider, Facade, Driver, DTOs
- Engines: FountainEncoder, VideoProcessor, EncoderEngine
- Exception handling framework (6 custom exceptions)
- Configuration system with publishable config file
- PHP 8.4 features: Property hooks, asymmetric visibility, typed constants
Technical Foundation:
- 2D Discrete Cosine Transform implementation
- Wirehair fountain codes via FFI
- FFmpeg rawvideo pipe streaming
- RGB24 frame generation and DCT embedding
Made with โค๏ธ by Shamim Stack
๐ง Support & Resources
- GitHub Repository: https://github.com/shamimstack/youtube-cloud-storage
- Packagist: https://packagist.org/packages/shamimstack/youtube-cloud-storage
- Interactive Documentation: https://shamimstack.github.io/youtube-cloud-storage/
- Issues: https://github.com/shamimstack/youtube-cloud-storage/issues
- Discussions: https://github.com/shamimstack/youtube-cloud-storage/discussions
๐ Acknowledgments
- Wirehair: Lancashire County Council
- FFmpeg: FFmpeg Team
- yt-dlp: yt-dlp contributors
- Laravel: Taylor Otwell
- Symfony: Process Component
All versions of youtube-cloud-storage with dependencies
ext-ffi Version *
ext-gd Version *
laravel/framework Version ^12.0
google/apiclient Version ^2.0