MediaFlow Proxy is a powerful and flexible solution for proxifying various types of media streams. It supports HTTP(S) links, HLS (M3U8) streams, and MPEG-DASH streams, including DRM-protected content. This proxy can convert MPEG-DASH DRM-protected streams to decrypted HLS live streams in real-time, making it one of the fastest live decrypter servers available.
Features
Convert MPEG-DASH streams (DRM-protected and non-protected) to HLS
Support for Clear Key DRM-protected MPD DASH streams
Support for non-DRM protected DASH live and VOD streams
Proxy HTTP/HTTPS links with custom headers
Proxy and modify HLS (M3U8) streams in real-time with custom headers and key URL modifications for bypassing some sneaky restrictions.
Retrieve public IP address of the MediaFlow Proxy server for use with Debrid services
Support for HTTP/HTTPS/SOCKS5 proxy forwarding
Protect against unauthorized access and network bandwidth abuses
Support for play expired or self-signed SSL certificates server streams
Configuration
Set the following environment variables:
API_PASSWORD: Required. Protects against unauthorized access and API network abuses.
PROXY_URL: Optional. HTTP/HTTPS/SOCKS5 proxy URL for forwarding network requests.
MPD_LIVE_STREAM_DELAY: Optional. Delay in seconds for live DASH streams. This is useful to prevent buffering issues with live streams. Default is 30 seconds.
Installation
Option 1: Self-Hosted Deployment
Using Docker from Docker Hub
Pull & Run the Docker image:
docker run -p 8888:8888 -e API_PASSWORD=your_password mhdzumair/mediaflow-proxy
Using pip
![IMPORTANT]
Ensure that you have Python 3.10 or higher installed.
Install the package:
pip install mediaflow-proxy
Set the API_PASSWORD and other environment variables in .env:
echo "API_PASSWORD=your_password" > .env
Run the MediaFlow Proxy server:
mediaflow-proxy
Using git & poetry
![IMPORTANT]
Ensure that you have Python 3.10 or higher installed.
Clone the repository:
git clone https://github.com/mhdzumair/mediaflow-proxy.git
cd mediaflow-proxy
Install dependencies using Poetry:
poetry install
Set the API_PASSWORD environment variable in .env:
echo "API_PASSWORD=your_password" > .env
Run the FastAPI server:
poetry run uvicorn mediaflow_proxy.main:app --host 0.0.0.0 --port 8888
Using MediaFlow Proxy with Debrid Services and Stremio Addons
MediaFlow Proxy can be particularly useful when working with Debrid services (like Real-Debrid, AllDebrid) and Stremio addons. The /proxy/ip endpoint allows you to retrieve the public IP address of the MediaFlow Proxy server, which is crucial for routing Debrid streams correctly.
When a Stremio addon needs to create a video URL for a Debrid service, it typically needs to provide the user's public IP address. However, when routing the Debrid stream through MediaFlow Proxy, you should use the IP address of the MediaFlow Proxy server instead.
Here's how to utilize MediaFlow Proxy in this scenario:
If MediaFlow Proxy is accessible over the internet:
Use the /proxy/ip endpoint to get the MediaFlow Proxy server's public IP.
Use this IP when creating Debrid service URLs in your Stremio addon.
If MediaFlow Proxy is set up locally:
Stremio addons can directly use the client's IP address.
Future Development
Add support for Widevine and PlayReady decryption
Acknowledgements and Inspirations
MediaFlow Proxy was developed with inspiration from various projects and resources:
Stremio Server for HLS Proxify implementation, which inspired our HLS M3u8 Manifest parsing and redirection proxify support.
This project is for educational purposes only. The developers of MediaFlow Proxy are not responsible for any misuse of this software. Please ensure that you have the necessary permissions to access and use the media streams you are proxying.