@jakende/media-info-cli 0.1.3 → 0.1.5
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.
- package/LICENSE +21 -0
- package/README.md +4 -0
- package/media_information_download/tui.py +40 -7
- package/package.json +3 -2
- package/pyproject.toml +2 -1
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Jakob Endemann
|
|
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.
|
package/README.md
CHANGED
|
@@ -201,3 +201,7 @@ All generated audio is saved as `.mp3`. Non-MP3 RSS downloads are converted and
|
|
|
201
201
|
- `media_information_download/tui.py`: terminal UI and non-interactive CLI entry point
|
|
202
202
|
|
|
203
203
|
This structure keeps new media sources or formats isolated to source handlers, downloaders, and supported format lists.
|
|
204
|
+
|
|
205
|
+
## License
|
|
206
|
+
|
|
207
|
+
MIT. See `LICENSE`.
|
|
@@ -500,10 +500,24 @@ def _print_progress(message: str) -> None:
|
|
|
500
500
|
|
|
501
501
|
class SpinnerProgress:
|
|
502
502
|
frames = (
|
|
503
|
-
"[
|
|
504
|
-
"[
|
|
505
|
-
"[
|
|
506
|
-
"[
|
|
503
|
+
"[>---------]",
|
|
504
|
+
"[->--------]",
|
|
505
|
+
"[-->-------]",
|
|
506
|
+
"[--->------]",
|
|
507
|
+
"[---->-----]",
|
|
508
|
+
"[----->----]",
|
|
509
|
+
"[------>---]",
|
|
510
|
+
"[------->--]",
|
|
511
|
+
"[-------->-]",
|
|
512
|
+
"[--------->]",
|
|
513
|
+
"[--------<-]",
|
|
514
|
+
"[-------<--]",
|
|
515
|
+
"[------<---]",
|
|
516
|
+
"[-----<----]",
|
|
517
|
+
"[----<-----]",
|
|
518
|
+
"[---<------]",
|
|
519
|
+
"[--<-------]",
|
|
520
|
+
"[-<--------]",
|
|
507
521
|
)
|
|
508
522
|
active_prefixes = (
|
|
509
523
|
"Downloading:",
|
|
@@ -572,13 +586,15 @@ class SpinnerProgress:
|
|
|
572
586
|
frame = self.frames[self._frame_index % len(self.frames)]
|
|
573
587
|
self._frame_index += 1
|
|
574
588
|
self._render_active(message, frame=frame)
|
|
575
|
-
self._stop_event.wait(0.
|
|
589
|
+
self._stop_event.wait(0.10)
|
|
576
590
|
|
|
577
591
|
def _render_active(self, message: str, frame: str | None = None) -> None:
|
|
578
592
|
frame = frame or self.frames[self._frame_index % len(self.frames)]
|
|
579
593
|
phase = self._active_phase(message)
|
|
580
|
-
|
|
581
|
-
|
|
594
|
+
label = self._active_label(phase)
|
|
595
|
+
detail = self._active_detail(message)
|
|
596
|
+
_viewport_line(0, f"{label:<18} {frame} {phase}", Style.bold + Style.cyan)
|
|
597
|
+
_viewport_line(1, detail, Style.cyan)
|
|
582
598
|
|
|
583
599
|
def _append_log(self, message: str) -> None:
|
|
584
600
|
self._log_messages.append(message)
|
|
@@ -601,6 +617,23 @@ class SpinnerProgress:
|
|
|
601
617
|
stripped = message.split("] ", maxsplit=1)[-1]
|
|
602
618
|
return stripped.split(":", maxsplit=1)[0].upper()
|
|
603
619
|
|
|
620
|
+
@staticmethod
|
|
621
|
+
def _active_detail(message: str) -> str:
|
|
622
|
+
stripped = message.split("] ", maxsplit=1)[-1]
|
|
623
|
+
if ":" not in stripped:
|
|
624
|
+
return message
|
|
625
|
+
phase, detail = stripped.split(":", maxsplit=1)
|
|
626
|
+
return f"{phase.strip()}: {detail.strip()}"
|
|
627
|
+
|
|
628
|
+
@staticmethod
|
|
629
|
+
def _active_label(phase: str) -> str:
|
|
630
|
+
labels = {
|
|
631
|
+
"DOWNLOADING": "TUNING IN",
|
|
632
|
+
"CONVERTING TO MP3": "MIXING AUDIO",
|
|
633
|
+
"TRANSCRIBING": "WRITING WORDS",
|
|
634
|
+
}
|
|
635
|
+
return labels.get(phase, "WORKING")
|
|
636
|
+
|
|
604
637
|
@staticmethod
|
|
605
638
|
def _format_log_message(message: str) -> str:
|
|
606
639
|
if message.startswith("ERROR:"):
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jakende/media-info-cli",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.5",
|
|
4
4
|
"description": "Terminal app for downloading media from YouTube or RSS feeds, converting to MP3, and generating Whisper transcripts.",
|
|
5
|
-
"license": "
|
|
5
|
+
"license": "MIT",
|
|
6
6
|
"bin": {
|
|
7
7
|
"media-information-download": "bin/media-information-download.js",
|
|
8
8
|
"media-info-download": "bin/media-information-download.js",
|
|
@@ -17,6 +17,7 @@
|
|
|
17
17
|
"requirements.txt",
|
|
18
18
|
"requirements-transcribe.txt",
|
|
19
19
|
"pyproject.toml",
|
|
20
|
+
"LICENSE",
|
|
20
21
|
"README.md"
|
|
21
22
|
],
|
|
22
23
|
"scripts": {
|
package/pyproject.toml
CHANGED
|
@@ -4,9 +4,10 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "media-information-download"
|
|
7
|
-
version = "0.1.
|
|
7
|
+
version = "0.1.5"
|
|
8
8
|
description = "Terminal app for downloading media from YouTube or RSS feeds, converting to MP3, and generating Whisper transcripts."
|
|
9
9
|
readme = "README.md"
|
|
10
|
+
license = { text = "MIT" }
|
|
10
11
|
requires-python = ">=3.10"
|
|
11
12
|
dependencies = [
|
|
12
13
|
"yt-dlp>=2024.1.1",
|