# MediaRip Build Instructions

These instructions build MediaRip from source on Windows.

## Prerequisites

- Windows 10 or later.
- Python 3.13 via the `py` launcher.
- FFmpeg installed separately and available on `PATH`.
- Optional: aria2c on `PATH` for faster downloads.

## Clean Checkout

```powershell
git status --short
```

The working tree should be clean before building.

## Install Dependencies

```powershell
py -m pip install -r requirements.txt
```

For reproducible release validation, record the dependency versions used:

```powershell
New-Item -ItemType Directory -Force build
py -m pip freeze > build\requirements.freeze.txt
```

## Run Tests

```powershell
.\run_tests.bat
```

All suites must pass before packaging.

## Build Executable

```powershell
py -m PyInstaller --clean yt_mp3_downloader_gui.spec
```

Expected output:

```text
dist\MediaRip.exe
```

The spec bundles `tkinterdnd2`, `customtkinter`, the MediaRip icon, the header
logo, and yt-dlp modules. It does not bundle FFmpeg or aria2c.

## Release Validation

After building, verify:

- The app starts without an existing config file.
- The app starts without an existing history database.
- The footer shows the expected version.
- Basic no-download smoke checks pass for YouTube, Spotify, smart search,
  playlist enumeration, and Analytics.

## Cleanup

`build\` and `dist\` are generated artifacts and are ignored by git. Recreate
them from source for each release candidate.
