Terminal interface to find, download, and stream movies, TV shows, and live TV using local media players.
feat: update download logic to use active subject ID and refresh project documentation and screenshots
Samir Hossains1008fd20ee0a
diff --git a/README.md b/README.mdindex b80602d..9677f17 100644--- a/README.md+++ b/README.md@@ -1,8 +1,9 @@<div align="center">-# MovieBox-Tui+# MovieBox-TUI-Stream and download movies, TV shows, anime, and watch live TV from the terminal.+**Stream movies, TV shows, anime, and live TV straight from your terminal.** <br>+Fast and clean. No configuration, no torrents, and no debrid required.[](https://crates.io/crates/moviebox-tui)[](https://crates.io/crates/moviebox-tui)@@ -11,81 +12,58 @@ Stream and download movies, TV shows, anime, and watch live TV from the terminal<br>-**[See what's new in v0.1.6 on YouTube](https://youtu.be/TlDxCFttoAU)**--</div>+<img src="https://raw.githubusercontent.com/mesamirh/MovieBox-Tui/main/assets/screenshots/01-home-blocky.jpg" alt="MovieBox-TUI Home" width="85%">+<br><br>-## What is this?+**[See what's new in v0.1.7 on YouTube](https://youtu.be/5M2_mjH5r5Y)**-**MovieBox-Tui** is a terminal-based streaming client. It interfaces with the MovieBox to search catalogs, resolve stream URLs, and open them in your local video player (`mpv`, `IINA`, or `VLC`).+<br>-No browser or configuration is required. Search for a title, select a video quality, and press enter to play or download the stream.+**Found a bug?** [Open an issue](https://github.com/mesamirh/MovieBox-Tui/issues) so I can fix it for everyone!-> **Disclaimer:** This project is a third-party client. It does not host, store, or redistribute any media. It strictly resolves links provided by the upstream API. It is intended for educational and personal use only. You are responsible for complying with copyright law in your jurisdiction.+</div>## Screenshots-<details open>-<summary><b>Home and search</b></summary>+<details>+<summary><b>Click to view gallery</b></summary><br><p align="center">- <img src="https://raw.githubusercontent.com/mesamirh/MovieBox-Tui/main/assets/screenshots/01-home.jpg" alt="Home screen" width="49%">- <img src="https://raw.githubusercontent.com/mesamirh/MovieBox-Tui/main/assets/screenshots/02-search-results.jpg" alt="Search results" width="49%">+ <b>Details View & Search</b><br>+ <img src="https://raw.githubusercontent.com/mesamirh/MovieBox-Tui/main/assets/screenshots/08-series-details.jpg" alt="Series details" width="49%">+ <img src="https://raw.githubusercontent.com/mesamirh/MovieBox-Tui/main/assets/screenshots/06-search-results.jpg" alt="Search results" width="49%"></p>-</details>--<details>-<summary><b>Details view</b></summary>-<br>-<p align="center">- <img src="https://raw.githubusercontent.com/mesamirh/MovieBox-Tui/main/assets/screenshots/03-movie-details.jpg" alt="Movie details" width="49%">- <img src="https://raw.githubusercontent.com/mesamirh/MovieBox-Tui/main/assets/screenshots/04-series-details.jpg" alt="Series details" width="49%">+ <b>Playback & Subtitles</b><br>+ <img src="https://raw.githubusercontent.com/mesamirh/MovieBox-Tui/main/assets/screenshots/11-player-picker.jpg" alt="Player picker" width="49%">+ <img src="https://raw.githubusercontent.com/mesamirh/MovieBox-Tui/main/assets/screenshots/10-playback-subtitles.jpg" alt="Subtitle selection" width="49%"></p>-</details>--<details>-<summary><b>Playback and Subtitles</b></summary>-<br>-<p align="center">- <img src="https://raw.githubusercontent.com/mesamirh/MovieBox-Tui/main/assets/screenshots/06-player.jpg" alt="Player Selection" width="49%">- <img src="https://raw.githubusercontent.com/mesamirh/MovieBox-Tui/main/assets/screenshots/05-subtitle.jpg" alt="Subtitle Selection" width="49%">+ <b>Downloads & Live TV</b><br>+ <img src="https://raw.githubusercontent.com/mesamirh/MovieBox-Tui/main/assets/screenshots/12-download-progress.jpg" alt="Download progress" width="49%">+ <img src="https://raw.githubusercontent.com/mesamirh/MovieBox-Tui/main/assets/screenshots/09-live-tv-list.jpg" alt="Live TV Channels" width="49%"></p>-</details>--<details>-<summary><b>Live TV Channels</b></summary>-<br>-<p align="center">- <img src="https://raw.githubusercontent.com/mesamirh/MovieBox-Tui/main/assets/screenshots/07-channel-list.jpg" alt="TV Channels" width="88%">+ <b>Themes & Help</b><br>+ <img src="https://raw.githubusercontent.com/mesamirh/MovieBox-Tui/main/assets/screenshots/03-home-3d.jpg" alt="Home 3D Theme" width="49%">+ <img src="https://raw.githubusercontent.com/mesamirh/MovieBox-Tui/main/assets/screenshots/04-global-help.jpg" alt="Global Help Menu" width="49%"></p>-</details>--<details>-<summary><b>Live TV Mode</b></summary>-<br>-<p align="center">- <img src="https://raw.githubusercontent.com/mesamirh/MovieBox-Tui/main/assets/screenshots/08-tv-home.jpg" alt="Live TV Home" width="88%">+ <b>More Views</b><br>+ <img src="https://raw.githubusercontent.com/mesamirh/MovieBox-Tui/main/assets/screenshots/07-movie-details.jpg" alt="Movie details" width="49%">+ <img src="https://raw.githubusercontent.com/mesamirh/MovieBox-Tui/main/assets/screenshots/02-home-ascii.jpg" alt="Home ASCII Theme" width="49%"></p>-</details>--<details>-<summary><b>Help and Configuration</b></summary>-<br>-<p align="center">- <img src="https://raw.githubusercontent.com/mesamirh/MovieBox-Tui/main/assets/screenshots/09-help.jpg" alt="Help screen" width="88%">+ <b>Configuration</b><br>+ <img src="https://raw.githubusercontent.com/mesamirh/MovieBox-Tui/main/assets/screenshots/05-tv-help.jpg" alt="TV Configuration Menu" width="49%"></p></details>@@ -93,56 +71,29 @@ No browser or configuration is required. Search for a title, select a video qual## Features-- **Search & discover easily:** Just start typing to find what you want, or use commands like `/movies` and `/anime` to see what's trending.-- **All the details you need:** Select a title to see its poster, IMDb rating, release year, genre, and a quick summary.-- **Play instantly:** The app grabs different stream qualities (like 1080p and 720p) behind the scenes. Pick your resolution and subtitles, and it starts playing immediately.-- **Built-in fast downloader:**- - Download videos straight to your disk using multiple connections to max out your internet speed. You get live speed and ETA updates while you wait.- - **Subtitles included:** It automatically grabs the `.srt` subtitle files to match your video.- - **Download entire seasons:** Queue up a whole season at once. Just tell it what language you want for the subtitles, and it handles the rest automatically.-- **Live TV Mode:** Press `Ctrl+T` to switch to TV mode and watch thousands of live IPTV channels from around the world straight from your terminal.-- **Works on your terminal:** Whether you're on macOS, Linux, or Windows, it just works. If your terminal supports it, you'll get actual image posters; otherwise, it falls back nicely to text.---## What you'll need--1. **A Terminal:** Any terminal works! Just make sure your window is at least 85×24 characters. If you use a modern terminal, you'll even get high quality native image posters automatically.-2. **A Video Player:** You'll need `mpv`, `IINA` (for macOS), or `VLC` installed. The app will automatically find whichever one you have and use it.--<details>-<summary><b>Want to download a pre-built binary instead?</b></summary>-<br>+### Streaming & Playback+- **Instant Search & Catalogs:** Type to search instantly, or browse trending movies, shows, and anime using slash commands (e.g., `/movies`, `/anime`).+- **Seamless Local Playback:** Resolves 4K/1080p streams and opens them instantly in your preferred local video player (`mpv`, `IINA`, or `VLC`).+- **Integrated Subtitles:** Automatically fetches available subtitles and lets you select your preferred language before playback.+- **Live IPTV:** Press `Ctrl+T` to toggle Live TV mode and stream thousands of live television channels globally.-You can grab the compiled executable directly from the [Releases page](https://github.com/mesamirh/MovieBox-Tui/releases/latest).+### Advanced Downloading+- **Batch Season Downloader:** Queue up entire television seasons for concurrent downloading with a single keystroke.+- **Resilient Downloads:** Built-in support for download resumes. If a download is interrupted or fails, it picks up right where it left off.+- **Auto-Subtitle Fetching:** Automatically downloads the best-matching `.srt` subtitle files alongside your video files.-</details>--<details>-<summary><b>Need help installing a video player?</b></summary>-<br>--```bash-# macOS-brew install mpv-# or-brew install --cask iina--# Debian / Ubuntu-sudo apt install mpv--# Arch Linux-sudo pacman -S mpv--# Windows-choco install mpv-```--</details>+### Terminal Experience+- **Native Image Rendering:** Enjoy high-resolution movie posters rendered directly in supported terminals.+- **Dynamic Theming:** Switch between beautiful 3D block layouts and clean ASCII themes to fit your aesthetic.+- **Power-User Slash Commands:** Use terminal-style commands to update the app (`/update`), switch categories, or customize your Live TV playlists (`/config`).+- **Smart Auto-Cleanup:** A silent background worker intelligently manages and deletes old cache files to protect your disk space.## Installation-The easiest way to get started is by using the quick install scripts below. If you're a Rust developer, you can also just grab it from Cargo.+**Prerequisites:** You will need a terminal (at least 85×24 characters) and a local video player installed (e.g. `mpv`, `IINA`, or `VLC`).++The easiest way to get started is by using our quick install scripts. These scripts will automatically download the correct version for your computer.### macOS & Linux```bash@@ -154,7 +105,7 @@ curl -fsSL https://raw.githubusercontent.com/mesamirh/MovieBox-Tui/main/install.powershell -c "irm https://raw.githubusercontent.com/mesamirh/MovieBox-Tui/main/install.ps1 | iex"```-### Cargo (Rust)+### Cargo (For Rust Developers)```bashcargo install moviebox-tui```@@ -162,34 +113,33 @@ cargo install moviebox-tui## Getting Started-Just open your terminal and type `moviebox-tui` to jump in.--Here's how to get around:-- **Search:** Just start typing! It searches instantly.-- **Navigate:** Use the <kbd>Up</kbd> / <kbd>Down</kbd> / <kbd>Left</kbd> / <kbd>Right</kbd> arrow keys.-- **Select:** Press <kbd>Enter</kbd> to view details, pick episodes, or start playing a video.-- **Switch Player:** Press <kbd>o</kbd> on a stream if you want to open it in a different video player.-- **Download:** Press <kbd>d</kbd> on any episode or season to save it to your disk (you'll get to pick your subtitles first).-- **Live TV:** Press <kbd>Ctrl+T</kbd> to toggle Live TV mode and browse IPTV channels.-- **Refresh:** Press <kbd>r</kbd> if a stream link expires and needs to be re-fetched.-- **Help:** Need a quick reminder? Press <kbd>?</kbd> anywhere to see the cheat sheet.-- **Quit:** Press <kbd>q</kbd> to exit (use <kbd>Esc</kbd> to go back or clear search).+Once installed, just open your terminal and type `moviebox-tui` to jump in!-### Handy Slash Commands-You can type these special commands straight into the search bar:+### Keyboard Controls-**General commands:**-- `/clear-cache` - Free up disk space by wiping downloaded images and cache.-- `/update` - Check to see if there's a new version of the app.-- `/toggle-update` - Turn automatic background update checking on or off.+| Key | Action |+| --- | --- |+| Alphanumeric | Start searching instantly |+| <kbd>↑</kbd> <kbd>↓</kbd> <kbd>←</kbd> <kbd>→</kbd> | Navigate menus and grids |+| <kbd>Enter</kbd> | View details, pick episodes, or play video |+| <kbd>o</kbd> | Switch to a different video player on playback |+| <kbd>d</kbd> | Download an episode or an entire season |+| <kbd>Ctrl</kbd>+<kbd>p</kbd> | Switch between different content providers / sources |+| <kbd>Ctrl</kbd>+<kbd>t</kbd> | Toggle Live TV mode to browse IPTV channels |+| <kbd>?</kbd> | Open the global help menu |+| <kbd>q</kbd> | Quit (or use <kbd>Esc</kbd> to go back/clear search) |-**Streaming Mode commands:**-- `/discover` or `/home` - See what's trending right now.-- `/movies`, `/shows`, `/anime` - Jump straight to a specific category.+### Slash Commands+You can type these special commands straight into the search bar:-**Live TV Mode commands:**-- `/list` - Show the list of available live channels.-- `/config` - Open the TV configuration menu to add your own m3u playlists.+| Command | Category | Description |+| --- | --- | --- |+| `/discover` or `/home` | Streaming | See what's trending right now |+| `/movies`, `/shows`, `/anime`| Streaming | Jump straight to a specific category |+| `/list` | Live TV | Show the list of available live channels |+| `/config` | Live TV | Open the TV configuration menu to add your own m3u playlists |+| `/update` | General | Check to see if there's a new version of the app |+| `/toggle-update` | General | Turn automatic background update checking on or off |## Contributing@@ -197,7 +147,7 @@ You can type these special commands straight into the search bar:I'd love your help making this even better! If you've got a big feature in mind, it's usually best to open an issue first so we can chat about it.```bash-git clone https://github.com/<your-username>/MovieBox-Tui.git+git clone https://github.com/mesamirh/MovieBox-Tui.gitcd MovieBox-Tuicargo build```@@ -205,16 +155,20 @@ cargo buildJust try to follow [Conventional Commits](https://www.conventionalcommits.org/) and make sure `cargo fmt` and `cargo clippy` are happy before you open a PR. You can check out [CONTRIBUTING.md](CONTRIBUTING.md) for the full rundown.-## Credits+## Credits & LegalLive TV channel playlists are graciously provided by [iptv-org/iptv](https://github.com/iptv-org/iptv).+> **Disclaimer:** This is a third-party client. It does not host or store any media and only resolves links from upstream APIs. Intended for personal use only.+++## Community & Support-## Support+The best way to support MovieBox-TUI is simply to use it, share it, and leave a star on GitHub!-If this TUI makes your movie nights better and you want to support its development, crypto tips are always super appreciated:+If you'd like to buy me a coffee for the late nights spent coding, you can use the addresses below.-- **EVM (ETH, BNB, Polygon, etc):** `0x7ea20d5fa29d87f33195f5a3b211ff94038d794c`+- **EVM:** `0x7ea20d5fa29d87f33195f5a3b211ff94038d794c`- **BTC:** `3MEAtqtRWrQBhnaMi3Zuf5nt2efNUS2LUQ`- **LTC:** `ltc1qhjkq2n6tsayxj56n3c53uqv23v8vqhvc9g3vxl`@@ -225,6 +179,6 @@ If this TUI makes your movie nights better and you want to support its developmeDual-licensed under [MIT](LICENSE-MIT) or [Apache 2.0](LICENSE-APACHE) at your option.<br>Built by [**@mesamirh**](https://github.com/mesamirh)-<sub>Not affiliated with MovieBox or its operators.</sub>+<sub>Not affiliated with any third-party content providers or operators.</sub></div>diff --git a/assets/screenshots/01-home-blocky.jpg b/assets/screenshots/01-home-blocky.jpgnew file mode 100644index 0000000..10a1eefBinary files /dev/null and b/assets/screenshots/01-home-blocky.jpg differdiff --git a/assets/screenshots/01-home.jpg b/assets/screenshots/01-home.jpgdeleted file mode 100644index 009b96f..0000000Binary files a/assets/screenshots/01-home.jpg and /dev/null differdiff --git a/assets/screenshots/02-home-ascii.jpg b/assets/screenshots/02-home-ascii.jpgnew file mode 100644index 0000000..ab9d47cBinary files /dev/null and b/assets/screenshots/02-home-ascii.jpg differdiff --git a/assets/screenshots/02-search-results.jpg b/assets/screenshots/02-search-results.jpgdeleted file mode 100644index 7ec621c..0000000Binary files a/assets/screenshots/02-search-results.jpg and /dev/null differdiff --git a/assets/screenshots/03-home-3d.jpg b/assets/screenshots/03-home-3d.jpgnew file mode 100644index 0000000..c57a117Binary files /dev/null and b/assets/screenshots/03-home-3d.jpg differdiff --git a/assets/screenshots/03-movie-details.jpg b/assets/screenshots/03-movie-details.jpgdeleted file mode 100644index 3f910df..0000000Binary files a/assets/screenshots/03-movie-details.jpg and /dev/null differdiff --git a/assets/screenshots/04-global-help.jpg b/assets/screenshots/04-global-help.jpgnew file mode 100644index 0000000..cda0ee5Binary files /dev/null and b/assets/screenshots/04-global-help.jpg differdiff --git a/assets/screenshots/04-series-details.jpg b/assets/screenshots/04-series-details.jpgdeleted file mode 100644index f27f96f..0000000Binary files a/assets/screenshots/04-series-details.jpg and /dev/null differdiff --git a/assets/screenshots/05-subtitle.jpg b/assets/screenshots/05-subtitle.jpgdeleted file mode 100644index 0d7a424..0000000Binary files a/assets/screenshots/05-subtitle.jpg and /dev/null differdiff --git a/assets/screenshots/05-tv-help.jpg b/assets/screenshots/05-tv-help.jpgnew file mode 100644index 0000000..e55b8f2Binary files /dev/null and b/assets/screenshots/05-tv-help.jpg differdiff --git a/assets/screenshots/06-player.jpg b/assets/screenshots/06-player.jpgdeleted file mode 100644index b0f7e00..0000000Binary files a/assets/screenshots/06-player.jpg and /dev/null differdiff --git a/assets/screenshots/06-search-results.jpg b/assets/screenshots/06-search-results.jpgnew file mode 100644index 0000000..508de82Binary files /dev/null and b/assets/screenshots/06-search-results.jpg differdiff --git a/assets/screenshots/07-channel-list.jpg b/assets/screenshots/07-channel-list.jpgdeleted file mode 100644index db4003a..0000000Binary files a/assets/screenshots/07-channel-list.jpg and /dev/null differdiff --git a/assets/screenshots/07-movie-details.jpg b/assets/screenshots/07-movie-details.jpgnew file mode 100644index 0000000..10038dcBinary files /dev/null and b/assets/screenshots/07-movie-details.jpg differdiff --git a/assets/screenshots/08-series-details.jpg b/assets/screenshots/08-series-details.jpgnew file mode 100644index 0000000..5a86c5dBinary files /dev/null and b/assets/screenshots/08-series-details.jpg differdiff --git a/assets/screenshots/08-tv-home.jpg b/assets/screenshots/08-tv-home.jpgdeleted file mode 100644index e0fec2b..0000000Binary files a/assets/screenshots/08-tv-home.jpg and /dev/null differdiff --git a/assets/screenshots/09-help.jpg b/assets/screenshots/09-help.jpgdeleted file mode 100644index ea1443a..0000000Binary files a/assets/screenshots/09-help.jpg and /dev/null differdiff --git a/assets/screenshots/09-live-tv-list.jpg b/assets/screenshots/09-live-tv-list.jpgnew file mode 100644index 0000000..8d12fc7Binary files /dev/null and b/assets/screenshots/09-live-tv-list.jpg differdiff --git a/assets/screenshots/10-playback-subtitles.jpg b/assets/screenshots/10-playback-subtitles.jpgnew file mode 100644index 0000000..b23b314Binary files /dev/null and b/assets/screenshots/10-playback-subtitles.jpg differdiff --git a/assets/screenshots/10-tv-help.jpg b/assets/screenshots/10-tv-help.jpgdeleted file mode 100644index e731877..0000000Binary files a/assets/screenshots/10-tv-help.jpg and /dev/null differdiff --git a/assets/screenshots/11-player-picker.jpg b/assets/screenshots/11-player-picker.jpgnew file mode 100644index 0000000..3e1982dBinary files /dev/null and b/assets/screenshots/11-player-picker.jpg differdiff --git a/assets/screenshots/12-download-progress.jpg b/assets/screenshots/12-download-progress.jpgnew file mode 100644index 0000000..4553590Binary files /dev/null and b/assets/screenshots/12-download-progress.jpg differdiff --git a/install.ps1 b/install.ps1index 7d04269..d81edbe 100644--- a/install.ps1+++ b/install.ps1@@ -1,45 +1,88 @@$ErrorActionPreference = 'Stop'+Set-StrictMode -Version Latest++function Write-Info { param([string]$Message) Write-Host "$Message" -ForegroundColor Cyan }+function Write-Success { param([string]$Message) Write-Host "$Message" -ForegroundColor Green }+function Write-Warn { param([string]$Message) Write-Host "WARNING: $Message" -ForegroundColor Yellow }+function Write-Err { param([string]$Message) Write-Host "ERROR: $Message" -ForegroundColor Red; exit 1 }$InstallDir = "$env:USERPROFILE\AppData\Local\MovieBox-Tui"$ExePath = "$InstallDir\moviebox-tui.exe"$ZipFile = "$env:TEMP\MovieBox_Windows_x64.zip"-$Url = "https://github.com/mesamirh/MovieBox-Tui/releases/latest/download/MovieBox_Windows_x64.zip"-$IsUpdate = Test-Path $ExePath+Write-Info "Fetching latest version information..."+try {+ $Release = Invoke-RestMethod -Uri "https://api.github.com/repos/mesamirh/MovieBox-Tui/releases/latest" -UseBasicParsing+ $Version = $Release.tag_name+ if (-not $Version) { throw "Version not found in API response." }+} catch {+ Write-Err "Failed to fetch latest version from GitHub API. Please check your internet connection."+}-if ($IsUpdate) {- Write-Host ">> Updating MovieBox-Tui to the latest version..." -ForegroundColor Yellow+$IsUpdate = $false+if (Test-Path $ExePath) {+ try {+ $CurrentVersionOutput = & $ExePath --version 2>&1+ $CurrentVersion = ($CurrentVersionOutput -split ' ')[1]++ if ("v$CurrentVersion" -eq $Version) {+ Write-Success "You already have the latest version ($Version) installed."+ exit 0+ }+ Write-Info "Updating MovieBox-TUI from v$CurrentVersion to $Version..."+ $IsUpdate = $true++ # Ensure it's not running+ $RunningProcesses = Get-Process -Name "moviebox-tui" -ErrorAction SilentlyContinue+ if ($RunningProcesses) {+ Write-Info "Stopping running instances of MovieBox-Tui..."+ $RunningProcesses | Stop-Process -Force+ Start-Sleep -Seconds 1+ }+ } catch {+ Write-Info "Updating MovieBox-TUI to $Version..."+ $IsUpdate = $true+ }} else {- Write-Host ">> Installing MovieBox-Tui..." -ForegroundColor Blue+ Write-Info "Installing MovieBox-TUI $Version..."}-Write-Host ">> Downloading latest release..." -ForegroundColor Blue-Invoke-WebRequest -Uri $Url -OutFile $ZipFile -UseBasicParsing+$Url = "https://github.com/mesamirh/MovieBox-Tui/releases/download/$Version/MovieBox_Windows_x64.zip"-if (!(Test-Path $InstallDir)) {+Write-Info "Downloading release archive..."+try {+ Invoke-WebRequest -Uri $Url -OutFile $ZipFile -UseBasicParsing+} catch {+ Write-Err "Download failed. Please check your internet connection."+}++if (-not (Test-Path $InstallDir)) {New-Item -ItemType Directory -Force -Path $InstallDir | Out-Null}-Write-Host ">> Extracting files..." -ForegroundColor Blue-Expand-Archive -Path $ZipFile -DestinationPath $InstallDir -Force+Write-Info "Extracting files..."+try {+ Expand-Archive -Path $ZipFile -DestinationPath $InstallDir -Force+} catch {+ Write-Err "Failed to extract archive."+}if ($IsUpdate) {Remove-Item $ExePath -Force -ErrorAction SilentlyContinue}-Rename-Item -Path "$InstallDir\MovieBox.exe" -NewName "moviebox-tui.exe" -Force -ErrorAction SilentlyContinueRemove-Item $ZipFile -Force$UserPath = [Environment]::GetEnvironmentVariable("PATH", "User")if ($UserPath -notmatch [regex]::Escape($InstallDir)) {- Write-Host ">> Adding to PATH..." -ForegroundColor Blue+ Write-Info "Adding $InstallDir to PATH..."$NewPath = "$UserPath;$InstallDir"[Environment]::SetEnvironmentVariable("PATH", $NewPath, "User")- Write-Host "Warning: Please restart your PowerShell window for the PATH changes to take effect." -ForegroundColor Yellow+ Write-Warn "Please restart your PowerShell window for the PATH changes to take effect."}if ($IsUpdate) {- Write-Host "Success! MovieBox-Tui has been updated. Run 'moviebox-tui' to start." -ForegroundColor Green+ Write-Success "Update complete! Run 'moviebox-tui' to start."} else {- Write-Host "Success! MovieBox-Tui is installed. Run 'moviebox-tui' to start." -ForegroundColor Green+ Write-Success "Installation complete! Run 'moviebox-tui' to start."}diff --git a/install.sh b/install.shindex 58422c2..fb78d3c 100644--- a/install.sh+++ b/install.sh@@ -1,22 +1,40 @@#!/bin/bashset -e-RED='\033[0;31m'-GREEN='\033[0;32m'-BLUE='\033[0;34m'-YELLOW='\033[1;33m'-NC='\033[0m'+# Logging Helpers+log_info() { echo -e "\033[0;34m$1\033[0m"; }+log_success() { echo -e "\033[0;32m$1\033[0m"; }+log_warn() { echo -e "\033[1;33mWARNING: $1\033[0m"; }+log_err() { echo -e "\033[0;31mERROR: $1\033[0m"; exit 1; }INSTALL_DIR="/usr/local/bin"BIN_NAME="moviebox-tui"APP_PATH="$INSTALL_DIR/$BIN_NAME"-if command -v "$BIN_NAME" &> /dev/null; then- echo -e "${YELLOW}>> Updating MovieBox-Tui to the latest version...${NC}"+# Dependency Checks+command -v curl >/dev/null 2>&1 || log_err "curl is required but not installed. Please install it."+command -v tar >/dev/null 2>&1 || log_err "tar is required but not installed. Please install it."++# Version Detection+log_info "Fetching latest version information..."+LATEST_RELEASE=$(curl -s "https://api.github.com/repos/mesamirh/MovieBox-Tui/releases/latest")+VERSION=$(echo "$LATEST_RELEASE" | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/')+[ -z "$VERSION" ] && log_err "Failed to fetch latest version from GitHub API."++if command -v "$BIN_NAME" > /dev/null 2>&1; then+ CURRENT_VERSION=$($BIN_NAME --version 2>/dev/null | awk '{print $2}' || echo "unknown")+ if [ "v$CURRENT_VERSION" = "$VERSION" ]; then+ log_success "You already have the latest version ($VERSION) installed."+ exit 0+ fi+ log_info "Updating MovieBox-TUI from v$CURRENT_VERSION to $VERSION..."+ IS_UPDATE=1else- echo -e "${BLUE}>> Installing MovieBox-Tui...${NC}"+ log_info "Installing MovieBox-TUI $VERSION..."+ IS_UPDATE=0fi+# OS/Architecture DetectionOS="$(uname -s)"ARCH="$(uname -m)"@@ -28,44 +46,45 @@ elif [ "$OS" = "Linux" ]; thenelif [ "$ARCH" = "aarch64" ] || [ "$ARCH" = "arm64" ]; thenFILE="MovieBox_Linux_arm64.tar.gz"else- echo -e "${RED}Error: Unsupported Linux architecture ($ARCH). Only x86_64 and arm64 are supported.${NC}"- exit 1+ log_err "Unsupported Linux architecture ($ARCH). Only x86_64 and arm64 are supported."fielse- echo -e "${RED}Error: Unsupported OS ($OS).${NC}"- exit 1+ log_err "Unsupported OS ($OS)."fi-URL="https://github.com/mesamirh/MovieBox-Tui/releases/latest/download/$FILE"+URL="https://github.com/mesamirh/MovieBox-Tui/releases/download/$VERSION/$FILE"TMP_DIR=$(mktemp -d)+trap 'rm -rf "$TMP_DIR"' EXIT-echo -e "${BLUE}>> Downloading latest release...${NC}"+log_info "Downloading $FILE..."if ! curl -fsSL --progress-bar "$URL" -o "$TMP_DIR/$FILE"; then- echo -e "${RED}Error: Failed to download release.${NC}"- rm -rf "$TMP_DIR"- exit 1+ log_err "Download failed. Please check your internet connection."fi-echo -e "${BLUE}>> Extracting...${NC}"+log_info "Extracting files..."tar -xzf "$TMP_DIR/$FILE" -C "$TMP_DIR"-echo -e "${BLUE}>> Moving binary to $INSTALL_DIR...${NC}"-if [ -w "$INSTALL_DIR" ]; then- mv "$TMP_DIR/moviebox" "$APP_PATH"-else- sudo mv "$TMP_DIR/moviebox" "$APP_PATH"+if [ ! -f "$TMP_DIR/$BIN_NAME" ]; then+ log_err "Binary not found in archive. This is an unexpected packaging error."fi-if [ -w "$APP_PATH" ]; then+log_info "Moving binary to $INSTALL_DIR..."+if [ -w "$INSTALL_DIR" ]; then+ mv "$TMP_DIR/$BIN_NAME" "$APP_PATH"chmod +x "$APP_PATH"else+ log_info "Requires sudo privileges to write to $INSTALL_DIR..."+ sudo mv "$TMP_DIR/$BIN_NAME" "$APP_PATH"sudo chmod +x "$APP_PATH"fi-rm -rf "$TMP_DIR"+# PATH check+if ! echo "$PATH" | tr ':' '\n' | grep -q "^$INSTALL_DIR$"; then+ log_warn "$INSTALL_DIR is not in your PATH. You may need to add it to run $BIN_NAME easily."+fi-if command -v "$BIN_NAME" &> /dev/null; then- echo -e "${GREEN}Success! MovieBox-Tui has been updated. Run 'moviebox-tui' to start.${NC}"+if [ "$IS_UPDATE" -eq 1 ]; then+ log_success "Update complete! Run '$BIN_NAME' to start."else- echo -e "${GREEN}Success! MovieBox-Tui is installed. Run 'moviebox-tui' to start.${NC}"+ log_success "Installation complete! Run '$BIN_NAME' to start."fidiff --git a/scripts/release.sh b/scripts/release.shindex 3b35275..a665988 100755--- a/scripts/release.sh+++ b/scripts/release.sh@@ -13,16 +13,16 @@ cargo build --target x86_64-apple-darwin --releaselipo -create \target/aarch64-apple-darwin/release/moviebox-tui \target/x86_64-apple-darwin/release/moviebox-tui \- -output .tmp_build/moviebox-tar -czf dist/MovieBox_macOS_Universal.tar.gz -C .tmp_build moviebox-rm .tmp_build/moviebox+ -output .tmp_build/moviebox-tui+tar -czf dist/MovieBox_macOS_Universal.tar.gz -C .tmp_build moviebox-tui+rm .tmp_build/moviebox-tuiecho "macOS Universal build complete!"echo "Building Windows Executable..."cargo build --target x86_64-pc-windows-gnu --release-cp target/x86_64-pc-windows-gnu/release/moviebox-tui.exe .tmp_build/MovieBox.exe-cd .tmp_build && zip -q ../dist/MovieBox_Windows_x64.zip MovieBox.exe && cd ..-rm .tmp_build/MovieBox.exe+cp target/x86_64-pc-windows-gnu/release/moviebox-tui.exe .tmp_build/moviebox-tui.exe+cd .tmp_build && zip -q ../dist/MovieBox_Windows_x64.zip moviebox-tui.exe && cd ..+rm .tmp_build/moviebox-tui.exeecho "Windows build complete!"echo "Building Linux Binary (via Docker)..."@@ -30,14 +30,14 @@ if ! docker info > /dev/null 2>&1; thenecho "Warning: Docker is not running! Please open the Docker app on your Mac and run this script again to build the Linux version."elseCROSS_CONTAINER_OPTS="--platform linux/amd64" cross build --target x86_64-unknown-linux-musl --release- cp target/x86_64-unknown-linux-musl/release/moviebox-tui .tmp_build/moviebox- tar -czf dist/MovieBox_Linux_x64.tar.gz -C .tmp_build moviebox+ cp target/x86_64-unknown-linux-musl/release/moviebox-tui .tmp_build/moviebox-tui+ tar -czf dist/MovieBox_Linux_x64.tar.gz -C .tmp_build moviebox-tuiecho "Building Linux ARM64 Binary (via Docker)..."cargo cleanCROSS_CONTAINER_OPTS="--platform linux/amd64" cross build --target aarch64-unknown-linux-musl --release- cp target/aarch64-unknown-linux-musl/release/moviebox-tui .tmp_build/moviebox- tar -czf dist/MovieBox_Linux_arm64.tar.gz -C .tmp_build moviebox+ cp target/aarch64-unknown-linux-musl/release/moviebox-tui .tmp_build/moviebox-tui+ tar -czf dist/MovieBox_Linux_arm64.tar.gz -C .tmp_build moviebox-tuiecho "Linux builds complete!"fidiff --git a/src/tui/app.rs b/src/tui/app.rsindex 1714eac..c8dc49a 100644--- a/src/tui/app.rs+++ b/src/tui/app.rs@@ -3073,6 +3073,10 @@ impl App {}}});+ } else {+ self.action_sender+ .send(Action::StartDownload(subtitle_url, None))+ .ok();}} else {self.action_sender@@ -3096,14 +3100,7 @@ impl App {Action::ConfirmDownloadEpisode => {self.state.show_episode_download_confirm = false;- let subject_id = self- .state- .selected_details- .as_ref()- .and_then(|d| d.get("id"))- .and_then(|i| i.as_str())- .unwrap_or("")- .to_string();+ let subject_id = self.state.active_subject_id.clone().unwrap_or_default();let resource_id = self.get_selected_resource_id();if let Some(rid) = resource_id {@@ -3177,19 +3174,7 @@ impl App {format!("S{season:02}E{episode:02} · {num}/{total}"),);- let subject_id = self- .state- .selected_details- .as_ref()- .and_then(|d| d.get("id").or_else(|| d.get("idStr")))- .and_then(|v| {- if let Some(s) = v.as_str() {- Some(s.to_string())- } else {- v.as_i64().map(|n| n.to_string())- }- })- .unwrap_or_default();+ let subject_id = self.state.active_subject_id.clone().unwrap_or_default();self.action_sender.send(Action::FetchEpisodeStreams {@@ -3916,14 +3901,7 @@ impl App {let is_season_queue = self.state.download_queue_total > 0;if is_season_queue {- let subject_id = self- .state- .selected_details- .as_ref()- .and_then(|d| d.get("id"))- .and_then(|i| i.as_str())- .unwrap_or("")- .to_string();+ let subject_id = self.state.active_subject_id.clone().unwrap_or_default();if let Some(rid) = self.get_selected_resource_id() {let client = self.client.clone();let sender = self.action_sender.clone();