A .NET Core API that provides a PlayaVR-compatible interface for StashApp, enabling VR video streaming and management.
- PlayaVR Compatibility: Full API compatibility with PlayaVR client applications
- Video Streaming: High-performance video streaming with range request support
- Authentication: JWT-based authentication with session support
- Image Processing: Automatic image resizing and SVG conversion for compatibility
- Docker Support: Ready-to-deploy Docker containerization
- Guest Access: Support for both authenticated and guest users
- Background Sync: Efficient data synchronization with StashApp
- .NET 8.0 SDK
- Docker (optional)
- StashApp instance running and accessible
- Clone the repository:
git clone https://github.com/yourusername/stashplayavr-api.git
cd stashplayavr-api- Copy the example configuration:
cp src/appsettings.example.json src/appsettings.json- Edit
src/appsettings.jsonwith your StashApp details:
{
"StashApp": {
"Url": "http://your-stashapp-host:9999",
"GraphQLUrl": "http://your-stashapp-host:9999/graphql",
"ApiKey": "your-stash-api-key"
},
"JWT": {
"Secret": "your-jwt-secret-key"
},
"Users": {
"your-username": "your-password"
}
}- Build and run with Docker:
docker build -t stashplayavr-api .
docker run -p 8890:8890 -v $(pwd)/src/appsettings.json:/app/appsettings.json stashplayavr-api- Clone the repository:
git clone https://github.com/yourusername/stashplayavr-api.git
cd stashplayavr-api- Copy the example configuration:
cp src/appsettings.example.json src/appsettings.json-
Edit
src/appsettings.jsonwith your configuration -
Restore dependencies and run:
dotnet restore src
dotnet run --project srcYou can override configuration using environment variables:
export StashApp__Url="http://your-stashapp:9999"
export StashApp__ApiKey="your-api-key"
export JWT__Secret="your-jwt-secret"
export App__Port="8890"Generate a secure JWT secret:
# Using OpenSSL
openssl rand -base64 64
# Using PowerShell
[System.Web.Security.Membership]::GeneratePassword(64, 0)
# Using Node.js
node -e "console.log(require('crypto').randomBytes(64).toString('base64'))"POST /api/playa/v2/auth/signin- User authenticationPOST /api/playa/v2/auth/refresh- Token refresh
GET /api/playa/v2/videos- List videos with paginationGET /api/playa/v2/video/{id}- Get video detailsGET /api/playa/v2/video/{id}/stream- Stream video contentGET /api/playa/v2/video/{id}/poster- Get video posterGET /api/playa/v2/video/{id}/preview- Get video preview
GET /api/playa/v2/categories- List categories/tagsGET /api/playa/v2/actors- List actors/performersGET /api/playa/v2/studios- List studios
GET /api/playa/v2/version- API versionGET /api/playa/v2/configuration- Client configurationGET /api/playa/v2/health- Health check
The API supports multiple authentication methods:
- JWT Bearer Token: Standard Authorization header
- Cookie Authentication: Session-based cookies
- Query Parameter:
?auth_token=...for direct URLs - Guest Access: Limited access without authentication
Some endpoints support guest access with limited functionality:
- Categories return a dummy "Free" category
- Videos return empty results
- Posters and sprites work without authentication
Create a docker-compose.yml:
version: '3.8'
services:
stashplayavr-api:
image: yourusername/stashplayavr-api:latest
ports:
- "8890:8890"
environment:
- StashApp__Url=http://your-stashapp:9999
- StashApp__ApiKey=your-api-key
- JWT__Secret=your-jwt-secret
restart: unless-stoppedThe Docker image includes health checks:
docker run --health-cmd="curl -f http://localhost:8890/api/playa/v2/health || exit 1" yourimageIssue: Categories may not appear for logged-in users on PlayaVR Steam client.
Workaround: After logging in, restart the PlayaVR application to see all categories.
Technical Details: The PlayaVR Steam client has inconsistent authentication behavior - it only requests categories once during initial startup (when not logged in) and doesn't re-request them after login. The API includes special handling to detect PlayaVR clients and return appropriate category data based on authentication status.
src/
├── Controllers/ # API controllers
├── Services/ # Business logic services
├── Repositories/ # Data access layer
├── Filters/ # Action filters (auth, exception handling)
├── Models/ # Data models
└── Program.cs # Application entry point
# Build the project
dotnet build src
# Run tests
dotnet test
# Publish for production
dotnet publish src -c Release -o ./publish- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- StashApp - The amazing media management system
- PlayaVR - VR video player client
- .NET Core community for excellent tooling and documentation
If you encounter any issues or have questions:
- Check the Issues page
- Create a new issue with detailed information
- Include logs and configuration (remove sensitive data)
- Initial release
- Full PlayaVR API compatibility
- JWT authentication support
- Docker containerization
- Image processing and SVG conversion
- Guest access support