Compare commits

..

9 Commits

Author SHA1 Message Date
Benedict Xavier
343fe977ad Merge pull request #179 from viu-media/copilot/improve-installation-section 2026-01-01 10:50:20 +03:00
Benedict Xavier
4caafda123 Merge branch 'master' into copilot/improve-installation-section 2026-01-01 10:49:48 +03:00
Benexl
9ef834c94c fix: update shell_safe function to improve string literal escaping 2026-01-01 10:43:30 +03:00
copilot-swe-agent[bot]
5e9255b3d5 docs: Restructure binary installation to reduce redundancy
Co-authored-by: Benexl <81157281+Benexl@users.noreply.github.com>
2026-01-01 07:31:33 +00:00
copilot-swe-agent[bot]
fd535ad3e3 docs: Fix link consistency and chmod order in binary installation
Co-authored-by: Benexl <81157281+Benexl@users.noreply.github.com>
2026-01-01 07:30:45 +00:00
copilot-swe-agent[bot]
121e02a7e2 docs: Clarify binary installation with exact filenames and Windows steps
Co-authored-by: Benexl <81157281+Benexl@users.noreply.github.com>
2026-01-01 07:29:46 +00:00
copilot-swe-agent[bot]
2bb62fd0af docs: Make binary installation instructions more specific
Co-authored-by: Benexl <81157281+Benexl@users.noreply.github.com>
2026-01-01 07:28:46 +00:00
copilot-swe-agent[bot]
a752a9efdd docs: Add pre-built binaries section to README installation
Co-authored-by: Benexl <81157281+Benexl@users.noreply.github.com>
2026-01-01 07:27:24 +00:00
copilot-swe-agent[bot]
ac490d9a4b Initial plan 2026-01-01 07:25:17 +00:00
2 changed files with 41 additions and 8 deletions

View File

@@ -49,7 +49,7 @@
## Installation ## Installation
Viu runs on any platform with Python 3.10+, including Windows, macOS, Linux, and Android (via Termux, see other installation methods). Viu runs on Windows, macOS, Linux, and Android (via Termux). Pre-built binaries are available for quick installation without Python, or you can install via Python 3.10+ package managers.
### Prerequisites ### Prerequisites
@@ -64,6 +64,39 @@ For the best experience, please install these external tools:
* [**ffmpeg**](https://www.ffmpeg.org/) - Required for downloading HLS streams and merging subtitles. * [**ffmpeg**](https://www.ffmpeg.org/) - Required for downloading HLS streams and merging subtitles.
* [**webtorrent-cli**](https://github.com/webtorrent/webtorrent-cli) - For streaming torrents directly. * [**webtorrent-cli**](https://github.com/webtorrent/webtorrent-cli) - For streaming torrents directly.
### Pre-built Binaries (Recommended for Quick Start)
The easiest way to get started is to download a pre-built, self-contained binary from the [**releases page**](https://github.com/viu-media/viu/releases/latest). These binaries include all dependencies and **do not require Python** to be installed.
**Available for:**
* **Linux** (x86_64): `viu-linux-x86_64`
* **Windows** (x86_64): `viu-windows-x86_64.exe`
* **macOS** (Intel x86_64): `viu-macos-x86_64`
* **macOS** (Apple Silicon ARM64): `viu-macos-arm64`
**Installation Steps:**
1. Download the appropriate binary for your platform from the [**releases page**](https://github.com/viu-media/viu/releases/latest).
2. **Linux/macOS:** Make it executable:
```bash
# Replace with the actual binary name you downloaded
chmod +x viu-linux-x86_64
```
Then move it to a directory in your PATH:
```bash
# Option 1: System-wide installation (requires sudo)
sudo mv viu-linux-x86_64 /usr/local/bin/viu
# Option 2: User directory installation
mkdir -p ~/.local/bin
mv viu-linux-x86_64 ~/.local/bin/viu
# Make sure ~/.local/bin is in your PATH
```
**Windows:** Simply rename `viu-windows-x86_64.exe` to `viu.exe` and place it in a directory in your PATH, or run it directly.
3. Verify the installation:
```bash
viu --version
```
### Recommended Installation (uv) ### Recommended Installation (uv)
The best way to install Viu is with [**uv**](https://github.com/astral-sh/uv), a lightning-fast Python package manager. The best way to install Viu is with [**uv**](https://github.com/astral-sh/uv), a lightning-fast Python package manager.

View File

@@ -186,19 +186,19 @@ def shell_safe(text: Optional[str]) -> str:
""" """
Escapes a string for safe inclusion in a Python script string literal. Escapes a string for safe inclusion in a Python script string literal.
This is used when generating Python cache scripts with embedded text content. This is used when generating Python cache scripts with embedded text content.
For Python triple-quoted strings, we need to: For Python string literals, we need to:
- Escape backslashes first (so existing backslashes don't interfere) - Escape backslashes first (so existing backslashes don't interfere)
- Escape triple quotes (to not break the string literal) - Escape double quotes (to not break double-quoted string literals)
- Remove or replace problematic characters - Escape single quotes (to not break single-quoted string literals)
""" """
if not text: if not text:
return "" return ""
# Escape backslashes first # Escape backslashes first
result = text.replace("\\", "\\\\") result = text.replace("\\", "\\\\")
# Escape triple quotes (both types) for Python triple-quoted string literals # Escape both quote types for safe inclusion in any string literal
result = result.replace('"""', r'\"\"\"') result = result.replace('"', r"\"")
result = result.replace("'''", r"\'\'\'") result = result.replace("'", r"\'")
return result return result