Spaces:
Paused
Paused
Fix VLC player issue with HLS stream with a status code & bump version
Browse filesFiles changed (3)
52 unmodified lines5354555657585914 unmodified lines7475767778798052 unmodified lines#### Using pip> ![Note]> Ensure that you have Python 3.10 or higher installed.1. Install the package:14 unmodified lines#### Using git & poetry> ![Note]> Ensure that you have Python 3.10 or higher installed.52 unmodified lines5354555657585914 unmodified lines7475767778798052 unmodified lines#### Using pip> ![IMPORTANT]> Ensure that you have Python 3.10 or higher installed.1. Install the package:14 unmodified lines#### Using git & poetry> ![IMPORTANT]> Ensure that you have Python 3.10 or higher installed.
4 unmodified lines56789101157 unmodified lines6970717273747561 unmodified lines13713813914014114214314414514614714834 unmodified lines1831841851861871881891901914 unmodified linesfrom fastapi import Request, Response, HTTPExceptionfrom pydantic import HttpUrlfrom starlette.background import BackgroundTaskfrom starlette.status import HTTP_206_PARTIAL_CONTENTfrom .configs import settingsfrom .const import SUPPORTED_RESPONSE_HEADERS57 unmodified linesreturn EnhancedStreamingResponse(streamer.stream_content(destination, headers),status_code=HTTP_206_PARTIAL_CONTENT,headers=response_headers,background=BackgroundTask(streamer.close),)61 unmodified linesif method == "HEAD":await streamer.close()return Response(headers=response_headers, status_code=HTTP_206_PARTIAL_CONTENT)else:return EnhancedStreamingResponse(streamer.stream_content(video_url, headers),headers=response_headers,status_code=HTTP_206_PARTIAL_CONTENT,background=BackgroundTask(streamer.close),)except httpx.HTTPStatusError as e:34 unmodified linescontent=processed_content,media_type="application/vnd.apple.mpegurl",headers={"Cache-Control": "no-cache, no-store, must-revalidate","Pragma": "no-cache","Expires": "0",},)except httpx.HTTPStatusError as e:4 unmodified lines567891057 unmodified lines6869707172737461 unmodified lines13613713813914014114214314414514614734 unmodified lines1821831841851861871881894 unmodified linesfrom fastapi import Request, Response, HTTPExceptionfrom pydantic import HttpUrlfrom starlette.background import BackgroundTaskfrom .configs import settingsfrom .const import SUPPORTED_RESPONSE_HEADERS57 unmodified linesreturn EnhancedStreamingResponse(streamer.stream_content(destination, headers),status_code=response.status_code,headers=response_headers,background=BackgroundTask(streamer.close),)61 unmodified linesif method == "HEAD":await streamer.close()return Response(headers=response_headers, status_code=response.status_code)else:return EnhancedStreamingResponse(streamer.stream_content(video_url, headers),headers=response_headers,status_code=response.status_code,background=BackgroundTask(streamer.close),)except httpx.HTTPStatusError as e:34 unmodified linescontent=processed_content,media_type="application/vnd.apple.mpegurl",headers={"Content-Disposition": "inline","Accept-Ranges": "none",},)except httpx.HTTPStatusError as e:
123456[tool.poetry]name = "mediaflow-proxy"version = "1.4.2"description = "A high-performance proxy server for streaming media, supporting HTTP(S), HLS, and MPEG-DASH with real-time DRM decryption."authors = ["mhdzumair <mhdzumair@gmail.com>"]readme = "README.md"123456[tool.poetry]name = "mediaflow-proxy"version = "1.5.0"description = "A high-performance proxy server for streaming media, supporting HTTP(S), HLS, and MPEG-DASH with real-time DRM decryption."authors = ["mhdzumair <mhdzumair@gmail.com>"]readme = "README.md"
README.md+2-2
mediaflow_proxy/handlers.py+5-7
pyproject.toml+1-1