Metadata-Version: 2.4
Name: py-media-server
Version: 0.1.0
Summary: A simple media server for streaming video files
Home-page: https://github.com/pandiyarajk/py-media-server
Author: Pandiyaraj Karuppasamy
Author-email: Pandiyaraj Karuppasamy <pandiyarajk@live.com>
License: MIT
Project-URL: Homepage, https://github.com/pandiyarajk/py-media-server
Project-URL: Bug Reports, https://github.com/pandiyarajk/py-media-server/issues
Project-URL: Source, https://github.com/pandiyarajk/py-media-server
Keywords: media,server,streaming,video,http
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: End Users/Desktop
Classifier: Topic :: Multimedia :: Video
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Operating System :: OS Independent
Requires-Python: >=3.7
Description-Content-Type: text/markdown
License-File: LICENSE
Dynamic: author
Dynamic: home-page
Dynamic: license-file
Dynamic: requires-python

# py-media-server

A simple, lightweight media server for streaming video files over HTTP with a modern web interface.

## Features

- 🎬 Stream video files (MP4, MKV, AVI, MOV) from any directory
- 🖼️ Automatic thumbnail generation using FFmpeg
- 📱 Responsive web interface that works on mobile and desktop
- ⚡ Range request support for efficient video streaming
- 🔒 Threaded TCP server for concurrent connections
- 🎨 Modern, dark-themed UI

## Installation

### From PyPI (when published)

```bash
pip install py-media-server
```

### From source

```bash
git clone https://github.com/pandiyarajk/py-media-server.git
cd py-media-server
pip install -e .
```

## Requirements

- Python 3.7+
- FFmpeg (optional, for thumbnail generation)

To install FFmpeg:
- **Windows**: Download from [ffmpeg.org](https://ffmpeg.org/download.html) or use `choco install ffmpeg`
- **macOS**: `brew install ffmpeg`
- **Linux**: `sudo apt-get install ffmpeg` or `sudo yum install ffmpeg`

## Usage

### Basic usage

Serve media files from the current directory:

```bash
py-media-server
```

Or specify a directory:

```bash
py-media-server /path/to/your/movies
```

### Custom port

```bash
py-media-server /path/to/your/movies --port 9000
```

### Custom host and port

```bash
py-media-server ~/Videos --host 192.168.1.100 --port 8080
```

### Help

```bash
py-media-server --help
```

## Command-line Options

```
positional arguments:
  directory             Directory containing media files to serve (default: current directory)

optional arguments:
  -h, --help            show this help message and exit
  -p PORT, --port PORT  Port to run the server on (default: 8000)
  --host HOST           Host to bind the server to (default: 0.0.0.0)
  -v, --version         show program's version number and exit
```

## How it Works

1. **Start the server**: Point it to a directory containing video files
2. **Open your browser**: Navigate to `http://localhost:8000`
3. **Browse and play**: Click on any video thumbnail to start streaming

The server will:
- Scan the directory for supported video formats
- Generate thumbnails automatically (stored in `.thumbs` subdirectory)
- Serve videos with range request support for smooth playback
- Handle concurrent connections efficiently

## Development

### Setup development environment

```bash
git clone https://github.com/pandiyarajk/py-media-server.git
cd py-media-server
pip install -e ".[dev]"
```

### Run tests

```bash
pytest
```

### Run tests with coverage

```bash
pytest --cov=py_media_server --cov-report=html
```

## Project Structure

```
py-media-server/
├── py_media_server/
│   ├── __init__.py
│   └── server.py
├── tests/
│   ├── __init__.py
│   └── test_server.py
├── setup.py
├── pyproject.toml
├── README.md
├── LICENSE
└── MANIFEST.in
```

## Security Notice

⚠️ **Warning**: This server is intended for local network use only. It does not include authentication or encryption. Do not expose it to the public internet without proper security measures.

## License

MIT License - see LICENSE file for details

## Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

## Changelog

### 0.1.0 (2026-04-19)
- Initial release
- Basic video streaming functionality
- Thumbnail generation
- Web interface
- Command-line interface
