musicmandu 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.
@@ -0,0 +1,111 @@
1
+ Metadata-Version: 2.4
2
+ Name: musicmandu
3
+ Version: 1.0.0
4
+ Summary: A production-grade YouTube music downloader CLI
5
+ Author: Milan Prajapati
6
+ Classifier: Programming Language :: Python :: 3
7
+ Classifier: License :: OSI Approved :: MIT License
8
+ Classifier: Operating System :: OS Independent
9
+ Description-Content-Type: text/markdown
10
+ Requires-Dist: typer>=0.9.0
11
+ Requires-Dist: rich>=13.0.0
12
+ Requires-Dist: yt-dlp>=2023.0.0
13
+ Requires-Dist: ffmpeg-downloader>=0.1.0
14
+
15
+ # 🎵 musicmandu
16
+
17
+ `musicmandu` is a production-grade, zero-configuration command-line interface (CLI) tool written in Python. It allows users to seamlessly download high-quality audio from YouTube videos and automatically process them into fully tagged, album-art-embedded MP3 files.
18
+
19
+ ---
20
+
21
+ ## ✨ Features
22
+
23
+ - **Zero Manual Dependencies:** Automatically detects, downloads, and caches the correct system-specific FFmpeg binaries at runtime—even when Windows user paths contain spaces.
24
+ - **High-Quality Audio:** Downloads the best available audio stream and converts it into a clean 192 kbps MP3 file.
25
+ - **Rich Metadata Integration:** Automatically extracts and embeds metadata such as the title and creator, then downloads and embeds the video's high-resolution thumbnail as album art.
26
+ - **Sleek Visual Feedback:** Uses `Rich` console components to replace noisy console output with clean status spinners and styled messages.
27
+
28
+ ---
29
+
30
+ ## 🚀 Installation & Prerequisites
31
+
32
+ `musicmandu` runs on **Windows, macOS, and Linux**.
33
+
34
+ ### 1. Requirements
35
+
36
+ - Python 3.8 or later
37
+
38
+ ### 2. Set Up the Project
39
+
40
+ Clone or navigate to the project directory, then install the required Python packages:
41
+
42
+ ```bash
43
+ pip install typer rich yt-dlp ffmpeg-downloader
44
+ ```
45
+
46
+ ---
47
+
48
+ ## 🛠 Usage & Commands
49
+
50
+ Run the CLI using standard Python execution syntax:
51
+
52
+ ```bash
53
+ python main.py [COMMAND] [ARGUMENTS] [FLAGS]
54
+ ```
55
+
56
+ ### 1. Greet Users (`greet`)
57
+
58
+ Test the CLI setup or display a custom greeting.
59
+
60
+ ```bash
61
+ # Standard greeting
62
+ python main.py greet Milan
63
+
64
+ # Formal greeting
65
+ python main.py greet "Mr. Wayne" --formal
66
+ ```
67
+
68
+ ### 2. Download Tracks (`download`)
69
+
70
+ Download audio and save a formatted MP3 file in the current working directory.
71
+
72
+ ```bash
73
+ python main.py download "https://www.youtube.com/watch?v=dQw4w9WgXcQ"
74
+ ```
75
+
76
+ ### 3. View Built-in Help
77
+
78
+ Display automatically generated command descriptions, arguments, and flags.
79
+
80
+ ```bash
81
+ python main.py --help
82
+ python main.py download --help
83
+ ```
84
+
85
+ ---
86
+
87
+ ## ⚙️ Architecture & Under the Hood
88
+
89
+ The application relies on three core frameworks to provide a seamless user experience:
90
+
91
+ - **Typer:** Powers command parsing, argument handling, flags, and dynamically generated help screens.
92
+ - **Rich:** Manages styled terminal output, layout, and responsive loading indicators.
93
+ - **yt-dlp and ffmpeg-downloader:** Handle the download and processing pipeline, including metadata extraction, high-bitrate audio retrieval, thumbnail downloading, and FFmpeg-based MP3 conversion.
94
+
95
+ ### Runtime Dependency Sandbox
96
+
97
+ When the `download` command is invoked, the application runs a gatekeeper function named `ensure_ffmpeg_installed`.
98
+
99
+ If a valid FFmpeg installation cannot be found in the system path, the application downloads and caches a platform-specific FFmpeg binary. It then maps the binary into the current process environment without modifying the user's global system configuration.
100
+
101
+ ---
102
+
103
+ ## 📝 License
104
+
105
+ Distributed under the MIT License. See `LICENSE` for more information.
106
+
107
+ ---
108
+
109
+ ## 💡 Project Idea
110
+
111
+ A useful next feature would be a download history log that records previously downloaded songs.
@@ -0,0 +1,97 @@
1
+ # 🎵 musicmandu
2
+
3
+ `musicmandu` is a production-grade, zero-configuration command-line interface (CLI) tool written in Python. It allows users to seamlessly download high-quality audio from YouTube videos and automatically process them into fully tagged, album-art-embedded MP3 files.
4
+
5
+ ---
6
+
7
+ ## ✨ Features
8
+
9
+ - **Zero Manual Dependencies:** Automatically detects, downloads, and caches the correct system-specific FFmpeg binaries at runtime—even when Windows user paths contain spaces.
10
+ - **High-Quality Audio:** Downloads the best available audio stream and converts it into a clean 192 kbps MP3 file.
11
+ - **Rich Metadata Integration:** Automatically extracts and embeds metadata such as the title and creator, then downloads and embeds the video's high-resolution thumbnail as album art.
12
+ - **Sleek Visual Feedback:** Uses `Rich` console components to replace noisy console output with clean status spinners and styled messages.
13
+
14
+ ---
15
+
16
+ ## 🚀 Installation & Prerequisites
17
+
18
+ `musicmandu` runs on **Windows, macOS, and Linux**.
19
+
20
+ ### 1. Requirements
21
+
22
+ - Python 3.8 or later
23
+
24
+ ### 2. Set Up the Project
25
+
26
+ Clone or navigate to the project directory, then install the required Python packages:
27
+
28
+ ```bash
29
+ pip install typer rich yt-dlp ffmpeg-downloader
30
+ ```
31
+
32
+ ---
33
+
34
+ ## 🛠 Usage & Commands
35
+
36
+ Run the CLI using standard Python execution syntax:
37
+
38
+ ```bash
39
+ python main.py [COMMAND] [ARGUMENTS] [FLAGS]
40
+ ```
41
+
42
+ ### 1. Greet Users (`greet`)
43
+
44
+ Test the CLI setup or display a custom greeting.
45
+
46
+ ```bash
47
+ # Standard greeting
48
+ python main.py greet Milan
49
+
50
+ # Formal greeting
51
+ python main.py greet "Mr. Wayne" --formal
52
+ ```
53
+
54
+ ### 2. Download Tracks (`download`)
55
+
56
+ Download audio and save a formatted MP3 file in the current working directory.
57
+
58
+ ```bash
59
+ python main.py download "https://www.youtube.com/watch?v=dQw4w9WgXcQ"
60
+ ```
61
+
62
+ ### 3. View Built-in Help
63
+
64
+ Display automatically generated command descriptions, arguments, and flags.
65
+
66
+ ```bash
67
+ python main.py --help
68
+ python main.py download --help
69
+ ```
70
+
71
+ ---
72
+
73
+ ## ⚙️ Architecture & Under the Hood
74
+
75
+ The application relies on three core frameworks to provide a seamless user experience:
76
+
77
+ - **Typer:** Powers command parsing, argument handling, flags, and dynamically generated help screens.
78
+ - **Rich:** Manages styled terminal output, layout, and responsive loading indicators.
79
+ - **yt-dlp and ffmpeg-downloader:** Handle the download and processing pipeline, including metadata extraction, high-bitrate audio retrieval, thumbnail downloading, and FFmpeg-based MP3 conversion.
80
+
81
+ ### Runtime Dependency Sandbox
82
+
83
+ When the `download` command is invoked, the application runs a gatekeeper function named `ensure_ffmpeg_installed`.
84
+
85
+ If a valid FFmpeg installation cannot be found in the system path, the application downloads and caches a platform-specific FFmpeg binary. It then maps the binary into the current process environment without modifying the user's global system configuration.
86
+
87
+ ---
88
+
89
+ ## 📝 License
90
+
91
+ Distributed under the MIT License. See `LICENSE` for more information.
92
+
93
+ ---
94
+
95
+ ## 💡 Project Idea
96
+
97
+ A useful next feature would be a download history log that records previously downloaded songs.
@@ -0,0 +1,19 @@
1
+ [project]
2
+ name = "musicmandu"
3
+ version = "1.0.0"
4
+ description = "A production-grade YouTube music downloader CLI"
5
+ readme = "README.md"
6
+ authors = [
7
+ { name = "Milan Prajapati" }
8
+ ]
9
+ classifiers = [
10
+ "Programming Language :: Python :: 3",
11
+ "License :: OSI Approved :: MIT License",
12
+ "Operating System :: OS Independent",
13
+ ]
14
+ dependencies = [
15
+ "typer>=0.9.0",
16
+ "rich>=13.0.0",
17
+ "yt-dlp>=2023.0.0",
18
+ "ffmpeg-downloader>=0.1.0"
19
+ ]
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
File without changes
@@ -0,0 +1,105 @@
1
+ import sys
2
+
3
+ import typer
4
+ from rich.console import Console
5
+ from rich.progress import BarColumn, Progress, SpinnerColumn, TextColumn, DownloadColumn, TransferSpeedColumn
6
+ import os
7
+ import ffmpeg_downloader as ffdl
8
+ import yt_dlp
9
+
10
+
11
+ # initialize the typer app and rich console
12
+ app= typer.Typer(name="musicmandu",help="Youtube Music Downloader CLI")
13
+ console=Console()
14
+
15
+
16
+ def ensure_ffmpeg_installed():
17
+ """
18
+ Checks if FFmpeg is installed via ffmpeg-downloader.
19
+ If missing, automatically downloads it cleanly even with spaces in the Windows user path.
20
+ """
21
+ # 1. Check if the directory attribute exists or if the path is missing
22
+ if not hasattr(ffdl, "ffmpeg_dir") or not ffdl.ffmpeg_dir or not os.path.exists(ffdl.ffmpeg_dir):
23
+ console.print("[yellow]⚠️ FFmpeg dependency missing. Fetching production binary...[/]")
24
+
25
+ # FIX: Escape the executable path in quotes to handle any potential spaces safely
26
+ cmd = f'"{sys.executable}" -m ffmpeg_downloader install'
27
+ os.system(cmd)
28
+
29
+ # Force a refresh of the library attributes after installation completes
30
+ import importlib
31
+ importlib.reload(ffdl)
32
+
33
+ console.print("[green]✅ FFmpeg successfully provisioned and cached safely.[/]\n")
34
+
35
+ # Inject the fresh binaries into our running OS environment Path mapping
36
+ ffdl.add_path()
37
+
38
+ # Return the directory path explicitly
39
+ return str(ffdl.ffmpeg_dir)
40
+
41
+
42
+
43
+ @app.command()
44
+ def greet(name:str,formal:bool=False):
45
+ """Greet the user with a message. """
46
+ if formal:
47
+ console.print(f"Good day, {name}. Welcome to musicmandu!",style="bold green")
48
+ else:
49
+ console.print(f"Hey {name}! Welcome to musicmandu!",style="bold blue")
50
+
51
+ @app.command()
52
+ def download(url:str=typer.Argument(...,help="The Youtube URL to download the music from.")):
53
+ """
54
+ Download video audio stream and output a clean, tagged MP3 file.
55
+ """
56
+ try:
57
+ ffmpeg_dir=ensure_ffmpeg_installed()
58
+
59
+ except Exception as e:
60
+ console.print(f"[bold red]Error ensuring FFmpeg is installed: {e}[/bold red]")
61
+ raise typer.Exit(code=1)
62
+
63
+ console.print(f"[bold cyan] Scanning metadata for the provided URL: {url} [/bold cyan]")
64
+
65
+
66
+ ydl_opts={
67
+ 'format':'bestaudio/best',
68
+ 'outtmpl':'%(title)s.%(ext)s',
69
+ 'ffmpeg_location':ffmpeg_dir,
70
+ 'postprocessors':[
71
+ {
72
+ 'key': 'FFmpegExtractAudio',
73
+ 'preferredcodec': 'mp3',
74
+ 'preferredquality': '320',
75
+ },
76
+ {
77
+ 'key': 'EmbedThumbnail',
78
+ },
79
+ {
80
+ 'key': 'FFmpegMetadata',
81
+ }
82
+ ],
83
+ 'writethumbnail': True,
84
+ 'quiet': True,
85
+ 'no_warnings': True,
86
+ }
87
+
88
+ try:
89
+ with yt_dlp.YoutubeDL(ydl_opts) as ydl:
90
+ info_dict=ydl.extract_info(url, download=False)
91
+ title=info_dict.get('title','Unknown Track')
92
+
93
+ console.print(f"[bold green] 🎵 Target:[/] {title}")
94
+
95
+ with console.status("[bold blue] Processing and converting audio strean... This may take a moment.",spinner="dots"):
96
+ ydl.download([url])
97
+ console.print(f"[bold green]✅ Download and conversion completed successfully![/bold green]")
98
+
99
+ console.print(f"\n[bold green]📦 Distribution Ready![/] Saved '[italic]{title}.mp3[/]' to current working directory.")
100
+ except Exception as e:
101
+ console.print(f"[bold red]Error during download or conversion: {e}[/bold red]")
102
+ raise typer.Exit(code=1)
103
+
104
+ if __name__=='__main__':
105
+ app()
@@ -0,0 +1,111 @@
1
+ Metadata-Version: 2.4
2
+ Name: musicmandu
3
+ Version: 1.0.0
4
+ Summary: A production-grade YouTube music downloader CLI
5
+ Author: Milan Prajapati
6
+ Classifier: Programming Language :: Python :: 3
7
+ Classifier: License :: OSI Approved :: MIT License
8
+ Classifier: Operating System :: OS Independent
9
+ Description-Content-Type: text/markdown
10
+ Requires-Dist: typer>=0.9.0
11
+ Requires-Dist: rich>=13.0.0
12
+ Requires-Dist: yt-dlp>=2023.0.0
13
+ Requires-Dist: ffmpeg-downloader>=0.1.0
14
+
15
+ # 🎵 musicmandu
16
+
17
+ `musicmandu` is a production-grade, zero-configuration command-line interface (CLI) tool written in Python. It allows users to seamlessly download high-quality audio from YouTube videos and automatically process them into fully tagged, album-art-embedded MP3 files.
18
+
19
+ ---
20
+
21
+ ## ✨ Features
22
+
23
+ - **Zero Manual Dependencies:** Automatically detects, downloads, and caches the correct system-specific FFmpeg binaries at runtime—even when Windows user paths contain spaces.
24
+ - **High-Quality Audio:** Downloads the best available audio stream and converts it into a clean 192 kbps MP3 file.
25
+ - **Rich Metadata Integration:** Automatically extracts and embeds metadata such as the title and creator, then downloads and embeds the video's high-resolution thumbnail as album art.
26
+ - **Sleek Visual Feedback:** Uses `Rich` console components to replace noisy console output with clean status spinners and styled messages.
27
+
28
+ ---
29
+
30
+ ## 🚀 Installation & Prerequisites
31
+
32
+ `musicmandu` runs on **Windows, macOS, and Linux**.
33
+
34
+ ### 1. Requirements
35
+
36
+ - Python 3.8 or later
37
+
38
+ ### 2. Set Up the Project
39
+
40
+ Clone or navigate to the project directory, then install the required Python packages:
41
+
42
+ ```bash
43
+ pip install typer rich yt-dlp ffmpeg-downloader
44
+ ```
45
+
46
+ ---
47
+
48
+ ## 🛠 Usage & Commands
49
+
50
+ Run the CLI using standard Python execution syntax:
51
+
52
+ ```bash
53
+ python main.py [COMMAND] [ARGUMENTS] [FLAGS]
54
+ ```
55
+
56
+ ### 1. Greet Users (`greet`)
57
+
58
+ Test the CLI setup or display a custom greeting.
59
+
60
+ ```bash
61
+ # Standard greeting
62
+ python main.py greet Milan
63
+
64
+ # Formal greeting
65
+ python main.py greet "Mr. Wayne" --formal
66
+ ```
67
+
68
+ ### 2. Download Tracks (`download`)
69
+
70
+ Download audio and save a formatted MP3 file in the current working directory.
71
+
72
+ ```bash
73
+ python main.py download "https://www.youtube.com/watch?v=dQw4w9WgXcQ"
74
+ ```
75
+
76
+ ### 3. View Built-in Help
77
+
78
+ Display automatically generated command descriptions, arguments, and flags.
79
+
80
+ ```bash
81
+ python main.py --help
82
+ python main.py download --help
83
+ ```
84
+
85
+ ---
86
+
87
+ ## ⚙️ Architecture & Under the Hood
88
+
89
+ The application relies on three core frameworks to provide a seamless user experience:
90
+
91
+ - **Typer:** Powers command parsing, argument handling, flags, and dynamically generated help screens.
92
+ - **Rich:** Manages styled terminal output, layout, and responsive loading indicators.
93
+ - **yt-dlp and ffmpeg-downloader:** Handle the download and processing pipeline, including metadata extraction, high-bitrate audio retrieval, thumbnail downloading, and FFmpeg-based MP3 conversion.
94
+
95
+ ### Runtime Dependency Sandbox
96
+
97
+ When the `download` command is invoked, the application runs a gatekeeper function named `ensure_ffmpeg_installed`.
98
+
99
+ If a valid FFmpeg installation cannot be found in the system path, the application downloads and caches a platform-specific FFmpeg binary. It then maps the binary into the current process environment without modifying the user's global system configuration.
100
+
101
+ ---
102
+
103
+ ## 📝 License
104
+
105
+ Distributed under the MIT License. See `LICENSE` for more information.
106
+
107
+ ---
108
+
109
+ ## 💡 Project Idea
110
+
111
+ A useful next feature would be a download history log that records previously downloaded songs.
@@ -0,0 +1,9 @@
1
+ README.md
2
+ pyproject.toml
3
+ src/musicmandu/__init__.py
4
+ src/musicmandu/main.py
5
+ src/musicmandu.egg-info/PKG-INFO
6
+ src/musicmandu.egg-info/SOURCES.txt
7
+ src/musicmandu.egg-info/dependency_links.txt
8
+ src/musicmandu.egg-info/requires.txt
9
+ src/musicmandu.egg-info/top_level.txt
@@ -0,0 +1,4 @@
1
+ typer>=0.9.0
2
+ rich>=13.0.0
3
+ yt-dlp>=2023.0.0
4
+ ffmpeg-downloader>=0.1.0
@@ -0,0 +1 @@
1
+ musicmandu