Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

---

## [1.2.5] - 2026-03-11

### Changed
- **Rebranding: "Video Normalizer" renamed to "Video Tools".** All references to the `video_normalizer` integration (dependency declaration, import path, conflict-detection logic, persistent notification messages, and documentation) have been updated to `video_tools`.

---

## [1.2.4] - 2026-03-11

### Fixed
Expand Down Expand Up @@ -229,6 +236,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Service `media_downloader.download_file` with optional subdirectories, custom filenames, overwrite control, and per-download timeout.
- Events: `media_downloader_download_started`, `media_downloader_download_completed` (with `success` and `error` fields).

[1.2.5]: https://github.com/Geek-MD/Advanced_Downloader/compare/v1.2.4...v1.2.5
[1.2.4]: https://github.com/Geek-MD/Advanced_Downloader/compare/v1.2.3...v1.2.4
[1.2.3]: https://github.com/Geek-MD/Advanced_Downloader/compare/v1.2.2...v1.2.3
[1.2.2]: https://github.com/Geek-MD/Advanced_Downloader/compare/v1.2.1...v1.2.2
Expand Down
24 changes: 12 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

# Advanced Downloader

**Advanced Downloader** is a custom Home Assistant integration that greatly extends file downloading capabilities beyond the built-in `downloader` integration. It downloads, normalizes, and manages media files directly from Home Assistant through simple services — and leverages [Video Normalizer](https://github.com/Geek-MD/Video_Normalizer) as a dependency for all video processing.
**Advanced Downloader** is a custom Home Assistant integration that greatly extends file downloading capabilities beyond the built-in `downloader` integration. It downloads, normalizes, and manages media files directly from Home Assistant through simple services — and leverages [Video Tools](https://github.com/Geek-MD/Video_Tools) as a dependency for all video processing.

> **Domain:** `advanced_downloader`
> Advanced Downloader is a full superset of the core `downloader` integration. If you have `downloader:` in your `configuration.yaml`, a persistent notification will appear at startup reminding you to remove it. After removing it, restart Home Assistant.
Expand All @@ -26,7 +26,7 @@
- Optional subdirectories and custom filenames.
- Overwrite policy (default or per-call).
- Delete a single file or all files in a directory via services.
- **Automatic aspect ratio normalization** for downloaded videos (powered by Video Normalizer).
- **Automatic aspect ratio normalization** for downloaded videos (powered by Video Tools).
- **Automatic thumbnail generation and embedding** for correct video previews in Telegram and mobile players.
- Optional video resizing (width/height) if dimensions differ.
- Persistent status sensor (`sensor.advanced_downloader_status`) to track operations (`idle` / `working`).
Expand All @@ -36,22 +36,22 @@
---

## 🧩 Dependencies
- [Video Normalizer](https://github.com/Geek-MD/Video_Normalizer) — required for video processing (aspect normalization, thumbnail embedding, resizing). Install it via HACS before adding Advanced Downloader.
- [Video Tools](https://github.com/Geek-MD/Video_Tools) — required for video processing (aspect normalization, thumbnail embedding, resizing). Install it via HACS before adding Advanced Downloader.

---

## 🧰 Requirements
- Home Assistant 2024.1.0 or newer.
- A valid writable directory for storing media files (e.g., `/media` or `/config/media`).
- `ffmpeg` and `ffprobe` must be installed and available in the system path.
- [Video Normalizer](https://github.com/Geek-MD/Video_Normalizer) installed as a HACS integration.
- [Video Tools](https://github.com/Geek-MD/Video_Tools) installed as a HACS integration.

---

## ⚙️ Installation

### Option 1: Manual Installation
1. Install [Video Normalizer](https://github.com/Geek-MD/Video_Normalizer) first.
1. Install [Video Tools](https://github.com/Geek-MD/Video_Tools) first.
2. Download the latest release from [GitHub](https://github.com/Geek-MD/Advanced_Downloader/releases).
3. Copy the folder `advanced_downloader` into:
```
Expand All @@ -63,7 +63,7 @@
---

### Option 2: HACS Installation
1. Install [Video Normalizer](https://github.com/Geek-MD/Video_Normalizer) via HACS first.
1. Install [Video Tools](https://github.com/Geek-MD/Video_Tools) via HACS first.
2. Go to **HACS → Integrations → Custom Repositories**.
3. Add the repository URL:
```
Expand Down Expand Up @@ -91,7 +91,7 @@ You can modify these settings later via the integration options.

### 1. `advanced_downloader.download_file`
Downloads a file from a given URL.
For video files, the following steps are always performed via Video Normalizer:
For video files, the following steps are always performed via Video Tools:
1. **Aspect ratio normalization** (`setsar=1,setdar=width/height`).
2. **Thumbnail generation and embedding** (ensures correct previews in Telegram and other platforms).
3. **Optional resize** if `resize_enabled: true`.
Expand All @@ -107,7 +107,7 @@ For video files, the following steps are always performed via Video Normalizer:
| `resize_enabled` | no | If true, resize the video when dimensions mismatch. |
| `resize_width` | no | Target width for resize (default 640). |
| `resize_height` | no | Target height for resize (default 360). |
| `target_aspect_ratio` | no | Target display aspect ratio as decimal (e.g. `1.777` for 16:9). Passed to Video Normalizer during normalization. Omit to let Video Normalizer infer from the video's own dimensions. |
| `target_aspect_ratio` | no | Target display aspect ratio as decimal (e.g. `1.777` for 16:9). Passed to Video Tools during normalization. Omit to let Video Tools infer from the video's own dimensions. |

#### Example:
```yaml
Expand Down Expand Up @@ -208,7 +208,7 @@ The integration provides the persistent entity:
### Migrating from `downloader` + `video_normalizer` automations

If you previously had automations that combined the core **Downloader** integration
(`downloader.download_file`) with the standalone **Video Normalizer** integration
(`downloader.download_file`) with the standalone **Video Tools** integration
(`video_normalizer.normalize_video`), follow this guide to migrate them to
**Advanced Downloader**, which performs both operations in a single service call.

Expand All @@ -229,7 +229,7 @@ If you previously had automations that combined the core **Downloader** integrat
event_type: downloader_download_completed
continue_on_timeout: false

# 3. Normalize the video using the standalone Video Normalizer integration
# 3. Normalize the video using the standalone Video Tools integration
- action: video_normalizer.normalize_video
data:
overwrite: true
Expand All @@ -238,7 +238,7 @@ If you previously had automations that combined the core **Downloader** integrat
input_file_path: /media/ring/ring.mp4
target_aspect_ratio: 1.777

# 4. Wait for Video Normalizer to finish (poll the sensor)
# 4. Wait for Video Tools to finish (poll the sensor)
- if:
- condition: state
entity_id: sensor.video_normalizer_status
Expand Down Expand Up @@ -277,7 +277,7 @@ If you previously had automations that combined the core **Downloader** integrat
subdir: ring
filename: ring.mp4
overwrite: true
target_aspect_ratio: 1.777 # forwarded to Video Normalizer
target_aspect_ratio: 1.777 # forwarded to Video Tools

# 2. Wait for job completion (success) or failure
- wait_for_trigger:
Expand Down
20 changes: 10 additions & 10 deletions custom_components/advanced_downloader/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
ensure_within_base,
)

from custom_components.video_normalizer.video_processor import VideoProcessor
from custom_components.video_tools.video_processor import VideoProcessor

_LOGGER = logging.getLogger(__name__)
PLATFORMS: list[str] = ["sensor"]
Expand Down Expand Up @@ -106,29 +106,29 @@ def _check_downloader_conflict(_: HomeAssistant) -> None:

async_at_start(hass, _check_downloader_conflict)

# Warn if Video Normalizer is also configured as a standalone integration.
# Warn if Video Tools is also configured as a standalone integration.
# Its code must remain installed (Advanced Downloader imports from it), but
# the standalone config entry should be removed to avoid duplicate processing.
if hass.config_entries.async_entries("video_normalizer"):
if hass.config_entries.async_entries("video_tools"):
_LOGGER.warning(
"Video Normalizer is configured as a standalone integration alongside "
"Video Tools is configured as a standalone integration alongside "
"Advanced Downloader. Remove its config entry from Settings → Devices & "
"Services to avoid duplicate video processing. Keep the HACS package "
"installed — Advanced Downloader still requires its code."
)
_pn.async_create(
hass,
(
"**Video Normalizer** is installed as a standalone integration, but it "
"**Video Tools** is installed as a standalone integration, but it "
"is now used as a dependency by **Advanced Downloader**.\n\n"
"To avoid duplicate video processing, please remove the Video Normalizer "
"To avoid duplicate video processing, please remove the Video Tools "
"configuration entry:\n"
"**Settings → Devices & Services → Video Normalizer → Delete**\n\n"
"**Settings → Devices & Services → Video Tools → Delete**\n\n"
"⚠️ Do **not** uninstall the HACS package — Advanced Downloader still "
"requires its code."
),
title="Advanced Downloader: Remove standalone Video Normalizer",
notification_id="advanced_downloader_video_normalizer_conflict",
title="Advanced Downloader: Remove standalone Video Tools",
notification_id="advanced_downloader_video_tools_conflict",
)

video_processor = VideoProcessor()
Expand Down Expand Up @@ -201,7 +201,7 @@ async def _async_download(call: ServiceCall) -> None:
})

# Delegate video processing (aspect normalization, thumbnail embedding,
# optional resize) to Video Normalizer
# optional resize) to Video Tools
if dest_path.suffix.lower() in VIDEO_EXTENSIONS:
if resize_enabled:
sensor.start_process(PROCESS_RESIZING)
Expand Down
4 changes: 2 additions & 2 deletions custom_components/advanced_downloader/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
"name": "Advanced Downloader",
"codeowners": ["@Geek-MD"],
"config_flow": true,
"dependencies": ["video_normalizer"],
"dependencies": ["video_tools"],
"documentation": "https://github.com/Geek-MD/Advanced_Downloader",
"iot_class": "local_push",
"issue_tracker": "https://github.com/Geek-MD/Advanced_Downloader/issues",
"quality_scale": "legacy",
"requirements": [],
"version": "1.2.4"
"version": "1.2.5"
}
Loading