|
| 1 | +# dart_dlp 🚀 |
| 2 | + |
| 3 | +> **The World's First Pure-Dart, Zero-FFmpeg Media Engine for 8K Performance & 1,000+ Site Scalability.** |
| 4 | +
|
| 5 | +[](https://dart.dev) |
| 6 | +[](https://kotlinlang.org) |
| 7 | +[](https://developer.apple.com/swift) |
| 8 | +[](https://github.com/hamas/dart_dlp) |
| 9 | +[](LICENSE) |
| 10 | + |
| 11 | +--- |
| 12 | + |
| 13 | +## 📖 Introduction |
| 14 | + |
| 15 | +**dart_dlp** is a revolutionary media extraction engine designed to liberate Dart and Flutter developers from the constraints of heavy external binaries. Unlike traditional solutions that wrap `yt-dlp` (Python) or require massive `ffmpeg` bundles, `dart_dlp` is built from the ground up to be **Lightweight and Invincible**. |
| 16 | + |
| 17 | +It combines a **Pure Dart** extraction core with a **Native (Kotlin/Swift)** muxing bridge, delivering 8K video streams without a single byte of compiled FFmpeg or Python code. |
| 18 | + |
| 19 | +It is engineered for **Hyper-Scale** and **Stealth**, capable of navigating complex anti-bot protections and executing rolling cipher decryption. |
| 20 | + |
| 21 | +--- |
| 22 | + |
| 23 | +### Why dart_dlp? |
| 24 | + |
| 25 | +1. **Zero External Binaries**: No Python, no node.js. |
| 26 | +2. **Native Muxing**: Uses Android's `MediaMuxer` and iOS's `AVAssetExportSession` to merge 4K video+audio instantly (Zero-Encoding). |
| 27 | +3. **HamasDownloader™**: A proprietary, multi-threaded chunked downloader that saturates your bandwidth by opening parallel connections. |
| 28 | +4. **Stealth Mode**: Rotates between 50+ real-world User-Agents and injects human-like HTTP headers (`Sec-Fetch-*`) to evade IP blocking. |
| 29 | +5. **Architecture**: Decoupled design allows for pure Dart usage (extraction only) or full Flutter Plugin power (muxing enabled). |
| 30 | + |
| 31 | +--- |
| 32 | + |
| 33 | +## ⚙️ Advanced Features |
| 34 | + |
| 35 | +### ⚡ HD Download & Native Muxing (The "Super" Pattern) |
| 36 | +YouTube (and others) often serve 1080p+ video as separate Video and Audio tracks. |
| 37 | +`dart_dlp` handles this automatically using its Native Bridge. |
| 38 | + |
| 39 | +**Zero-FFmpeg Requirement:** |
| 40 | +We utilize the device's native APIs (`MediaMuxer` on Android, `AVAssetExportSession` on iOS) to merge streams instantly without re-encoding. This keeps the app size tiny only adding ~20KB to your bundle, compared to FFmpeg's ~50MB. |
| 41 | + |
| 42 | +**How it works:** |
| 43 | +1. **Detects** if a video is split (e.g., 4K stream). |
| 44 | +2. **Downloads** video and audio tracks concurrently. |
| 45 | +3. **Invokes** the Native Bridge to merge them in seconds. |
| 46 | +4. **Cleans up** temporary files. |
| 47 | + |
| 48 | +```dart |
| 49 | +final controller = DlpController(); |
| 50 | +
|
| 51 | +// 1. Get Video Data |
| 52 | +final videoData = await engine.extract('https://tiktok.com/...'); |
| 53 | +
|
| 54 | +// 2. Start Download (Auto-Muxing handled internally) |
| 55 | +controller.state.listen((state) { |
| 56 | + if (state.status == DlpStatus.downloading) { |
| 57 | + print('Downloading... ${state.progress?.percentage.toStringAsFixed(1)}%'); |
| 58 | + } else if (state.status == DlpStatus.completed) { |
| 59 | + print('Done! File at: ${state.message}'); |
| 60 | + } |
| 61 | +}); |
| 62 | +
|
| 63 | +await controller.startDownload(videoData, '/downloads/'); |
| 64 | +final path = await controller.startDownload(videoData, '/storage/emulated/0/Download'); |
| 65 | +print('Saved to: $path'); |
| 66 | +``` |
| 67 | + |
| 68 | +--- |
| 69 | + |
| 70 | +## 🛡️ Stealth Technology |
| 71 | + |
| 72 | +To ensure longevity, `dart_dlp` mimics human behavior. |
| 73 | + |
| 74 | +1. **User-Agent Rotation**: Every request pulls from a library of 50+ modern User-Agents (Chrome, Firefox, Safari on Windows, Mac, Linux). |
| 75 | +2. **Request Factory**: We inject trusted headers (`Sec-Fetch-Mode: navigate`, `Sec-Fetch-Site: none`) to bypass "naive" bot filters. |
| 76 | +3. **Proxy Injection**: Support for residential proxies via the `proxy` parameter allows for massive scraping operations (100k+ requests/day). |
| 77 | + |
| 78 | +--- |
| 79 | + |
| 80 | +## 🔮 Extending dart_dlp |
| 81 | + |
| 82 | +We built a factory tool so you can add support for new sites in seconds. |
| 83 | + |
| 84 | +### The Hamas Factory |
| 85 | +Use the CLI tool to generate a new extractor template. This ensures your code complies with our strict architectural standards. |
| 86 | + |
| 87 | +```bash |
| 88 | +dart run bin/hamas_factory.dart my_new_site |
| 89 | +``` |
| 90 | + |
| 91 | +**Output:** `lib/src/extractors/my_new_site_extractor.dart` |
| 92 | + |
| 93 | +This file comes pre-loaded with: |
| 94 | +- `/// Developed by Hamas` header. |
| 95 | +- `JsonScraper` mixin. |
| 96 | +- Correct `canHandle` and `extract` signatures. |
| 97 | + |
| 98 | +--- |
| 99 | + |
| 100 | +## ⚠️ Disclaimer |
| 101 | +**dart_dlp** is an educational tool designed for interoperability and data portability. Use this engine responsibly and respect the Terms of Service of the platforms you interact with. |
| 102 | + |
| 103 | +--- |
| 104 | + |
| 105 | +## 🔒 Strict Ownership & Security |
| 106 | +**dart_dlp** is protected by a strict security policy. |
| 107 | + |
| 108 | +- **Owner-Only Access**: Only the repository creator (@Hamas) is authorized to approve changes, merge Pull Requests, or modify the repository configuration. |
| 109 | +- **Documentation Locked**: The `README.md` and `CONTRIBUTING.md` files define the laws of this repository. **No one else is permitted to edit, alter, or dilute these rules.** Any Pull Request attempting to modify these files without explicit prior authorization will be closed and the user blocked. |
| 110 | + |
| 111 | +--- |
| 112 | + |
| 113 | +/// Developed by Hamas | dart_dlp Engine |
0 commit comments