95 lines
2.5 KiB
Markdown
95 lines
2.5 KiB
Markdown
# MediaHive
|
|
|
|
Media scanning, indexing, and Netflix-style web streaming for your torrent collection.
|
|
|
|
## Project Structure
|
|
|
|
```
|
|
hivescan/ Indexing & previews (library + CLI)
|
|
indexer.py Media index generation
|
|
scanning.py File system scanning
|
|
parsing.py Torrent name parsing (PTN)
|
|
models.py Data models
|
|
images.py TMDb cover/backdrop downloading
|
|
showreel.py Video preview clip generation (ffmpeg)
|
|
tmdb_client.py TMDb API client with caching
|
|
utils.py Path, size, and timestamp helpers
|
|
mediahive/ FastAPI web server + Vue frontend
|
|
server.py FastAPI app (API + media serving)
|
|
__main__.py CLI entry point
|
|
frontend/ Vue 3 frontend source
|
|
src/
|
|
components/ Vue components (Netflix-style UI)
|
|
styles/ CSS styles
|
|
api.ts API calls to FastAPI backend
|
|
types.ts TypeScript interfaces
|
|
scripts/
|
|
devserver.py Development server (Vite + FastAPI)
|
|
rtorrent-manager.py Torrent scanning & rtorrent management
|
|
fastapi-vue/ Build utilities for frontend
|
|
rtorrent_client.py RTorrent XMLRPC/SCGI client
|
|
```
|
|
|
|
## Quick Start
|
|
|
|
```bash
|
|
pip install -e .
|
|
```
|
|
|
|
### 1. Scan & Index Media
|
|
|
|
```bash
|
|
# Scan downloads, auto-detect common root, create .mediahive folder
|
|
hivescan /media/torrents/*
|
|
|
|
# Scan multiple locations
|
|
hivescan /mnt/disk1/* /mnt/disk2/*
|
|
|
|
# Override output directory
|
|
hivescan /media/torrents/* -o /srv/media/.mediahive
|
|
|
|
# Skip cover/showreel generation
|
|
hivescan /media/torrents/* --no-covers --no-showreels
|
|
```
|
|
|
|
### 2. Serve & Browse
|
|
|
|
```bash
|
|
# Start the web server
|
|
mediahive /path/to/your/media/folder
|
|
|
|
# Server starts at http://localhost:8420
|
|
```
|
|
|
|
The app expects `<media-folder>/.mediahive/index.json` generated by hivescan.
|
|
|
|
### 3. Development
|
|
|
|
```bash
|
|
cd frontend && npm install && cd ..
|
|
python scripts/devserver.py
|
|
```
|
|
|
|
Starts Vite dev server + FastAPI backend with auto-reload.
|
|
|
|
## API Endpoints
|
|
|
|
- `GET /api/index` — Load media index
|
|
- `POST /api/play` — Open media file with system player
|
|
- `POST /api/open-folder` — Open folder in file explorer
|
|
- `GET /api/media/{path}` — Serve media files (images, video)
|
|
|
|
## RTorrent Manager
|
|
|
|
```bash
|
|
python scripts/rtorrent-manager.py /media/torrents*/.torrents/
|
|
```
|
|
|
|
Scans `.torrent` files, verifies downloads exist, loads into rtorrent.
|
|
|
|
## Requirements
|
|
|
|
- Python ≥ 3.14
|
|
- Node.js 18+ (frontend development)
|
|
- ffmpeg (showreel generation)
|