haustus 1.0.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (65) hide show
  1. haustus-1.0.0/LICENSE +21 -0
  2. haustus-1.0.0/MANIFEST.in +3 -0
  3. haustus-1.0.0/PKG-INFO +321 -0
  4. haustus-1.0.0/README.md +283 -0
  5. haustus-1.0.0/core/__init__.py +18 -0
  6. haustus-1.0.0/core/archive.py +649 -0
  7. haustus-1.0.0/core/config.py +566 -0
  8. haustus-1.0.0/core/constants.py +128 -0
  9. haustus-1.0.0/core/cookies.py +1808 -0
  10. haustus-1.0.0/core/engine.py +287 -0
  11. haustus-1.0.0/core/instances.py +8 -0
  12. haustus-1.0.0/core/media.py +266 -0
  13. haustus-1.0.0/core/py.typed +1 -0
  14. haustus-1.0.0/core/resilience.py +286 -0
  15. haustus-1.0.0/core/urls.py +45 -0
  16. haustus-1.0.0/core/ytdl_format.py +54 -0
  17. haustus-1.0.0/features/__init__.py +1 -0
  18. haustus-1.0.0/features/audio_mode.py +184 -0
  19. haustus-1.0.0/features/bulk_file.py +78 -0
  20. haustus-1.0.0/features/downloader.py +752 -0
  21. haustus-1.0.0/features/paste_urls.py +75 -0
  22. haustus-1.0.0/features/playlist.py +58 -0
  23. haustus-1.0.0/features/profile.py +405 -0
  24. haustus-1.0.0/features/py.typed +1 -0
  25. haustus-1.0.0/features/reposts.py +140 -0
  26. haustus-1.0.0/features/saved_posts.py +484 -0
  27. haustus-1.0.0/features/settings.py +827 -0
  28. haustus-1.0.0/features/single_download.py +100 -0
  29. haustus-1.0.0/haustus.egg-info/PKG-INFO +321 -0
  30. haustus-1.0.0/haustus.egg-info/SOURCES.txt +63 -0
  31. haustus-1.0.0/haustus.egg-info/dependency_links.txt +1 -0
  32. haustus-1.0.0/haustus.egg-info/entry_points.txt +2 -0
  33. haustus-1.0.0/haustus.egg-info/requires.txt +9 -0
  34. haustus-1.0.0/haustus.egg-info/top_level.txt +5 -0
  35. haustus-1.0.0/haustus.py +678 -0
  36. haustus-1.0.0/platforms/__init__.py +1 -0
  37. haustus-1.0.0/platforms/base.py +137 -0
  38. haustus-1.0.0/platforms/facebook.py +185 -0
  39. haustus-1.0.0/platforms/instagram.py +752 -0
  40. haustus-1.0.0/platforms/pinterest.py +260 -0
  41. haustus-1.0.0/platforms/py.typed +1 -0
  42. haustus-1.0.0/platforms/reddit.py +459 -0
  43. haustus-1.0.0/platforms/soundcloud.py +174 -0
  44. haustus-1.0.0/platforms/spotify.py +366 -0
  45. haustus-1.0.0/platforms/threads.py +223 -0
  46. haustus-1.0.0/platforms/tiktok.py +639 -0
  47. haustus-1.0.0/platforms/twitch.py +151 -0
  48. haustus-1.0.0/platforms/x_twitter.py +549 -0
  49. haustus-1.0.0/platforms/youtube.py +307 -0
  50. haustus-1.0.0/pyproject.toml +85 -0
  51. haustus-1.0.0/setup.cfg +4 -0
  52. haustus-1.0.0/tests/__init__.py +1 -0
  53. haustus-1.0.0/tests/helpers.py +49 -0
  54. haustus-1.0.0/tests/test_architecture.py +250 -0
  55. haustus-1.0.0/tests/test_config.py +122 -0
  56. haustus-1.0.0/tests/test_helpers.py +766 -0
  57. haustus-1.0.0/tests/test_media.py +126 -0
  58. haustus-1.0.0/tests/test_platforms.py +544 -0
  59. haustus-1.0.0/tests/test_ui.py +303 -0
  60. haustus-1.0.0/ui/__init__.py +1 -0
  61. haustus-1.0.0/ui/components.py +688 -0
  62. haustus-1.0.0/ui/dashboard.py +803 -0
  63. haustus-1.0.0/ui/py.typed +1 -0
  64. haustus-1.0.0/ui/quality.py +869 -0
  65. haustus-1.0.0/ui/theme.py +454 -0
