Skip to main content

Webfrontend to cast local videos to your chromecast

Project description

Webfilecast

A simple, modern web frontend for Terminalcast to cast local video files to your Chromecast.

New Webfilecast UI

Features

  • Modern, responsive UI: A clean, dark interface that works on desktop and mobile.
  • Searchable File List: Instantly find the file you're looking for, even in large collections. The search supports fuzzy matching and exact phrases in quotes (e.g., SomeSeries "Episode 7").
  • Natural Sorting: Files are sorted logically, so "Episode 2" comes before "Episode 10".
  • Clear Controls: Icon-based buttons for starting the server, playing on Chromecast, opening in browser, and stopping the server.
  • Dynamic UI: Buttons are enabled/disabled based on the application state to guide the user.
  • Real-time Feedback: See the connection status, server status, and file scan progress at a glance.

Requirements

  • Python 3.10+
  • Redis Server (running on localhost)

Installation

You can install Webfilecast directly from PyPI:

pip install webfilecast

For a production deployment, it is recommended to install the deployment dependencies as well:

pip install "webfilecast[deployment]"

Usage

  1. Set Environment Variables: The application is configured via environment variables.

    • MOVIE_DIRECTORY: (Required) The absolute path to the directory where your video files are stored.
    • CORS_ORIGINS: (Required) A semicolon-separated list of allowed origins for the web frontend (e.g., http://localhost:8000;http://127.0.0.1:8000).
    • TERMINALCAST_KNOWN_HOSTS: (Optional) A comma-separated list of known Chromecast IP addresses to speed up discovery.
  2. Run the application:

    For Development: A simple development server can be started using the flask command. To enable automatic reloading on code changes, use the --debug flag.

    # Example
    export MOVIE_DIRECTORY="/path/to/your/videos"
    export CORS_ORIGINS="http://127.0.0.1:5000"
    
    flask --app webfilecast --debug run
    

    For Production (Recommended): For the best performance and to ensure all real-time features work correctly, it is highly recommended to use a production-ready WSGI server like gunicorn with eventlet.

    # Example
    export MOVIE_DIRECTORY="/path/to/your/videos"
    export CORS_ORIGINS="http://your-domain.com"
    
    gunicorn --worker-class eventlet -w 1 --bind 0.0.0.0:8000 "webfilecast:app"
    

    Then open your browser and navigate to the specified host and port.

Advanced Configuration (Reverse Proxy)

If you are running Webfilecast behind a reverse proxy (like Nginx) and want to serve the video files through the same domain/port (to avoid mixed content issues or firewall restrictions), you can configure terminalcast to use a fixed port and a specific public URL.

  1. Set additional Environment Variables:

    • TERMINALCAST_PORT: The fixed port where the internal video server should listen (e.g., 8081).
    • TERMINALCAST_VIDEO_URL: The public URL that the Chromecast and browser should use to access the video (e.g., https://your-domain.com/video).
  2. Configure Nginx: Add a location block to your Nginx configuration to proxy the video traffic to the internal TERMINALCAST_PORT.

    server {
        listen 443 ssl;
        server_name your-domain.com;
        
        # ... ssl config ...
    
        # Main Webfilecast App
        location / {
            proxy_pass http://127.0.0.1:8000; # Gunicorn port
            proxy_set_header Host $host;
            proxy_set_header X-Real-IP $remote_addr;
            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
            proxy_set_header X-Forwarded-Proto $scheme;
            
            # WebSocket support
            proxy_http_version 1.1;
            proxy_set_header Upgrade $http_upgrade;
            proxy_set_header Connection "upgrade";
        }
    
        # Video Streaming
        location /video {
            proxy_pass http://127.0.0.1:8081/video; # TERMINALCAST_PORT
            proxy_set_header Host $host;
            proxy_buffering off; # Important for streaming
        }
    }
    

How it works

The application scans the MOVIE_DIRECTORY for video files and caches their metadata in Redis. The web frontend communicates with the Python backend via Socket.IO to select a file, choose an audio stream, and control the casting process. When a video is to be played, a temporary web server is started via terminalcast to stream the file to the Chromecast.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

webfilecast-1.1.4.tar.gz (7.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

webfilecast-1.1.4-py3-none-any.whl (8.1 kB view details)

Uploaded Python 3

File details

Details for the file webfilecast-1.1.4.tar.gz.

File metadata

  • Download URL: webfilecast-1.1.4.tar.gz
  • Upload date:
  • Size: 7.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for webfilecast-1.1.4.tar.gz
Algorithm Hash digest
SHA256 5fadc72f62291d69ed8d679af1a40fe3b0d4f2fa109ef33de3b963000042aacb
MD5 de67dac763c828bca4ad5ff17e43ef37
BLAKE2b-256 cc045904ffe726bfb58031c23e0e34d1e4aabf462fed8f2cb474a18b33868501

See more details on using hashes here.

Provenance

The following attestation bundles were made for webfilecast-1.1.4.tar.gz:

Publisher: python-publish.yml on vanadinit/webfilecast

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file webfilecast-1.1.4-py3-none-any.whl.

File metadata

  • Download URL: webfilecast-1.1.4-py3-none-any.whl
  • Upload date:
  • Size: 8.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for webfilecast-1.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 e04f2f09e0ee56aa2deb9e22008989005a56d59f805f08bcd89163e2e411ad1d
MD5 56d9cd9cfab00e9464caf62f90300f33
BLAKE2b-256 31405d366b0a2711f633ce7b9b6b2900df954b2070c5245b92a0bf5cefe4fd04

See more details on using hashes here.

Provenance

The following attestation bundles were made for webfilecast-1.1.4-py3-none-any.whl:

Publisher: python-publish.yml on vanadinit/webfilecast

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page