wrkmon 1.0.0__py3-none-any.whl

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.
@@ -0,0 +1,124 @@
1
+ """Stealth utilities for wrkmon - makes everything look like a dev tool."""
2
+
3
+ import os
4
+ import sys
5
+ import random
6
+ from typing import Optional
7
+
8
+
9
+ class StealthManager:
10
+ """Manages stealth features for the application."""
11
+
12
+ # Fake process names that look like legitimate dev tools
13
+ FAKE_PROCESS_NAMES = [
14
+ "node-inspector",
15
+ "webpack-dev-srv",
16
+ "vite-hmr-watch",
17
+ "eslint-daemon",
18
+ "tsc-watch",
19
+ "pytest-runner",
20
+ "cargo-watch",
21
+ "go-build-srv",
22
+ "rust-analyzer",
23
+ "prettier-fmt",
24
+ ]
25
+
26
+ # Fake CPU/Memory stats ranges for the UI
27
+ CPU_RANGE = (12, 45)
28
+ MEM_RANGE = (35, 65)
29
+
30
+ def __init__(self):
31
+ self._original_title: Optional[str] = None
32
+
33
+ def get_pipe_name(self) -> str:
34
+ """Get the IPC pipe/socket name for mpv."""
35
+ if sys.platform == "win32":
36
+ return r"\\.\pipe\wrkmon-mpv"
37
+ else:
38
+ # Unix socket in runtime dir
39
+ runtime_dir = os.environ.get("XDG_RUNTIME_DIR", "/tmp")
40
+ return f"{runtime_dir}/wrkmon-mpv.sock"
41
+
42
+ def get_fake_process_name(self, video_title: str) -> str:
43
+ """Convert a video title to a fake process name."""
44
+ # Sanitize and truncate the title
45
+ name = video_title.lower()
46
+ # Replace spaces and special chars with hyphens
47
+ name = "".join(c if c.isalnum() else "-" for c in name)
48
+ # Remove consecutive hyphens
49
+ while "--" in name:
50
+ name = name.replace("--", "-")
51
+ # Trim and limit length
52
+ name = name.strip("-")[:30]
53
+ return name or "media-process"
54
+
55
+ def get_fake_pid(self) -> int:
56
+ """Generate a fake PID that looks realistic."""
57
+ return random.randint(1000, 65535)
58
+
59
+ def get_fake_cpu(self) -> int:
60
+ """Get a fake CPU usage percentage."""
61
+ return random.randint(*self.CPU_RANGE)
62
+
63
+ def get_fake_memory(self) -> int:
64
+ """Get a fake memory usage percentage."""
65
+ return random.randint(*self.MEM_RANGE)
66
+
67
+ def set_terminal_title(self, title: str = "wrkmon") -> None:
68
+ """Set the terminal window title."""
69
+ if sys.platform == "win32":
70
+ os.system(f"title {title}")
71
+ else:
72
+ # ANSI escape sequence for setting terminal title
73
+ sys.stdout.write(f"\033]0;{title}\007")
74
+ sys.stdout.flush()
75
+
76
+ def restore_terminal_title(self) -> None:
77
+ """Restore the original terminal title."""
78
+ if self._original_title:
79
+ self.set_terminal_title(self._original_title)
80
+
81
+ def get_mpv_args(self) -> list[str]:
82
+ """Get mpv arguments for stealth operation."""
83
+ return [
84
+ "--no-video",
85
+ "--no-terminal",
86
+ "--really-quiet",
87
+ f"--input-ipc-server={self.get_pipe_name()}",
88
+ "--idle=yes",
89
+ "--force-window=no",
90
+ ]
91
+
92
+ def format_status(self, status: str) -> str:
93
+ """Format a status string to look like a system status."""
94
+ status_map = {
95
+ "playing": "RUNNING",
96
+ "paused": "SUSPENDED",
97
+ "stopped": "STOPPED",
98
+ "buffering": "LOADING",
99
+ "ready": "READY",
100
+ "error": "FAILED",
101
+ }
102
+ return status_map.get(status.lower(), status.upper())
103
+
104
+ def format_duration(self, seconds: float) -> str:
105
+ """Format duration in a clean way."""
106
+ if seconds < 0:
107
+ return "--:--"
108
+ mins, secs = divmod(int(seconds), 60)
109
+ hours, mins = divmod(mins, 60)
110
+ if hours > 0:
111
+ return f"{hours}:{mins:02d}:{secs:02d}"
112
+ return f"{mins}:{secs:02d}"
113
+
114
+
115
+ # Global stealth manager instance
116
+ _stealth: Optional[StealthManager] = None
117
+
118
+
119
+ def get_stealth() -> StealthManager:
120
+ """Get the global stealth manager instance."""
121
+ global _stealth
122
+ if _stealth is None:
123
+ _stealth = StealthManager()
124
+ return _stealth
@@ -0,0 +1,193 @@
1
+ Metadata-Version: 2.4
2
+ Name: wrkmon
3
+ Version: 1.0.0
4
+ Summary: Stealth TUI YouTube audio player - stream music while looking productive
5
+ Author-email: Umar Khan Yousafzai <umar@example.com>
6
+ License-Expression: MIT
7
+ Project-URL: Homepage, https://github.com/Umar-Khan-Yousafzai/Wrkmon-TUI-Youtube
8
+ Project-URL: Documentation, https://github.com/Umar-Khan-Yousafzai/Wrkmon-TUI-Youtube#readme
9
+ Project-URL: Repository, https://github.com/Umar-Khan-Yousafzai/Wrkmon-TUI-Youtube
10
+ Project-URL: Issues, https://github.com/Umar-Khan-Yousafzai/Wrkmon-TUI-Youtube/issues
11
+ Keywords: youtube,audio,player,tui,music,stealth,productivity,terminal
12
+ Classifier: Development Status :: 4 - Beta
13
+ Classifier: Environment :: Console
14
+ Classifier: Intended Audience :: Developers
15
+ Classifier: Intended Audience :: End Users/Desktop
16
+ Classifier: Operating System :: OS Independent
17
+ Classifier: Operating System :: Microsoft :: Windows
18
+ Classifier: Operating System :: POSIX :: Linux
19
+ Classifier: Operating System :: MacOS
20
+ Classifier: Programming Language :: Python :: 3
21
+ Classifier: Programming Language :: Python :: 3.10
22
+ Classifier: Programming Language :: Python :: 3.11
23
+ Classifier: Programming Language :: Python :: 3.12
24
+ Classifier: Topic :: Multimedia :: Sound/Audio :: Players
25
+ Requires-Python: >=3.10
26
+ Description-Content-Type: text/markdown
27
+ License-File: LICENSE.txt
28
+ Requires-Dist: textual>=0.50.0
29
+ Requires-Dist: typer>=0.9.0
30
+ Requires-Dist: yt-dlp>=2024.0.0
31
+ Requires-Dist: rich>=13.0.0
32
+ Requires-Dist: pywin32>=306; sys_platform == "win32"
33
+ Provides-Extra: dev
34
+ Requires-Dist: pytest>=8.0.0; extra == "dev"
35
+ Requires-Dist: ruff>=0.3.0; extra == "dev"
36
+ Dynamic: license-file
37
+
38
+ # wrkmon 🎵
39
+
40
+ **Stealth TUI YouTube Audio Player** - Stream music while looking productive!
41
+
42
+ A terminal-based YouTube audio player that runs completely hidden in the background. No visible windows, no distractions - just music.
43
+
44
+ ![License](https://img.shields.io/badge/license-MIT-blue.svg)
45
+ ![Python](https://img.shields.io/badge/python-3.10%2B-blue.svg)
46
+ ![Platform](https://img.shields.io/badge/platform-Windows%20%7C%20macOS%20%7C%20Linux-lightgrey.svg)
47
+
48
+ ## Features
49
+
50
+ - 🔍 **YouTube Search** - Search and stream any YouTube audio
51
+ - 👻 **Stealth Mode** - No visible windows, completely hidden playback
52
+ - 🎨 **Beautiful TUI** - Clean terminal interface with keyboard controls
53
+ - 📋 **Queue Management** - Add tracks, shuffle, repeat
54
+ - 📜 **History & Playlists** - Track your listening history
55
+ - ⌨️ **Keyboard Driven** - Full control without touching the mouse
56
+ - 🖥️ **Cross-Platform** - Works on Windows, macOS, and Linux
57
+
58
+ ## Installation
59
+
60
+ ### Quick Install (Recommended)
61
+
62
+ **Windows (PowerShell):**
63
+ ```powershell
64
+ irm https://raw.githubusercontent.com/Umar-Khan-Yousafzai/Wrkmon-TUI-Youtube/main/install.ps1 | iex
65
+ ```
66
+
67
+ **macOS / Linux:**
68
+ ```bash
69
+ curl -sSL https://raw.githubusercontent.com/Umar-Khan-Yousafzai/Wrkmon-TUI-Youtube/main/install.sh | bash
70
+ ```
71
+
72
+ ### Package Managers
73
+
74
+ **Windows (Chocolatey):**
75
+ ```powershell
76
+ choco install wrkmon
77
+ ```
78
+
79
+ **Windows (winget):**
80
+ ```powershell
81
+ winget install wrkmon
82
+ ```
83
+
84
+ **macOS (Homebrew):**
85
+ ```bash
86
+ brew install wrkmon
87
+ ```
88
+
89
+ **Linux (Snap):**
90
+ ```bash
91
+ sudo snap install wrkmon
92
+ ```
93
+
94
+ **Linux (apt):**
95
+ ```bash
96
+ sudo apt install wrkmon
97
+ ```
98
+
99
+ ### pip (All Platforms)
100
+
101
+ ```bash
102
+ pip install wrkmon
103
+ ```
104
+
105
+ > **Note:** If using pip, you need to install mpv separately:
106
+ > - Windows: `winget install mpv` or `choco install mpv`
107
+ > - macOS: `brew install mpv`
108
+ > - Linux: `sudo apt install mpv`
109
+
110
+ ## Usage
111
+
112
+ ```bash
113
+ wrkmon # Launch the TUI
114
+ wrkmon search "q" # Quick search from terminal
115
+ wrkmon play <id> # Play a specific video
116
+ wrkmon history # View play history
117
+ ```
118
+
119
+ ## Keyboard Controls
120
+
121
+ | Key | Action |
122
+ |-----|--------|
123
+ | `F1` | Search view |
124
+ | `F2` | Queue view |
125
+ | `F3` | History view |
126
+ | `F4` | Playlists view |
127
+ | `F5` | Play / Pause |
128
+ | `F6` | Volume down |
129
+ | `F7` | Volume up |
130
+ | `F8` | Next track |
131
+ | `F9` | Stop |
132
+ | `F10` | Add to queue |
133
+ | `/` | Focus search |
134
+ | `Enter` | Play selected |
135
+ | `a` | Add to queue (in list) |
136
+ | `Ctrl+C` | Quit |
137
+
138
+ ## Screenshots
139
+
140
+ ```
141
+ ┌─────────────────────────────────────────────────────────┐
142
+ │ wrkmon [Search] │
143
+ ├─────────────────────────────────────────────────────────┤
144
+ │ Search: lofi hip hop │
145
+ ├─────────────────────────────────────────────────────────┤
146
+ │ # Process PID Duration │
147
+ │ 1 node_worker_847291 8472 3:24:15 │
148
+ │ 2 webpack_compile_process 9123 2:45:00 │
149
+ │ 3 eslint_daemon_runner 7834 1:30:22 │
150
+ ├─────────────────────────────────────────────────────────┤
151
+ │ ▶ Now Playing: lofi hip hop beats advancement █████░░░░░ 1:23:45 │
152
+ │ F1 Search F2 Queue F5 Play/Pause F9 Stop │
153
+ └─────────────────────────────────────────────────────────┘
154
+ ```
155
+
156
+ ## Why wrkmon?
157
+
158
+ Ever wanted to listen to music at work but worried about monitoring software catching you? wrkmon disguises itself as a legitimate development process while streaming your favorite tunes in the background. The TUI looks like a process monitor, and the audio plays through mpv with no visible windows.
159
+
160
+ ## Requirements
161
+
162
+ - Python 3.10+
163
+ - mpv (automatically installed with package managers)
164
+
165
+ ## Development
166
+
167
+ ```bash
168
+ # Clone the repo
169
+ git clone https://github.com/Umar-Khan-Yousafzai/Wrkmon-TUI-Youtube.git
170
+ cd Wrkmon-TUI-Youtube
171
+
172
+ # Install in development mode
173
+ pip install -e ".[dev]"
174
+
175
+ # Run tests
176
+ pytest
177
+ ```
178
+
179
+ ## License
180
+
181
+ MIT License - see [LICENSE](LICENSE) for details.
182
+
183
+ ## Contributing
184
+
185
+ Contributions are welcome! Please feel free to submit a Pull Request.
186
+
187
+ ## Author
188
+
189
+ **Umar Khan Yousafzai**
190
+
191
+ ---
192
+
193
+ *Made with ❤️ for productive procrastinators everywhere*
@@ -0,0 +1,41 @@
1
+ wrkmon/__init__.py,sha256=X5ppzR6k_fMsxNUhNdnCjgV-UQvrY86IWvjaFrDGaqs,107
2
+ wrkmon/__main__.py,sha256=27UFV2ULX5B8OO5b9HjCtTu5k6hdKXnQlCcNVwlYKto,116
3
+ wrkmon/app.py,sha256=3-d2xtivTtOCw8EOBRzIsxQSW2Z6TWKQgY6dG3M2T28,20447
4
+ wrkmon/cli.py,sha256=2K72I4PrgivPt4OP14XZjYjWNS7mvfTtcKf4YgZ2JZ4,8189
5
+ wrkmon/core/__init__.py,sha256=50AiIHwvm2hVSBc5qkca7_k8taS4IIs_J8i0irz-rBo,269
6
+ wrkmon/core/cache.py,sha256=-3ZH4GPQt1xk8huq50BuCNinTLFbZzRPXhPAEnmWZAs,6599
7
+ wrkmon/core/player.py,sha256=ZeLvffoid8BUXZA9GDHt1YtQhzkmL9jlAhRfXtOc4AQ,9709
8
+ wrkmon/core/queue.py,sha256=WgIkyi8uHRGLeX1mZoI8o10ABRrCSCLFiZRD20wCNzU,8563
9
+ wrkmon/core/youtube.py,sha256=M0IvRErqec0RaVq58z07L45igxpbkqEiavkDQHAXzac,6215
10
+ wrkmon/data/__init__.py,sha256=-geRAYau8OCtGztlSg4gNkmpNC1LEYbH5bI5y-4SYoo,194
11
+ wrkmon/data/database.py,sha256=Ky1QRq5LZewRtWul_4qWJfoXbKbO7Nw--Ll9QKe9PrU,13448
12
+ wrkmon/data/migrations.py,sha256=E2qBzEVrqp50b5WoQ1tB6hAPgLh50ZGq5YGSp06JPfE,4723
13
+ wrkmon/data/models.py,sha256=C2rmdHnFr6BqRVjkWW6oZ2m6pSXrwMlp84l_7qxwj6A,4305
14
+ wrkmon/ui/__init__.py,sha256=fy6EMFEEOA2k4rzEUsWl93hW_11bn1cYT29qVontggc,111
15
+ wrkmon/ui/components.py,sha256=NaPQbDHnBM1LBZL_r5JcXvxEaCxwoizpMxWGFAAJTTs,7117
16
+ wrkmon/ui/messages.py,sha256=0ds2nvaHQ6-2Ok8hfII6XlFkbNeAnCRFa7KldKZ4m8I,2352
17
+ wrkmon/ui/theme.py,sha256=fVEVpokqEX3BmykS0KdndtjgV6NU8ZCYr7LHo0cH0qE,5260
18
+ wrkmon/ui/screens/__init__.py,sha256=0_MX_qc8di-fRCm58b14nIV7X7iMZAJxfLIxYCwJo4I,316
19
+ wrkmon/ui/screens/history.py,sha256=teRm0HhaWgHKXsu57XQRScgYqn_MvK9qA-5IBoWffRE,4831
20
+ wrkmon/ui/screens/player.py,sha256=NPIV1oobtPdBZEHwpSTXUZeV8R1yrW02AVsoLuL3PZI,8046
21
+ wrkmon/ui/screens/playlist.py,sha256=0m9kIUpJP4QHJTTzP_pKBuZS3gUfZZlhsWVy_iHZp4U,9676
22
+ wrkmon/ui/screens/search.py,sha256=lYwTBbzrIW0amln0o9Hs-RtTt2FqHr2QasIVhxq3FKo,5626
23
+ wrkmon/ui/views/__init__.py,sha256=WNHN2SDDk3f1k9VLHdpTbhWotRw_cCHVkR4-OtbfACo,308
24
+ wrkmon/ui/views/history.py,sha256=j9keAwnOMSGoqFKlT21bpxJlhJqKNMfv7X7-eP80sb0,4895
25
+ wrkmon/ui/views/playlists.py,sha256=5yvknFiQ7saaM_t28n-7JhY28lRxN6z3BFspSwXKyKA,9411
26
+ wrkmon/ui/views/queue.py,sha256=_QmSfFrjFNcrNdfetTbojJpCwE3FPR-ed3bO9BsFlIs,6811
27
+ wrkmon/ui/views/search.py,sha256=QiU3fcMUPb_Yr7fBHnM2FRUZOBuH8vx16r2B2TE2cjQ,5465
28
+ wrkmon/ui/widgets/__init__.py,sha256=MZZLVqMv5cKOXhEJ-XZ3vVbrcLkg1wpFBtiIItv6HXE,250
29
+ wrkmon/ui/widgets/header.py,sha256=vwZ1pRxROsWgXWaqdVne3_phiCfcCKeYEWg1ubrI7w8,1843
30
+ wrkmon/ui/widgets/player_bar.py,sha256=AVw3xH3uNujjhaSo_L5QrtnrFtlVQnvVlj8k8vInx-8,4308
31
+ wrkmon/ui/widgets/result_item.py,sha256=BroroFbMbT3qoH-Up1RJk3mfDwRCxNqodKgd_K1MeKM,3150
32
+ wrkmon/utils/__init__.py,sha256=C1P1hbS96YERgJTw3zGqEayxwr0AFrDhCAuT0WtPO00,162
33
+ wrkmon/utils/config.py,sha256=0v1VO8YFShFJcF5CQhHenKPVr_tm_r6JtaLJy39GRaE,5332
34
+ wrkmon/utils/mpv_installer.py,sha256=HGS8Sq5ZJMCAZk2OTkHDo2ZyqzmXtaHoxR0guEdMstk,6227
35
+ wrkmon/utils/stealth.py,sha256=EmI0-rUYhdV2fIZ2evwdPlSkqFT-Lq6fEX3ZqQH430A,3901
36
+ wrkmon-1.0.0.dist-info/licenses/LICENSE.txt,sha256=0cLcTBgN-yLwY5jhlp8oK1wBxUCyIH7I4vst8RPxelw,1097
37
+ wrkmon-1.0.0.dist-info/METADATA,sha256=TrZNZviQ7hL44v5IayqZLjd0lo4u5_O-VDXZf_tzxGs,6572
38
+ wrkmon-1.0.0.dist-info/WHEEL,sha256=qELbo2s1Yzl39ZmrAibXA2jjPLUYfnVhUNTlyF1rq0Y,92
39
+ wrkmon-1.0.0.dist-info/entry_points.txt,sha256=sI_CTRHFwhiEHh5BJZtpwiBsfQekpqXcXiT31wcdUZo,42
40
+ wrkmon-1.0.0.dist-info/top_level.txt,sha256=lQvb7Xi0gQQ8R9z1IkR39vTdL-0jxZreD5McnnPFtLs,7
41
+ wrkmon-1.0.0.dist-info/RECORD,,
@@ -0,0 +1,5 @@
1
+ Wheel-Version: 1.0
2
+ Generator: setuptools (80.10.1)
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
5
+
@@ -0,0 +1,2 @@
1
+ [console_scripts]
2
+ wrkmon = wrkmon.cli:app
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2024 Umar Khan Yousafzai
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 @@
1
+ wrkmon