Views
No views yet

API_PASSWORD: Optional. Protects against unauthorized access and API network abuses.ENABLE_STREAMING_PROGRESS: Optional. Enable streaming progress logging. Default is false.DISABLE_HOME_PAGE: Optional. Disables the home page UI. Returns 403 for the root path and direct access to index.html. Default is false.DISABLE_DOCS: Optional. Disables the API documentation (Swagger UI). Returns 403 for the /docs path. Default is false.DISABLE_SPEEDTEST: Optional. Disables the speedtest UI. Returns 403 for the /speedtest path and direct access to speedtest.html. Default is false.STREMIO_PROXY_URL: Optional. Stremio server URL for alternative content proxying. Example: http://127.0.0.1:11470.M3U8_CONTENT_ROUTING: Optional. Routing strategy for M3U8 content URLs: mediaflow (default), stremio, or direct.ENABLE_HLS_PREBUFFER: Optional. Enables HLS pre-buffering for improved streaming performance. Default: false. Enable this when you experience frequent buffering or want to improve playback smoothness for high-bitrate streams. Note that enabling pre-buffering increases memory usage and may not be suitable for low-memory environments.HLS_PREBUFFER_SEGMENTS: Optional. Number of HLS segments to pre-buffer ahead. Default: 5. Only effective when ENABLE_HLS_PREBUFFER is true.HLS_PREBUFFER_CACHE_SIZE: Optional. Maximum number of HLS segments to keep in memory cache. Default: 50. Only effective when ENABLE_HLS_PREBUFFER is true.HLS_PREBUFFER_MAX_MEMORY_PERCENT: Optional. Maximum percentage of system memory to use for HLS pre-buffer cache. Default: 80. Only effective when ENABLE_HLS_PREBUFFER is true.HLS_PREBUFFER_EMERGENCY_THRESHOLD: Optional. Emergency threshold (%) to trigger aggressive HLS cache cleanup. Default: 90. Only effective when ENABLE_HLS_PREBUFFER is true.ENABLE_DASH_PREBUFFER: Optional. Enables DASH pre-buffering for improved streaming performance. Default: false. Enable this when you experience frequent buffering or want to improve playback smoothness for high-bitrate streams. Note that enabling pre-buffering increases memory usage and may not be suitable for low-memory environments.DASH_PREBUFFER_SEGMENTS: Optional. Number of DASH segments to pre-buffer ahead. Default: 5. Only effective when ENABLE_DASH_PREBUFFER is true.DASH_PREBUFFER_CACHE_SIZE: Optional. Maximum number of DASH segments to keep in memory cache. Default: 50. Only effective when ENABLE_DASH_PREBUFFER is true.DASH_PREBUFFER_MAX_MEMORY_PERCENT: Optional. Maximum percentage of system memory to use for DASH pre-buffer cache. Default: 80. Only effective when ENABLE_DASH_PREBUFFER is true.DASH_PREBUFFER_EMERGENCY_THRESHOLD: Optional. Emergency threshold (%) to trigger aggressive DASH cache cleanup. Default: 90. Only effective when ENABLE_DASH_PREBUFFER is true.FORWARDED_ALLOW_IPS: Optional. Controls which IP addresses are trusted to provide forwarded headers (X-Forwarded-For, X-Forwarded-Proto, etc.) when MediaFlow Proxy is deployed behind reverse proxies or load balancers. Default: 127.0.0.1. See Forwarded Headers Configuration for detailed usage.1PROXY_URL=http://proxy:8080
2ALL_PROXY=true1PROXY_URL=http://proxy:8080
2TRANSPORT_ROUTES='{
3 "https://internal.company.com": {
4 "proxy": false
5 },
6 "all://streaming.service.com": {
7 "proxy_url": "socks5://streaming-proxy:1080",
8 "verify_ssl": false
9 }
10}'"all://example.com""all://*.example.com""https://example.com""all://*:1234""all://"proxy: Boolean to enable/disable proxy for this route (default: true)proxy_url: Optional specific proxy URL for this route (overrides primary proxy_url)verify_ssl: Boolean to control SSL verification (default: true)1PROXY_URL=http://main-proxy:8080
2TRANSPORT_ROUTES='{
3 "https://internal.domain.com": {
4 "proxy": false,
5 "verify_ssl": false
6 }
7}'1PROXY_URL=http://default-proxy:8080
2TRANSPORT_ROUTES='{
3 "all://*.streaming.com": {
4 "proxy": true,
5 "proxy_url": "socks5://streaming-proxy:1080"
6 },
7 "all://*.internal.com": {
8 "proxy": false
9 },
10 "https://api.service.com": {
11 "proxy": true,
12 "verify_ssl": false
13 }
14}'1PROXY_URL=http://main-proxy:8080
2ALL_PROXY=true
3TRANSPORT_ROUTES='{
4 "all://local.network": {
5 "proxy": false
6 },
7 "all://*.trusted-service.com": {
8 "proxy": false
9 }
10}'FORWARDED_ALLOW_IPS environment variable and --forwarded-allow-ips uvicorn parameter control which IP addresses are trusted to provide these headers.1# Trust only localhost (default - most secure)
2FORWARDED_ALLOW_IPS=127.0.0.1
3
4# Trust specific proxy IPs
5FORWARDED_ALLOW_IPS=10.0.0.1,192.168.1.100
6
7# Trust all IPs (use with caution)
8FORWARDED_ALLOW_IPS=*
9⚠️ Security warning
SettingFORWARDED_ALLOW_IPS=*disables IP-spoofing protection and must only be used in trusted LAN or dev environments.
In production, always list the concrete IPs of your reverse-proxy servers.
1# Trust only localhost (recommended for local development)
2uvicorn mediaflow_proxy.main:app --forwarded-allow-ips "127.0.0.1"
3
4# Trust specific proxy servers
5uvicorn mediaflow_proxy.main:app --forwarded-allow-ips "10.0.0.1,192.168.1.100"
6
7# Trust all IPs (development only - not recommended for production)
8uvicorn mediaflow_proxy.main:app --forwarded-allow-ips "*"1# Remove --forwarded-allow-ips parameter entirely or use localhost only
2uvicorn mediaflow_proxy.main:app --host 0.0.0.0 --port 88881# Trust the Nginx server IP
2FORWARDED_ALLOW_IPS=127.0.0.11# Trust Cloudflare IP ranges (example - check current Cloudflare IPs)
2FORWARDED_ALLOW_IPS=173.245.48.0,103.21.244.0,103.22.200.01# Trust the VPC subnet where ALB is deployed
2FORWARDED_ALLOW_IPS=10.0.0.01# Trust the Docker host
2FORWARDED_ALLOW_IPS=172.17.0.11# Trust the Docker network range (when nginx and mediaflow-proxy are in same docker network)
2FORWARDED_ALLOW_IPS=172.20.0.0
3# Or trust all Docker IPs (less secure but simpler for development)
4FORWARDED_ALLOW_IPS=*1# Trust the ingress controller pod network
2FORWARDED_ALLOW_IPS=10.244.0.0FORWARDED_ALLOW_IPSFORWARDED_ALLOW_IPS to only include your actual proxy serversFORWARDED_ALLOW_IPS=* or specify the Docker network (e.g., FORWARDED_ALLOW_IPS=172.20.0.0)FORWARDED_ALLOW_IPS to trust the Docker network IP range, otherwise proxy links will not work correctly1server {
2 listen 80;
3 server_name your-domain.com;
4
5 location / {
6 proxy_pass http://127.0.0.1:8888;
7 proxy_set_header Host $host;
8 proxy_set_header X-Real-IP $remote_addr;
9 proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
10 proxy_set_header X-Forwarded-Proto $scheme;
11 }
12}FORWARDED_ALLOW_IPS=127.0.0.11server {
2 listen 80;
3 server_name mediaflow.yourdomain.com;
4
5 # Redirect HTTP to HTTPS
6 return 301 https://$server_name$request_uri;
7}
8
9server {
10 listen 443 ssl http2;
11 server_name mediaflow.yourdomain.com;
12
13 # SSL Configuration
14 ssl_certificate /path/to/your/certificate.crt;
15 ssl_certificate_key /path/to/your/private.key;
16 ssl_protocols TLSv1.2 TLSv1.3;
17 ssl_ciphers ECDHE-RSA-AES256-GCM-SHA512:DHE-RSA-AES256-GCM-SHA512:ECDHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES256-GCM-SHA384;
18 ssl_prefer_server_ciphers off;
19
20 # Security Headers
21 add_header X-Frame-Options DENY;
22 add_header X-Content-Type-Options nosniff;
23 add_header X-XSS-Protection "1; mode=block";
24 add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always;
25
26 # Client settings for streaming
27 client_max_body_size 0;
28 client_body_timeout 60s;
29 client_header_timeout 60s;
30
31 location / {
32 # Proxy settings
33 proxy_pass http://127.0.0.1:8888;
34 proxy_http_version 1.1;
35 proxy_cache_bypass $http_upgrade;
36
37 # Headers for forwarded information
38 proxy_set_header Host $host;
39 proxy_set_header X-Real-IP $remote_addr;
40 proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
41 proxy_set_header X-Forwarded-Proto $scheme;
42 proxy_set_header X-Forwarded-Host $host;
43 proxy_set_header X-Forwarded-Port $server_port;
44
45 # Headers for streaming support
46 proxy_set_header Range $http_range;
47 proxy_set_header If-Range $http_if_range;
48 proxy_set_header Connection "";
49
50 # Timeout settings for streaming
51 proxy_connect_timeout 60s;
52 proxy_send_timeout 300s;
53 proxy_read_timeout 300s;
54
55 # Disable buffering for streaming
56 proxy_buffering off;
57 proxy_request_buffering off;
58 proxy_max_temp_file_size 0;
59
60 # Handle redirects
61 proxy_redirect off;
62 }
63
64 # Optional: Specific location for streaming endpoints with extended timeouts
65 location ~* ^/proxy/(stream|hls|mpd)/ {
66 proxy_pass http://127.0.0.1:8888;
67 proxy_http_version 1.1;
68
69 # Extended timeouts for large streams
70 proxy_connect_timeout 60s;
71 proxy_send_timeout 600s;
72 proxy_read_timeout 600s;
73
74 # Streaming optimizations
75 proxy_buffering off;
76 proxy_request_buffering off;
77 proxy_max_temp_file_size 0;
78
79 # Forward all necessary headers
80 proxy_set_header Host $host;
81 proxy_set_header X-Real-IP $remote_addr;
82 proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
83 proxy_set_header X-Forwarded-Proto $scheme;
84 proxy_set_header Range $http_range;
85 proxy_set_header If-Range $http_if_range;
86 proxy_set_header Connection "";
87 }
88
89 # Access and error logs
90 access_log /var/log/nginx/mediaflow_access.log;
91 error_log /var/log/nginx/mediaflow_error.log;
92}1# Trust Nginx server
2FORWARDED_ALLOW_IPS=127.0.0.1
3
4# Other recommended settings
5API_PASSWORD=your_secure_passwordmediaflow.yourdomain.comhttp127.0.0.1 (or MediaFlow Proxy container IP)88881# Headers for forwarded information
2proxy_set_header Host $host;
3proxy_set_header X-Real-IP $remote_addr;
4proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
5proxy_set_header X-Forwarded-Proto $scheme;
6proxy_set_header X-Forwarded-Host $host;
7proxy_set_header X-Forwarded-Port $server_port;
8
9# Headers for streaming support
10proxy_set_header Range $http_range;
11proxy_set_header If-Range $http_if_range;
12proxy_set_header Connection "";
13
14# Timeout settings for streaming
15proxy_connect_timeout 60s;
16proxy_send_timeout 300s;
17proxy_read_timeout 300s;
18
19# Disable buffering for streaming
20proxy_buffering off;
21proxy_request_buffering off;
22proxy_max_temp_file_size 0;
23
24# Client settings
25client_max_body_size 0;
26client_body_timeout 60s;
27client_header_timeout 60s;
28
29# Handle redirects
30proxy_redirect off;
31
32# HTTP version
33proxy_http_version 1.1;
34
35# Security headers
36add_header X-Frame-Options DENY always;
37add_header X-Content-Type-Options nosniff always;
38add_header X-XSS-Protection "1; mode=block" always;
39add_header Referrer-Policy "strict-origin-when-cross-origin" always;
40
41# Hide server information
42proxy_hide_header X-Powered-By;
43server_tokens off;FORWARDED_ALLOW_IPS=127.0.0.11# Use the Docker network range
2FORWARDED_ALLOW_IPS=172.18.0.0/161# Replace with actual Nginx Proxy Manager IP
2FORWARDED_ALLOW_IPS=10.0.0.51version: '3.8'
2
3services:
4 nginx-proxy-manager:
5 image: 'jc21/nginx-proxy-manager:latest'
6 restart: unless-stopped
7 ports:
8 - '80:80'
9 - '443:443'
10 - '81:81' # Admin interface
11 volumes:
12 - ./npm-data:/data
13 - ./npm-letsencrypt:/etc/letsencrypt
14 networks:
15 - proxy-network
16
17 mediaflow-proxy:
18 image: 'mhdzumair/mediaflow-proxy:latest'
19 restart: unless-stopped
20 ports:
21 - '8888:8888'
22 environment:
23 - API_PASSWORD=your_secure_password
24 - FORWARDED_ALLOW_IPS=172.18.0.0/16
25 networks:
26 - proxy-network
27
28networks:
29 proxy-network:
30 driver: bridge
31 ipam:
32 config:
33 - subnet: 172.18.0.0/16../, ..%2F)FORWARDED_ALLOW_IPS includes your proxy server IPX-Forwarded-For headersproxy_buffering offclient_max_body_size 0 in Nginx configurationproxy_request_buffering off is setX-Forwarded-Proto header is properly sethttp://your-server:8888/speedtest.htmldocker run -p 8888:8888 -e API_PASSWORD=your_password mhdzumair/mediaflow-proxyAPI_PASSWORD and other environment variables in .env:echo "API_PASSWORD=your_password" > .envdocker compose up --detach[!IMPORTANT] Ensure that you have Python 3.10 or higher installed.
pip install mediaflow-proxyAPI_PASSWORD and other environment variables in .env:echo "API_PASSWORD=your_password" > .envmediaflow-proxyhttp://localhost:8888.uvicorn mediaflow_proxy.main:app --host 0.0.0.0 --port 8888 --workers 4 --forwarded-allow-ips "*"NoteOmit--forwarded-allow-ips "*"when running locally.
[!IMPORTANT] Ensure that you have Python 3.10 or higher installed.
git clone https://github.com/mhdzumair/mediaflow-proxy.git
cd mediaflow-proxypoetry installAPI_PASSWORD environment variable in .env:echo "API_PASSWORD=your_password" > .envpoetry run uvicorn mediaflow_proxy.main:app --host 0.0.0.0 --port 8888 --workers 4 --forwarded-allow-ips "*"NoteOmit--forwarded-allow-ips "*"when running locally.
docker build -t mediaflow-proxy .docker run -d -p 8888:8888 -e API_PASSWORD=your_password --restart unless-stopped --name mediaflow-proxy mediaflow-proxy
API_PASSWORD and set the value to your desired password.Dockerfile and paste the following content. After that, replace YourUsername/YourRepoName in the Dockerfile with your username and the name of your fork. Finally, click on "Commit" to save the changes. Remember, your space might get banned if instead of using your fork, you use the main repo.
1FROM python:3.10-slim-bookworm
2
3WORKDIR /app
4
5RUN apt-get update && apt-get install -y git
6
7RUN git clone https://github.com/YourUsername/YourRepoName.git .
8
9RUN pip install --no-cache-dir -r requirements.txt
10
11EXPOSE 7860
12CMD ["uvicorn", "run:main_app", "--host", "0.0.0.0", "--port", "7860", "--workers", "4"]/proxy/hls/manifest.m3u8: Proxify HLS streams/proxy/stream: Proxy generic http video streams/proxy/mpd/manifest.m3u8: Process MPD manifests/proxy/mpd/playlist.m3u8: Generate HLS playlists from MPD/proxy/mpd/segment.mp4: Process and decrypt media segments/proxy/ip: Get the public IP address of the MediaFlow Proxy server/extractor/video?host=: Extract direct video stream URLs from supported hosts (see supported hosts in API docs)/playlist/builder: Build and customize playlists from multiple sourceshttp://localhost:8888/docs.mpv "http://localhost:8888/proxy/stream?d=https://jsoncompare.org/LearningContainer/SampleFiles/Video/MP4/sample-mp4-file.mp4&api_password=your_password"PROXY_ROUTES='{"https://self-signed.badssl.com": {"proxy_url": null, "verify_ssl": false}}'mpv "http://localhost:8888/proxy/stream?d=https://self-signed.badssl.com/&api_password=your_password"mpv "http://localhost:8888/proxy/hls/manifest.m3u8?d=https://devstreaming-cdn.apple.com/videos/streaming/examples/img_bipbop_adv_example_fmp4/master.m3u8&h_referer=https://apple.com/&h_origin=https://apple.com&h_user-agent=Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/118.0.0.0 Safari/537.36&api_password=your_password"force_playlist_proxy parameter. This is commonly used with IPTV clients and applications:1# Example IPTV stream URL for use in IPTV clients like TiviMate, IPTV Smarters, etc.
2http://localhost:8888/proxy/hls/manifest.m3u8?d=https://iptv.example.com/playlist.m3u&force_playlist_proxy=true&api_password=your_password
3
4# With custom headers for IPTV providers that require authentication
5http://localhost:8888/proxy/hls/manifest.m3u8?d=https://iptv.provider.com/stream&force_playlist_proxy=true&h_user-agent=IPTV-Client&h_referer=https://iptv.provider.com&api_password=your_passwordmpv -v "http://localhost:8888/proxy/mpd/manifest.m3u8?d=https://livesim.dashif.org/livesim/chunkdur_1/ato_7/testpic4_8s/Manifest.mpd&api_password=your_password"mpv -v "http://localhost:8888/proxy/mpd/manifest.m3u8?d=https://media.axprod.net/TestVectors/v7-MultiDRM-SingleKey/Manifest_1080p_ClearKey.mpd&key_id=nrQFDeRLSAKTLifXUIPiZg&key=FmY0xnWCPCNaSpRG-tUuTQ&api_password=your_password"key and key_id parameters are automatically processed if they're not in the correct format.encode_mediaflow_proxy_url function:1from mediaflow_proxy.utils.http_utils import encode_mediaflow_proxy_url
2
3encoded_url = encode_mediaflow_proxy_url(
4 mediaflow_proxy_url="http://127.0.0.1:8888",
5 endpoint="/proxy/mpd/manifest.m3u8",
6 destination_url="https://media.axprod.net/TestVectors/v7-MultiDRM-SingleKey/Manifest_1080p_ClearKey.mpd",
7 query_params={
8 "key_id": "nrQFDeRLSAKTLifXUIPiZg",
9 "key": "FmY0xnWCPCNaSpRG-tUuTQ",
10 "api_password": "your_password"
11 },
12 request_headers={
13 "referer": "https://media.axprod.net/",
14 "origin": "https://media.axprod.net",
15 }
16)
17
18print(encoded_url)
19
20# http://127.0.0.1:8888/proxy/mpd/manifest.m3u8?key_id=nrQFDeRLSAKTLifXUIPiZg&key=FmY0xnWCPCNaSpRG-tUuTQ&api_password=your_password&d=https%3A%2F%2Fmedia.axprod.net%2FTestVectors%2Fv7-MultiDRM-SingleKey%2FManifest_1080p_ClearKey.mpd&h_referer=https%3A%2F%2Fmedia.axprod.net%2F&h_origin=https%3A%2F%2Fmedia.axprod.netvlc "http://127.0.0.1:8888/proxy/mpd/manifest.m3u8?key_id=nrQFDeRLSAKTLifXUIPiZg&key=FmY0xnWCPCNaSpRG-tUuTQ&api_password=dedsec&d=https%3A%2F%2Fmedia.axprod.net%2FTestVectors%2Fv7-MultiDRM-SingleKey%2FManifest_1080p_ClearKey.mpd"/generate_url: Generate a single encoded or encrypted URL/generate_urls: Generate multiple URLs with shared common parameters1import requests
2
3url = "http://localhost:8888/generate_url"
4data = {
5 "mediaflow_proxy_url": "http://localhost:8888",
6 "endpoint": "/proxy/stream",
7 "destination_url": "https://example.com/video.mp4",
8 "query_params": {
9 "some_param": "value"
10 # Add "api_password" here for encoded (non-encrypted) URLs
11 # "api_password": "your_password"
12 },
13 "request_headers": {
14 "referer": "https://example.com/",
15 "origin": "https://example.com",
16 },
17 "expiration": 3600, # URL will expire in 1 hour (only for encrypted URLs)
18 "ip": "123.123.123.123", # Optional: Restrict access to this IP (only for encrypted URLs)
19 "api_password": "your_password", # Add here for encrypted URLs
20 "filename": "movie.mp4" # Optional: Preserve filename for media players (only for /proxy/stream endpoint)
21}
22
23response = requests.post(url, json=data)
24encoded_url = response.json()["url"]
25print(encoded_url)Important Notes:
- If you add
api_passwordat the root level of the request, the URL will be encrypted.- If you add
api_passwordinside thequery_paramsobject, the URL will only be encoded (not encrypted).- The
filenameparameter is optional and should only be used with the/proxy/streamendpoint, not with MPD or HLS proxy endpoints.- The legacy endpoint
/generate_encrypted_or_encoded_urlis still available but deprecated. It's recommended to use/generate_urlinstead.
1import requests
2
3url = "http://localhost:8888/generate_urls"
4data = {
5 "mediaflow_proxy_url": "http://localhost:8888",
6 "api_password": "your_password",
7 "expiration": 3600, # URLs will expire in 1 hour (only for encrypted URLs)
8 "ip": "123.123.123.123", # Optional: Restrict access to this IP (only for encrypted URLs)
9 "urls": [
10 {
11 "destination_url": "https://example.com/video1.mp4",
12 "request_headers": {"referer": "https://example.com"},
13 "filename": "movie1.mp4",
14 "endpoint": "/proxy/stream"
15 },
16 {
17 "destination_url": "https://example.com/video2.mp4",
18 "request_headers": {"referer": "https://example.com"},
19 "filename": "movie2.mp4",
20 "endpoint": "/proxy/stream"
21 }
22 ]
23}
24
25response = requests.post(url, json=data)
26encoded_urls = response.json()["urls"]
27for url in encoded_urls:
28 print(url)filename parameter in your request, the proxy will ensure this information is preserved and properly passed to the media player./proxy/ip endpoint allows you to retrieve the public IP address of the MediaFlow Proxy server, which is crucial for routing Debrid streams correctly./proxy/ip endpoint to get the MediaFlow Proxy server's public IP.1# Set Stremio server URL
2STREMIO_PROXY_URL=http://127.0.0.1:11470
3
4# Choose routing strategy
5M3U8_CONTENT_ROUTING=stremio # or "mediaflow" (default) or "direct"mediaflow (default): All content through MediaFlowstremio: Video segments through Stremio, playlists through MediaFlowdirect: Video segments served directly, playlists through MediaFlowforce_playlist_proxy parameter to ensure all playlist URLs are proxied through MediaFlow:1# Force all playlist URLs to be proxied through MediaFlow (for IPTV clients)
2http://localhost:8888/proxy/hls/manifest.m3u8?d=https://iptv.provider.com/playlist&force_playlist_proxy=true&api_password=your_password/proxy/stream, /proxy/hls/manifest.m3u8, etc.)/extractor/video)/proxy/mpd/manifest.m3u8, /proxy/mpd/playlist.m3u8)1POST /base64/encode
2Content-Type: application/json
3
4{
5 "url": "https://example.com/video.mp4"
6}1{
2 "encoded_url": "aHR0cHM6Ly9leGFtcGxlLmNvbS92aWRlby5tcDQ",
3 "original_url": "https://example.com/video.mp4"
4}1POST /base64/decode
2Content-Type: application/json
3
4{
5 "encoded_url": "aHR0cHM6Ly9leGFtcGxlLmNvbS92aWRlby5tcDQ"
6}1{
2 "decoded_url": "https://example.com/video.mp4",
3 "encoded_url": "aHR0cHM6Ly9leGFtcGxlLmNvbS92aWRlby5tcDQ"
4}GET /base64/check?url=aHR0cHM6Ly9leGFtcGxlLmNvbS92aWRlby5tcDQ1{
2 "url": "aHR0cHM6Ly9leGFtcGxlLmNvbS92aWRlby5tcDQ",
3 "is_base64": true,
4 "decoded_url": "https://example.com/video.mp4"
5}/generate_url endpoint now supports a base64_encode_destination parameter:1import requests
2
3url = "http://localhost:8888/generate_url"
4data = {
5 "mediaflow_proxy_url": "http://localhost:8888",
6 "endpoint": "/proxy/stream",
7 "destination_url": "https://example.com/video.mp4",
8 "base64_encode_destination": True, # Encode destination URL in base64
9 "api_password": "your_password"
10}
11
12response = requests.post(url, json=data)
13encoded_url = response.json()["url"]
14print(encoded_url)1# Original URL: https://example.com/video.mp4
2# Base64 encoded: aHR0cHM6Ly9leGFtcGxlLmNvbS92aWRlby5tcDQ
3
4mpv "http://localhost:8888/proxy/stream?d=aHR0cHM6Ly9leGFtcGxlLmNvbS92aWRlby5tcDQ&api_password=your_password"1# Base64 encoded HLS URL
2mpv "http://localhost:8888/proxy/hls/manifest.m3u8?d=aHR0cDovL2V4YW1wbGUuY29tL3BsYXlsaXN0Lm0zdTg&api_password=your_password"1# Base64 encoded extractor URL
2curl "http://localhost:8888/extractor/video?host=Doodstream&d=aHR0cHM6Ly9kb29kc3RyZWFtLmNvbS9lL3NvbWVfaWQ&api_password=your_password"1# Base64 encoded DASH manifest URL
2mpv "http://localhost:8888/proxy/mpd/manifest.m3u8?d=aHR0cHM6Ly9leGFtcGxlLmNvbS9tYW5pZmVzdC5tcGQ&api_password=your_password"+ and / characters- and _ characters instead of + and /= characters)