haustus-1.0.0/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Adham Mohamed (Sonata-Of-Death)
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,3 @@
1
+ include LICENSE README.md CHANGELOG.md
2
+ recursive-include tests *.py
3
+ prune assets
haustus-1.0.0/PKG-INFO ADDED
@@ -0,0 +1,321 @@
1
+ Metadata-Version: 2.4
2
+ Name: haustus
3
+ Version: 1.0.0
4
+ Summary: High-throughput terminal media downloader, audio mastering, and transcoding workstation.
5
+ Author-email: Adham Mohamed <sonataofdeathprojects@gmail.com>
6
+ License-Expression: MIT
7
+ Project-URL: Homepage, https://github.com/Sonata-Of-Death/Haustus
8
+ Project-URL: Documentation, https://github.com/Sonata-Of-Death/Haustus#readme
9
+ Project-URL: Repository, https://github.com/Sonata-Of-Death/Haustus
10
+ Project-URL: Bug Tracker, https://github.com/Sonata-Of-Death/Haustus/issues
11
+ Project-URL: Changelog, https://github.com/Sonata-Of-Death/Haustus/blob/main/CHANGELOG.md
12
+ Keywords: downloader,yt-dlp,youtube-dl,media-downloader,video-downloader,audio-mastering,terminal-ui,rich,instagram,tiktok,youtube,threads,spotify
13
+ Classifier: Development Status :: 5 - Production/Stable
14
+ Classifier: Environment :: Console
15
+ Classifier: Intended Audience :: End Users/Desktop
16
+ Classifier: Intended Audience :: Developers
17
+ Classifier: Operating System :: OS Independent
18
+ Classifier: Programming Language :: Python :: 3
19
+ Classifier: Programming Language :: Python :: 3.10
20
+ Classifier: Programming Language :: Python :: 3.11
21
+ Classifier: Programming Language :: Python :: 3.12
22
+ Classifier: Programming Language :: Python :: 3.13
23
+ Classifier: Topic :: Multimedia :: Video
24
+ Classifier: Topic :: Multimedia :: Sound/Audio
25
+ Classifier: Topic :: Utilities
26
+ Requires-Python: >=3.10
27
+ Description-Content-Type: text/markdown
28
+ License-File: LICENSE
29
+ Requires-Dist: yt-dlp>=2025.1.0
30
+ Requires-Dist: requests>=2.31.0
31
+ Requires-Dist: rich>=13.7.0
32
+ Requires-Dist: mutagen>=1.47.0
33
+ Requires-Dist: imageio-ffmpeg>=0.5.0
34
+ Provides-Extra: dev
35
+ Requires-Dist: ruff>=0.4; extra == "dev"
36
+ Requires-Dist: build>=1.0; extra == "dev"
37
+ Dynamic: license-file
38
+
39
+ <h1>
40
+ <img alt="Haustus" src="https://raw.githubusercontent.com/Sonata-Of-Death/Haustus/main/assets/haustus-dark.svg#gh-dark-mode-only" height="96">
41
+ <img alt="Haustus" src="https://raw.githubusercontent.com/Sonata-Of-Death/Haustus/main/assets/haustus-light.svg#gh-light-mode-only" height="96">
42
+ </h1>
43
+
44
+ ### Terminal Media Downloader, Audio Mastering & Transcoding Workstation
45
+
46
+ **Haustus** is a high-throughput CLI and TUI media workstation supporting **11 Dedicated Platforms** and **Universal Ingestion for 1000+ Websites** (via yt-dlp) and direct media streams. Built with Python, yt-dlp, Rich, Mutagen, and imageio-ffmpeg.
47
+
48
+ <p align="center">
49
+ <a href="https://github.com/Sonata-Of-Death/Haustus/actions/workflows/ci.yml"><img alt="CI" src="https://img.shields.io/github/actions/workflow/status/Sonata-Of-Death/Haustus/ci.yml?branch=main&label=CI&labelColor=1B1917&style=for-the-badge" height="28"></a>
50
+ <img alt="license" src="https://img.shields.io/badge/license-MIT-E87A24?labelColor=1B1917&style=for-the-badge" height="28">
51
+ <img alt="version" src="https://img.shields.io/badge/version-1.0.0-C8A96E?labelColor=1B1917&style=for-the-badge" height="28">
52
+ <img alt="python" src="https://img.shields.io/badge/python-3.10+-C8A96E?labelColor=1B1917&style=for-the-badge" height="28">
53
+ </p>
54
+
55
+ ---
56
+
57
+ ## Quick Start
58
+
59
+ ### 1. Install
60
+ ```bash
61
+ pip install haustus
62
+ ```
63
+ Or from source:
64
+ ```bash
65
+ git clone https://github.com/Sonata-Of-Death/Haustus.git
66
+ cd Haustus
67
+ pip install -e .
68
+ ```
69
+
70
+ ### 2. Run
71
+ ```bash
72
+ # Interactive Arrow-Key Menu
73
+ haustus
74
+
75
+ # Or download any media link directly in best quality
76
+ haustus "https://www.youtube.com/watch?v=..."
77
+ ```
78
+
79
+ ---
80
+
81
+ ## Architecture Overview
82
+
83
+ ```text
84
+ ┌─────────────────────────────────────────────────────────────────────────────┐
85
+ │ USER INTERFACE (TUI / CLI) │
86
+ │ ┌───────────────────────────────────────────────────────────────────────┐ │
87
+ │ │ Interactive Arrow-Key Menu (Single Enter, Instant [Esc] Return) │ │
88
+ │ │ Fast Terminal Navigation, Multi-Profile Sessions & Preset Defaults │ │
89
+ │ └───────────────────────────────────────────────────────────────────────┘ │
90
+ └──────────────────────────────────────┬──────────────────────────────────────┘
91
+ │
92
+ ┌──────────────────────────────────────▼──────────────────────────────────────┐
93
+ │ CORE INGESTION & NETWORK RESILIENCE │
94
+ │ ┌──────────────────────────┐ ┌───────────────────┐ ┌───────────────────┐ │
95
+ │ │ Multi-Profile Sessions │ │ Adaptive Network │ │ Session Ledger │ │
96
+ │ │ Isolated Temp Storage │ │ Full Jitter + CB │ │ Atomic Checkpoint │ │
97
+ │ └──────────────────────────┘ └───────────────────┘ └───────────────────┘ │
98
+ │ ┌────────────────────────────────────────────────────────────────────────┐ │
99
+ │ │ High-Throughput Engine: 16-Stream aria2c + Token-Bucket Pacing │ │
100
+ │ └────────────────────────────────────────────────────────────────────────┘ │
101
+ │ ┌────────────────────────────────────────────────────────────────────────┐ │
102
+ │ │ Rich Live Dashboard: Real-time Speed, ETA, Percentage, Size │ │
103
+ │ └────────────────────────────────────────────────────────────────────────┘ │
104
+ │ ┌────────────────────────────────────────────────────────────────────────┐ │
105
+ │ │ Smart History & Missing File Ledger (Atomic Verification) │ │
106
+ │ └────────────────────────────────────────────────────────────────────────┘ │
107
+ └──────────────────────────────────────┬──────────────────────────────────────┘
108
+ │
109
+ ┌──────────────────────────────────────▼──────────────────────────────────────┐
110
+ │ STUDIO MEDIA POST-PROCESSING │
111
+ │ ┌──────────────────────────┐ ┌───────────────────┐ ┌───────────────────┐ │
112
+ │ │ GPU Video Transcoding │ │ EBU R128 Audio │ │ Subtitle Embedder │ │
113
+ │ │ NVENC / VAAPI / SVT-AV1 │ │ Two-Pass -16 LUFS │ │ Soft Mux (.srt) │ │
114
+ │ └──────────────────────────┘ └───────────────────┘ └───────────────────┘ │
115
+ │ ┌────────────────────────────────────────────────────────────────────────┐ │
116
+ │ │ Mutagen ID3v2.4 & MP4 Cover Art / Metadata Atom Injection │ │
117
+ │ └────────────────────────────────────────────────────────────────────────┘ │
118
+ └─────────────────────────────────────────────────────────────────────────────┘
119
+ ```
120
+
121
+ ---
122
+
123
+ ## Supported Platforms
124
+
125
+ | Platform | Supported Media | Requires Cookies? |
126
+ | :--- | :--- | :--- |
127
+ | **Instagram** | Full HD Reels, Photo Carousels in subfolders, 24h Stories, Story Highlights, Saved Posts, Reposts | Optional (Required for Stories & Saved) |
128
+ | **TikTok** | Watermark-free HD Videos, Photo Slideshow albums, Original Music, Saved / Favorites, Collections, Reposts | Optional (Required for Favorites) |
129
+ | **YouTube** | Up to 4K/1080p with audio, Shorts, Interactive Playlist picker (Watch Later, Liked), Full Channels | Optional (Age-gate / Private) |
130
+ | **X (Twitter)** | Full HD media tweets, video broadcasts, photo sets, Bookmarks, Retweets, Archive ingestion (`bookmarks.json`) | Optional (Required for Bookmarks) |
131
+ | **SoundCloud** | Audio tracks, sets, artist discographies, user liked tracks with cover art embedding | Optional (Required for Liked) |
132
+ | **Reddit** | DASH video with merged audio, multi-image galleries, Subreddit feeds (Hot/Top/New), Saved / Upvoted | Optional (Required for Saved / Upvoted) |
133
+ | **Facebook** | Full HD/SD Reels, Public video posts, Watch URLs, short links (`fb.watch`), Saved collections | Optional (Required for Saved) |
134
+ | **Pinterest** | Video pins, original uncompressed images (`/originals/` CDN pattern) with metadata JSON, full Boards | Optional (Required for Saved Boards) |
135
+ | **Twitch** | Stream clips (`clips.twitch.tv`), past broadcasts (VODs), channel archives, audio extraction | Optional (Required for Sub-only VODs) |
136
+ | **Threads** | Single post videos, original high-resolution photo carousels with `metadata.json`, creator profiles | Optional |
137
+ | **Spotify** | Track/Album/Playlist metadata & cover art resolution with high-fidelity audio discovery | Optional (Session via `sp_dc`) |
138
+ | **1000+ Universal Sites** | Vimeo, Bilibili, Dailymotion, Loom, Streamable, Rumble, Bandcamp, and direct media URLs | No |
139
+
140
+ > [!NOTE]
141
+ > Third-party platforms frequently update their web interfaces, layout APIs, and anti-scraping mechanisms. Features like watermark-free extraction, Spotify track resolution, and authenticated bookmarks rely on upstream availability.
142
+
143
+ ---
144
+
145
+ ## System Requirements
146
+
147
+ - **Python**: `>= 3.10`
148
+ - **FFmpeg**: Handled automatically via `imageio-ffmpeg` or discovered from system PATH.
149
+ - **aria2c** *(Optional)*: Required only when passing the `--aria2` multi-stream acceleration flag. Install via your package manager:
150
+ - Windows: `winget install aria2` or `choco install aria2`
151
+ - macOS: `brew install aria2`
152
+ - Linux: `sudo apt install aria2`
153
+
154
+ ---
155
+
156
+ ## Usage
157
+
158
+ ### 1. Interactive Menu (TUI)
159
+ Run without arguments to launch the interactive arrow-key interface:
160
+ ```bash
161
+ haustus
162
+ ```
163
+ - **Arrow Keys (`Up` / `Down`)** or **`W` / `S`**: Move selection.
164
+ - **Single Enter**: Confirm selection.
165
+ - **Number Keys (`0` - `9`)**: Quick jump to numbered item.
166
+ - **`[H]` or `[?]`**: Open / close keyboard shortcuts help overlay.
167
+ - **`[Esc]`**: Return to previous menu or abort prompt.
168
+
169
+ ### 2. Common CLI Commands
170
+
171
+ #### Single Media Downloads
172
+ ```bash
173
+ # 1080p Video
174
+ haustus "https://www.youtube.com/watch?v=..." -q 1080
175
+
176
+ # 320 kbps Audiophile MP3 with Embedded Cover Art & ID3 Tags
177
+ haustus "https://www.youtube.com/watch?v=..." -a -aq 320 -af mp3 --embed-metadata
178
+
179
+ # Specific Clip Range (HH:MM:SS format)
180
+ haustus "https://www.youtube.com/watch?v=..." --clip "01:20-03:45"
181
+
182
+ # Bandwidth Speed Limit Capped at 2 MB/s
183
+ haustus "https://www.youtube.com/watch?v=..." --speed-limit 2M
184
+ ```
185
+
186
+ #### Batch & Smart Filters
187
+ ```bash
188
+ # Batch download from text file (one URL per line)
189
+ haustus -f links.txt
190
+
191
+ # Cap playlist download at first 20 items uploaded in the last 7 days
192
+ haustus -p "https://www.youtube.com/playlist?list=..." --count-limit 20 --date-after now-7days
193
+
194
+ # Shorts only under 60 seconds
195
+ haustus -u "@channel" --shorts-only
196
+
197
+ # Specific items in a playlist
198
+ haustus -p "https://www.youtube.com/playlist?list=..." --items "1,3,5-10"
199
+ ```
200
+
201
+ #### Authenticated Collections
202
+ ```bash
203
+ # Instagram Saved Posts & Stories
204
+ haustus --saved
205
+ haustus --instagram-stories "@creator"
206
+
207
+ # TikTok Saved Favorites & Reposts
208
+ haustus --tiktok-saved
209
+ haustus --tiktok-reposts
210
+
211
+ # X (Twitter) Bookmarks
212
+ haustus --x-bookmarks
213
+
214
+ # Reddit Subreddit Feed Batch
215
+ haustus --reddit-subreddit "EarthPorn" --reddit-sort top --reddit-timeframe week
216
+
217
+ # Spotify Playlist to 320k Tagged MP3s
218
+ haustus --spotify-playlist "https://open.spotify.com/playlist/..." --audio-quality 320
219
+ ```
220
+
221
+ ---
222
+
223
+ ## Command Line Arguments Reference
224
+
225
+ | Flag | Long Flag | Description | Default |
226
+ | :--- | :--- | :--- | :--- |
227
+ | `urls` | | Positional URL(s) from 11 platforms or 1000+ universal sites | None |
228
+ | `-f` | `--file` | Path to text file containing URLs (one per line) | None |
229
+ | `-u` | `--user` | Username or profile/channel URL | None |
230
+ | `-p` | `--playlist` | YouTube playlist URL | None |
231
+ | `-q` | `--quality` | Target video resolution (`best`, `2160`, `1440`, `1080`, `720`, `480`, `360`) | `best` |
232
+ | `-a` | `--audio` | Enable Audio-Only extraction mode | `False` |
233
+ | `-aq`| `--audio-quality` | Audio bitrate (`320`, `256`, `192`, `128`, `64`, `best`) | `192` |
234
+ | `-af`| `--audio-format` | Audio container format (`mp3`, `m4a`, `flac`, `wav`, `opus`) | `mp3` |
235
+ | `-o` | `--output` | Destination directory for downloaded media | `~/Desktop/HaustusDownloads` |
236
+ | `-c` | `--cookies` | Path to Netscape `cookies.txt` or raw cookie token string | None |
237
+ | | `--clip` | Download specific time range only (e.g. `01:20-03:45`) | None |
238
+ | | `--subtitles` | Download and embed subtitles (.srt / .vtt) into media container | `False` |
239
+ | | `--speed-limit` | Download bandwidth rate limit (e.g. `2M`, `5M`, `10M`, `500K`) | None |
240
+ | | `--embed-metadata` | Force embedding thumbnail cover art and metadata tags | None |
241
+ | | `--no-embed-metadata`| Force disabling embedding cover art and metadata tags | None |
242
+ | | `--count-limit` | Cap download batch at maximum number of items | None |
243
+ | | `--date-after` | Filter items uploaded after date (`YYYYMMDD` or `now-7days`) | None |
244
+ | | `--shorts-only` | Download short videos only (`<= 60s`) | `False` |
245
+ | | `--items` | Specify playlist item indices or range (e.g. `1,3,5-10`) | None |
246
+ | | `--archive` | Force checking download history archive | None |
247
+ | | `--no-archive` | Force ignoring download history archive | None |
248
+ | | `--saved` | Download all saved posts from authenticated Instagram account | `False` |
249
+ | | `--instagram-stories` | Download active 24h Instagram Stories for username | None |
250
+ | | `--instagram-highlights` | Download Instagram Story Highlights for username | None |
251
+ | | `--instagram-reposts`| Download reposted posts and reels from Instagram account | `False` |
252
+ | | `--instagram-json` | Path to Instagram data export JSON file | None |
253
+ | | `--tiktok-saved` | Download favorite videos from authenticated TikTok account | `False` |
254
+ | | `--tiktok-reposts`| Download reposted videos from authenticated TikTok account | `False` |
255
+ | | `--tiktok-cookies` | Netscape cookies file or raw TikTok sessionid | None |
256
+ | | `--tiktok-collection` | URL of TikTok collection to batch download | None |
257
+ | | `--tiktok-json` | Path to TikTok user_data.json data export file | None |
258
+ | | `--x-bookmarks` | Download saved bookmarks from authenticated X account | `False` |
259
+ | | `--x-reposts` | Download reposted tweets/media from authenticated X account | `False` |
260
+ | | `--x-cookies` | Netscape cookies file or raw X auth_token | None |
261
+ | | `--x-json` | Path to X archive JSON or JS file (bookmarks.json, tweets.json) | None |
262
+ | | `--soundcloud-likes` | Download liked tracks for SoundCloud username or URL | None |
263
+ | | `--soundcloud-cookies` | Netscape cookies file or raw SoundCloud oauth_token | None |
264
+ | | `--reddit-saved` | Download saved posts from authenticated Reddit account | `False` |
265
+ | | `--reddit-upvoted` | Download upvoted posts from authenticated Reddit account | `False` |
266
+ | | `--reddit-subreddit` | Subreddit name or URL to download in bulk | None |
267
+ | | `--reddit-sort` | Subreddit sorting order (`hot`, `new`, `top`, `rising`) | `hot` |
268
+ | | `--reddit-timeframe` | Subreddit time window (`hour`, `day`, `week`, `month`, `year`, `all`) | `day` |
269
+ | | `--reddit-cookies` | Netscape cookies file or raw Reddit session token | None |
270
+ | | `--facebook-saved` | Download saved videos from authenticated Facebook account | `False` |
271
+ | | `--facebook-cookies` | Netscape cookies file or raw Facebook c_user/xs cookie string | None |
272
+ | | `--pinterest-board` | URL of Pinterest board to batch download | None |
273
+ | | `--pinterest-saved` | Download saved pins and boards from authenticated Pinterest account | `False` |
274
+ | | `--pinterest-cookies`| Netscape cookies file or raw Pinterest _pinterest_sess token | None |
275
+ | | `--twitch-channel` | Twitch streamer/channel URL to batch download clips/VODs | None |
276
+ | | `--twitch-cookies` | Netscape cookies file or raw auth-token for Twitch | None |
277
+ | | `--threads-profile` | Threads username or profile URL to batch download | None |
278
+ | | `--threads-cookies` | Netscape cookies file or raw sessionid for Threads | None |
279
+ | | `--spotify-playlist`| Spotify playlist, album, or collection URL to batch download | None |
280
+ | | `--spotify-cookies` | Netscape cookies file or raw sp_dc token for Spotify | None |
281
+ | | `--aria2` | Enable 16-connection segmented multi-stream download via aria2c | `False` |
282
+ | | `--normalize` | Enable two-pass EBU R128 (-16 LUFS) loudness normalization | `False` |
283
+ | | `--transcode` | Enable GPU-accelerated video transcoding (NVENC/VAAPI/AV1) | `False` |
284
+ | | `--parallel` | Enable high-throughput multi-threaded parallel batch execution | `False` |
285
+ | | `--delay` | Polite delay in seconds between download requests | `2.0` |
286
+ | | `--proxy` | HTTP/HTTPS/SOCKS5 proxy URI (e.g. `http://127.0.0.1:7890`) | None |
287
+
288
+ ---
289
+
290
+ ## Troubleshooting
291
+
292
+ - **HTTP 429 Too Many Requests**: The platform is rate-limiting your IP. Use `--delay 5.0` to throttle requests, or configure a proxy with `--proxy`.
293
+ - **Session Expired / Authentication Failed**: Cookies expire over time. Open `haustus` -> Settings -> Accounts and re-enter your updated session token or Netscape cookies file.
294
+ - **aria2c executable not found**: Ensure `aria2c` is installed and reachable on your system PATH before using `--aria2`.
295
+ - **Unclosed Terminal Buffers on Windows**: Haustus automatically configures UTF-8 and ANSI escape sequence processing on Windows terminals. If running in legacy cmd.exe, prefer Windows Terminal or PowerShell 7+.
296
+
297
+ ---
298
+
299
+ ## Testing
300
+
301
+ The test suite covers configuration persistence, cookie isolation, network resilience backoff, format extraction, platform dispatchers, and UI components:
302
+
303
+ ```bash
304
+ python -m unittest discover -s tests
305
+ ```
306
+
307
+ ---
308
+
309
+ ## Disclaimer & Legal Notice
310
+
311
+ Haustus is designed and intended strictly for personal, educational, and backup archiving purposes. Users are solely responsible for ensuring that their media downloads comply with the Terms of Service of each respective platform and respect the copyrights and intellectual property rights of content creators. The developers assume no liability for misuse.
312
+
313
+ ---
314
+
315
+ ## License
316
+
317
+ Released under the MIT License. Copyright (c) 2026 Adham Mohamed (Sonata-Of-Death).
318
+
319
+ > **Third-Party Notice**: Haustus utilizes open-source libraries including `yt-dlp` (Unlicense), `requests` (Apache-2.0), `rich` (MIT), and `imageio-ffmpeg` (BSD-2-Clause).
320
+ > - `mutagen` is licensed under GPL-2.0-or-later; it is installed separately from PyPI as an external dependency and is not bundled or distributed with this source code repository.
321
+ > - `imageio-ffmpeg` downloads or uses an external FFmpeg binary build which may be compiled under GPL (or LGPL depending on enabled codecs and build flags), which is also retrieved independently at runtime and is not distributed as part of this codebase.
@@ -0,0 +1,283 @@
1
+ <h1>
2
+ <img alt="Haustus" src="https://raw.githubusercontent.com/Sonata-Of-Death/Haustus/main/assets/haustus-dark.svg#gh-dark-mode-only" height="96">
3
+ <img alt="Haustus" src="https://raw.githubusercontent.com/Sonata-Of-Death/Haustus/main/assets/haustus-light.svg#gh-light-mode-only" height="96">
4
+ </h1>
5
+
6
+ ### Terminal Media Downloader, Audio Mastering & Transcoding Workstation
7
+
8
+ **Haustus** is a high-throughput CLI and TUI media workstation supporting **11 Dedicated Platforms** and **Universal Ingestion for 1000+ Websites** (via yt-dlp) and direct media streams. Built with Python, yt-dlp, Rich, Mutagen, and imageio-ffmpeg.
9
+
10
+ <p align="center">
11
+ <a href="https://github.com/Sonata-Of-Death/Haustus/actions/workflows/ci.yml"><img alt="CI" src="https://img.shields.io/github/actions/workflow/status/Sonata-Of-Death/Haustus/ci.yml?branch=main&label=CI&labelColor=1B1917&style=for-the-badge" height="28"></a>
12
+ <img alt="license" src="https://img.shields.io/badge/license-MIT-E87A24?labelColor=1B1917&style=for-the-badge" height="28">
13
+ <img alt="version" src="https://img.shields.io/badge/version-1.0.0-C8A96E?labelColor=1B1917&style=for-the-badge" height="28">
14
+ <img alt="python" src="https://img.shields.io/badge/python-3.10+-C8A96E?labelColor=1B1917&style=for-the-badge" height="28">
15
+ </p>
16
+
17
+ ---
18
+
19
+ ## Quick Start
20
+
21
+ ### 1. Install
22
+ ```bash
23
+ pip install haustus
24
+ ```
25
+ Or from source:
26
+ ```bash
27
+ git clone https://github.com/Sonata-Of-Death/Haustus.git
28
+ cd Haustus
29
+ pip install -e .
30
+ ```
31
+
32
+ ### 2. Run
33
+ ```bash
34
+ # Interactive Arrow-Key Menu
35
+ haustus
36
+
37
+ # Or download any media link directly in best quality
38
+ haustus "https://www.youtube.com/watch?v=..."
39
+ ```
40
+
41
+ ---
42
+
43
+ ## Architecture Overview
44
+
45
+ ```text
46
+ ┌─────────────────────────────────────────────────────────────────────────────┐
47
+ │ USER INTERFACE (TUI / CLI) │
48
+ │ ┌───────────────────────────────────────────────────────────────────────┐ │
49
+ │ │ Interactive Arrow-Key Menu (Single Enter, Instant [Esc] Return) │ │
50
+ │ │ Fast Terminal Navigation, Multi-Profile Sessions & Preset Defaults │ │
51
+ │ └───────────────────────────────────────────────────────────────────────┘ │
52
+ └──────────────────────────────────────┬──────────────────────────────────────┘
53
+ │
54
+ ┌──────────────────────────────────────▼──────────────────────────────────────┐
55
+ │ CORE INGESTION & NETWORK RESILIENCE │
56
+ │ ┌──────────────────────────┐ ┌───────────────────┐ ┌───────────────────┐ │
57
+ │ │ Multi-Profile Sessions │ │ Adaptive Network │ │ Session Ledger │ │
58
+ │ │ Isolated Temp Storage │ │ Full Jitter + CB │ │ Atomic Checkpoint │ │
59
+ │ └──────────────────────────┘ └───────────────────┘ └───────────────────┘ │
60
+ │ ┌────────────────────────────────────────────────────────────────────────┐ │
61
+ │ │ High-Throughput Engine: 16-Stream aria2c + Token-Bucket Pacing │ │
62
+ │ └────────────────────────────────────────────────────────────────────────┘ │
63
+ │ ┌────────────────────────────────────────────────────────────────────────┐ │
64
+ │ │ Rich Live Dashboard: Real-time Speed, ETA, Percentage, Size │ │
65
+ │ └────────────────────────────────────────────────────────────────────────┘ │
66
+ │ ┌────────────────────────────────────────────────────────────────────────┐ │
67
+ │ │ Smart History & Missing File Ledger (Atomic Verification) │ │
68
+ │ └────────────────────────────────────────────────────────────────────────┘ │
69
+ └──────────────────────────────────────┬──────────────────────────────────────┘
70
+ │
71
+ ┌──────────────────────────────────────▼──────────────────────────────────────┐
72
+ │ STUDIO MEDIA POST-PROCESSING │
73
+ │ ┌──────────────────────────┐ ┌───────────────────┐ ┌───────────────────┐ │
74
+ │ │ GPU Video Transcoding │ │ EBU R128 Audio │ │ Subtitle Embedder │ │
75
+ │ │ NVENC / VAAPI / SVT-AV1 │ │ Two-Pass -16 LUFS │ │ Soft Mux (.srt) │ │
76
+ │ └──────────────────────────┘ └───────────────────┘ └───────────────────┘ │
77
+ │ ┌────────────────────────────────────────────────────────────────────────┐ │
78
+ │ │ Mutagen ID3v2.4 & MP4 Cover Art / Metadata Atom Injection │ │
79
+ │ └────────────────────────────────────────────────────────────────────────┘ │
80
+ └─────────────────────────────────────────────────────────────────────────────┘
81
+ ```
82
+
83
+ ---
84
+
85
+ ## Supported Platforms
86
+
87
+ | Platform | Supported Media | Requires Cookies? |
88
+ | :--- | :--- | :--- |
89
+ | **Instagram** | Full HD Reels, Photo Carousels in subfolders, 24h Stories, Story Highlights, Saved Posts, Reposts | Optional (Required for Stories & Saved) |
90
+ | **TikTok** | Watermark-free HD Videos, Photo Slideshow albums, Original Music, Saved / Favorites, Collections, Reposts | Optional (Required for Favorites) |
91
+ | **YouTube** | Up to 4K/1080p with audio, Shorts, Interactive Playlist picker (Watch Later, Liked), Full Channels | Optional (Age-gate / Private) |
92
+ | **X (Twitter)** | Full HD media tweets, video broadcasts, photo sets, Bookmarks, Retweets, Archive ingestion (`bookmarks.json`) | Optional (Required for Bookmarks) |
93
+ | **SoundCloud** | Audio tracks, sets, artist discographies, user liked tracks with cover art embedding | Optional (Required for Liked) |
94
+ | **Reddit** | DASH video with merged audio, multi-image galleries, Subreddit feeds (Hot/Top/New), Saved / Upvoted | Optional (Required for Saved / Upvoted) |
95
+ | **Facebook** | Full HD/SD Reels, Public video posts, Watch URLs, short links (`fb.watch`), Saved collections | Optional (Required for Saved) |
96
+ | **Pinterest** | Video pins, original uncompressed images (`/originals/` CDN pattern) with metadata JSON, full Boards | Optional (Required for Saved Boards) |
97
+ | **Twitch** | Stream clips (`clips.twitch.tv`), past broadcasts (VODs), channel archives, audio extraction | Optional (Required for Sub-only VODs) |
98
+ | **Threads** | Single post videos, original high-resolution photo carousels with `metadata.json`, creator profiles | Optional |
99
+ | **Spotify** | Track/Album/Playlist metadata & cover art resolution with high-fidelity audio discovery | Optional (Session via `sp_dc`) |
100
+ | **1000+ Universal Sites** | Vimeo, Bilibili, Dailymotion, Loom, Streamable, Rumble, Bandcamp, and direct media URLs | No |
101
+
102
+ > [!NOTE]
103
+ > Third-party platforms frequently update their web interfaces, layout APIs, and anti-scraping mechanisms. Features like watermark-free extraction, Spotify track resolution, and authenticated bookmarks rely on upstream availability.
104
+
105
+ ---
106
+
107
+ ## System Requirements
108
+
109
+ - **Python**: `>= 3.10`
110
+ - **FFmpeg**: Handled automatically via `imageio-ffmpeg` or discovered from system PATH.
111
+ - **aria2c** *(Optional)*: Required only when passing the `--aria2` multi-stream acceleration flag. Install via your package manager:
112
+ - Windows: `winget install aria2` or `choco install aria2`
113
+ - macOS: `brew install aria2`
114
+ - Linux: `sudo apt install aria2`
115
+
116
+ ---
117
+
118
+ ## Usage
119
+
120
+ ### 1. Interactive Menu (TUI)
121
+ Run without arguments to launch the interactive arrow-key interface:
122
+ ```bash
123
+ haustus
124
+ ```
125
+ - **Arrow Keys (`Up` / `Down`)** or **`W` / `S`**: Move selection.
126
+ - **Single Enter**: Confirm selection.
127
+ - **Number Keys (`0` - `9`)**: Quick jump to numbered item.
128
+ - **`[H]` or `[?]`**: Open / close keyboard shortcuts help overlay.
129
+ - **`[Esc]`**: Return to previous menu or abort prompt.
130
+
131
+ ### 2. Common CLI Commands
132
+
133
+ #### Single Media Downloads
134
+ ```bash
135
+ # 1080p Video
136
+ haustus "https://www.youtube.com/watch?v=..." -q 1080
137
+
138
+ # 320 kbps Audiophile MP3 with Embedded Cover Art & ID3 Tags
139
+ haustus "https://www.youtube.com/watch?v=..." -a -aq 320 -af mp3 --embed-metadata
140
+
141
+ # Specific Clip Range (HH:MM:SS format)
142
+ haustus "https://www.youtube.com/watch?v=..." --clip "01:20-03:45"
143
+
144
+ # Bandwidth Speed Limit Capped at 2 MB/s
145
+ haustus "https://www.youtube.com/watch?v=..." --speed-limit 2M
146
+ ```
147
+
148
+ #### Batch & Smart Filters
149
+ ```bash
150
+ # Batch download from text file (one URL per line)
151
+ haustus -f links.txt
152
+
153
+ # Cap playlist download at first 20 items uploaded in the last 7 days
154
+ haustus -p "https://www.youtube.com/playlist?list=..." --count-limit 20 --date-after now-7days
155
+
156
+ # Shorts only under 60 seconds
157
+ haustus -u "@channel" --shorts-only
158
+
159
+ # Specific items in a playlist
160
+ haustus -p "https://www.youtube.com/playlist?list=..." --items "1,3,5-10"
161
+ ```
162
+
163
+ #### Authenticated Collections
164
+ ```bash
165
+ # Instagram Saved Posts & Stories
166
+ haustus --saved
167
+ haustus --instagram-stories "@creator"
168
+
169
+ # TikTok Saved Favorites & Reposts
170
+ haustus --tiktok-saved
171
+ haustus --tiktok-reposts
172
+
173
+ # X (Twitter) Bookmarks
174
+ haustus --x-bookmarks
175
+
176
+ # Reddit Subreddit Feed Batch
177
+ haustus --reddit-subreddit "EarthPorn" --reddit-sort top --reddit-timeframe week
178
+
179
+ # Spotify Playlist to 320k Tagged MP3s
180
+ haustus --spotify-playlist "https://open.spotify.com/playlist/..." --audio-quality 320
181
+ ```
182
+
183
+ ---
184
+
185
+ ## Command Line Arguments Reference
186
+
187
+ | Flag | Long Flag | Description | Default |
188
+ | :--- | :--- | :--- | :--- |
189
+ | `urls` | | Positional URL(s) from 11 platforms or 1000+ universal sites | None |
190
+ | `-f` | `--file` | Path to text file containing URLs (one per line) | None |
191
+ | `-u` | `--user` | Username or profile/channel URL | None |
192
+ | `-p` | `--playlist` | YouTube playlist URL | None |
193
+ | `-q` | `--quality` | Target video resolution (`best`, `2160`, `1440`, `1080`, `720`, `480`, `360`) | `best` |
194
+ | `-a` | `--audio` | Enable Audio-Only extraction mode | `False` |
195
+ | `-aq`| `--audio-quality` | Audio bitrate (`320`, `256`, `192`, `128`, `64`, `best`) | `192` |
196
+ | `-af`| `--audio-format` | Audio container format (`mp3`, `m4a`, `flac`, `wav`, `opus`) | `mp3` |
197
+ | `-o` | `--output` | Destination directory for downloaded media | `~/Desktop/HaustusDownloads` |
198
+ | `-c` | `--cookies` | Path to Netscape `cookies.txt` or raw cookie token string | None |
199
+ | | `--clip` | Download specific time range only (e.g. `01:20-03:45`) | None |
200
+ | | `--subtitles` | Download and embed subtitles (.srt / .vtt) into media container | `False` |
201
+ | | `--speed-limit` | Download bandwidth rate limit (e.g. `2M`, `5M`, `10M`, `500K`) | None |
202
+ | | `--embed-metadata` | Force embedding thumbnail cover art and metadata tags | None |
203
+ | | `--no-embed-metadata`| Force disabling embedding cover art and metadata tags | None |
204
+ | | `--count-limit` | Cap download batch at maximum number of items | None |
205
+ | | `--date-after` | Filter items uploaded after date (`YYYYMMDD` or `now-7days`) | None |
206
+ | | `--shorts-only` | Download short videos only (`<= 60s`) | `False` |
207
+ | | `--items` | Specify playlist item indices or range (e.g. `1,3,5-10`) | None |
208
+ | | `--archive` | Force checking download history archive | None |
209
+ | | `--no-archive` | Force ignoring download history archive | None |
210
+ | | `--saved` | Download all saved posts from authenticated Instagram account | `False` |
211
+ | | `--instagram-stories` | Download active 24h Instagram Stories for username | None |
212
+ | | `--instagram-highlights` | Download Instagram Story Highlights for username | None |
213
+ | | `--instagram-reposts`| Download reposted posts and reels from Instagram account | `False` |
214
+ | | `--instagram-json` | Path to Instagram data export JSON file | None |
215
+ | | `--tiktok-saved` | Download favorite videos from authenticated TikTok account | `False` |
216
+ | | `--tiktok-reposts`| Download reposted videos from authenticated TikTok account | `False` |
217
+ | | `--tiktok-cookies` | Netscape cookies file or raw TikTok sessionid | None |
218
+ | | `--tiktok-collection` | URL of TikTok collection to batch download | None |
219
+ | | `--tiktok-json` | Path to TikTok user_data.json data export file | None |
220
+ | | `--x-bookmarks` | Download saved bookmarks from authenticated X account | `False` |
221
+ | | `--x-reposts` | Download reposted tweets/media from authenticated X account | `False` |
222
+ | | `--x-cookies` | Netscape cookies file or raw X auth_token | None |
223
+ | | `--x-json` | Path to X archive JSON or JS file (bookmarks.json, tweets.json) | None |
224
+ | | `--soundcloud-likes` | Download liked tracks for SoundCloud username or URL | None |
225
+ | | `--soundcloud-cookies` | Netscape cookies file or raw SoundCloud oauth_token | None |
226
+ | | `--reddit-saved` | Download saved posts from authenticated Reddit account | `False` |
227
+ | | `--reddit-upvoted` | Download upvoted posts from authenticated Reddit account | `False` |
228
+ | | `--reddit-subreddit` | Subreddit name or URL to download in bulk | None |
229
+ | | `--reddit-sort` | Subreddit sorting order (`hot`, `new`, `top`, `rising`) | `hot` |
230
+ | | `--reddit-timeframe` | Subreddit time window (`hour`, `day`, `week`, `month`, `year`, `all`) | `day` |
231
+ | | `--reddit-cookies` | Netscape cookies file or raw Reddit session token | None |
232
+ | | `--facebook-saved` | Download saved videos from authenticated Facebook account | `False` |
233
+ | | `--facebook-cookies` | Netscape cookies file or raw Facebook c_user/xs cookie string | None |
234
+ | | `--pinterest-board` | URL of Pinterest board to batch download | None |
235
+ | | `--pinterest-saved` | Download saved pins and boards from authenticated Pinterest account | `False` |
236
+ | | `--pinterest-cookies`| Netscape cookies file or raw Pinterest _pinterest_sess token | None |
237
+ | | `--twitch-channel` | Twitch streamer/channel URL to batch download clips/VODs | None |
238
+ | | `--twitch-cookies` | Netscape cookies file or raw auth-token for Twitch | None |
239
+ | | `--threads-profile` | Threads username or profile URL to batch download | None |
240
+ | | `--threads-cookies` | Netscape cookies file or raw sessionid for Threads | None |
241
+ | | `--spotify-playlist`| Spotify playlist, album, or collection URL to batch download | None |
242
+ | | `--spotify-cookies` | Netscape cookies file or raw sp_dc token for Spotify | None |
243
+ | | `--aria2` | Enable 16-connection segmented multi-stream download via aria2c | `False` |
244
+ | | `--normalize` | Enable two-pass EBU R128 (-16 LUFS) loudness normalization | `False` |
245
+ | | `--transcode` | Enable GPU-accelerated video transcoding (NVENC/VAAPI/AV1) | `False` |
246
+ | | `--parallel` | Enable high-throughput multi-threaded parallel batch execution | `False` |
247
+ | | `--delay` | Polite delay in seconds between download requests | `2.0` |
248
+ | | `--proxy` | HTTP/HTTPS/SOCKS5 proxy URI (e.g. `http://127.0.0.1:7890`) | None |
249
+
250
+ ---
251
+
252
+ ## Troubleshooting
253
+
254
+ - **HTTP 429 Too Many Requests**: The platform is rate-limiting your IP. Use `--delay 5.0` to throttle requests, or configure a proxy with `--proxy`.
255
+ - **Session Expired / Authentication Failed**: Cookies expire over time. Open `haustus` -> Settings -> Accounts and re-enter your updated session token or Netscape cookies file.
256
+ - **aria2c executable not found**: Ensure `aria2c` is installed and reachable on your system PATH before using `--aria2`.
257
+ - **Unclosed Terminal Buffers on Windows**: Haustus automatically configures UTF-8 and ANSI escape sequence processing on Windows terminals. If running in legacy cmd.exe, prefer Windows Terminal or PowerShell 7+.
258
+
259
+ ---
260
+
261
+ ## Testing
262
+
263
+ The test suite covers configuration persistence, cookie isolation, network resilience backoff, format extraction, platform dispatchers, and UI components:
264
+
265
+ ```bash
266
+ python -m unittest discover -s tests
267
+ ```
268
+
269
+ ---
270
+
271
+ ## Disclaimer & Legal Notice
272
+
273
+ Haustus is designed and intended strictly for personal, educational, and backup archiving purposes. Users are solely responsible for ensuring that their media downloads comply with the Terms of Service of each respective platform and respect the copyrights and intellectual property rights of content creators. The developers assume no liability for misuse.
274
+
275
+ ---
276
+
277
+ ## License
278
+
279
+ Released under the MIT License. Copyright (c) 2026 Adham Mohamed (Sonata-Of-Death).
280
+
281
+ > **Third-Party Notice**: Haustus utilizes open-source libraries including `yt-dlp` (Unlicense), `requests` (Apache-2.0), `rich` (MIT), and `imageio-ffmpeg` (BSD-2-Clause).
282
+ > - `mutagen` is licensed under GPL-2.0-or-later; it is installed separately from PyPI as an external dependency and is not bundled or distributed with this source code repository.
283
+ > - `imageio-ffmpeg` downloads or uses an external FFmpeg binary build which may be compiled under GPL (or LGPL depending on enabled codecs and build flags), which is also retrieved independently at runtime and is not distributed as part of this codebase.
@@ -0,0 +1,18 @@
1
+ """Core package."""
2
+ from .config import ConfigManager
3
+ from .engine import HighThroughputEngine
4
+ from .media import MediaMaestro
5
+ from .resilience import (
6
+ AdaptiveNetworkManager,
7
+ ResilientProxyPool,
8
+ SessionCheckpointLedger,
9
+ )
10
+
11
+ __all__ = [
12
+ "AdaptiveNetworkManager",
13
+ "SessionCheckpointLedger",
14
+ "ResilientProxyPool",
15
+ "MediaMaestro",
16
+ "HighThroughputEngine",
17
+ "ConfigManager",
18
+ ]