Metadata-Version: 2.4
Name: imansur_ytb
Version: 0.1.8
Summary: A versatile tool for YouTube media downloading and AI processing.
Author-email: imansur <your-email@example.com>
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Requires-Python: >=3.8
Description-Content-Type: text/markdown
Requires-Dist: yt-dlp
Requires-Dist: youtube-transcript-api
Requires-Dist: static-ffmpeg
Requires-Dist: python-dotenv
Requires-Dist: httpx
Requires-Dist: sqlalchemy
Requires-Dist: pydantic
Requires-Dist: edge-tts
Requires-Dist: certifi

# imansur_ytb

A versatile tool for YouTube media downloading and AI processing.

## Installation

```bash
pip install imansur_ytb
```

## Usage

```python
from imansur_ytb.media import get_video

# Basic usage
results = get_video("https://www.youtube.com/watch?v=...", rename="my_video")

# Advanced usage with all parameters
results = get_video(
    url="https://www.youtube.com/watch?v=...",
    get_best_quality=True,      # Download highest resolution (default: True)
    audio_only=False,           # Only download audio track (default: False)
    get_transcript=True,        # Download English transcript (default: True)
    rename="my_custom_name",    # Custom name for files/folders
    audio_format="mp3",         # Desired audio format: mp3, m4a, wav, flac, aac (default: mp3)
    quiet=True                  # Suppress yt-dlp logs (default: True, set False for debugging)
)
```

## Parameters

| Parameter | Type | Default | Description |
| :--- | :--- | :--- | :--- |
| `url` | `str` | *Required* | YouTube Video or Playlist URL. |
| `get_best_quality` | `bool` | `True` | Downloads the best available quality and merges streams. |
| `audio_only` | `bool` | `False` | Extract and download only the audio track. |
| `get_transcript` | `bool` | `True` | Downloads the English transcript as a JSON file. |
| `rename` | `str` | `None` | Custom filename (or directory name for playlists). |
| `audio_format` | `str` | `"mp3"` | Audio extension (mp3, m4a, wav, flac, aac). |
| `quiet` | `bool` | `True` | Set to `False` to see full download and merge logs. |

## Response

The function returns a list of dictionaries:
```python
[
  {
    "id": "video_id",
    "title": "Video Title",
    "file_path": "/path/to/video.mp4",
    "transcript_path": "/path/to/transcript.json"
  }
]
```
