mhdzumair commited on
Commit
25fe1e3
1 Parent(s): d130bf4

Rename segment endpoint to 'segment.mp4' and improve logging

Browse files

The endpoint '/mpd/segment' has been renamed to '/mpd/segment.mp4' for clarity in the route. Additionally, logging for internal server errors now uses 'logger.exception' to provide more detailed error information.

README.md CHANGED
@@ -153,7 +153,7 @@ Ideal for users who want a reliable, plug-and-play solution without the technica
153
  2. `/proxy/stream`: Proxy generic http video streams
154
  3. `/proxy/mpd/manifest.m3u8`: Process MPD manifests
155
  4. `/proxy/mpd/playlist.m3u8`: Generate HLS playlists from MPD
156
- 5. `/proxy/mpd/segment`: Process and decrypt media segments
157
  6. `/proxy/ip`: Get the public IP address of the MediaFlow Proxy server
158
 
159
  Once the server is running, for more details on the available endpoints and their parameters, visit the Swagger UI at `http://localhost:8888/docs`.
 
153
  2. `/proxy/stream`: Proxy generic http video streams
154
  3. `/proxy/mpd/manifest.m3u8`: Process MPD manifests
155
  4. `/proxy/mpd/playlist.m3u8`: Generate HLS playlists from MPD
156
+ 5. `/proxy/mpd/segment.mp4`: Process and decrypt media segments
157
  6. `/proxy/ip`: Get the public IP address of the MediaFlow Proxy server
158
 
159
  Once the server is running, for more details on the available endpoints and their parameters, visit the Swagger UI at `http://localhost:8888/docs`.
mediaflow_proxy/handlers.py CHANGED
@@ -63,7 +63,7 @@ def handle_exceptions(exception: Exception) -> Response:
63
  logger.error(f"Error downloading content: {exception}")
64
  return Response(status_code=exception.status_code, content=str(exception))
65
  else:
66
- logger.error(f"Internal server error while handling request: {exception}")
67
  return Response(status_code=502, content=f"Internal server error: {exception}")
68
 
69
 
 
63
  logger.error(f"Error downloading content: {exception}")
64
  return Response(status_code=exception.status_code, content=str(exception))
65
  else:
66
+ logger.exception(f"Internal server error while handling request: {exception}")
67
  return Response(status_code=502, content=f"Internal server error: {exception}")
68
 
69
 
mediaflow_proxy/routes.py CHANGED
@@ -96,7 +96,7 @@ async def playlist_endpoint(
96
  return await get_playlist(request, playlist_params, proxy_headers)
97
 
98
 
99
- @proxy_router.get("/mpd/segment")
100
  async def segment_endpoint(
101
  segment_params: Annotated[MPDSegmentParams, Query()],
102
  proxy_headers: Annotated[ProxyRequestHeaders, Depends(get_proxy_headers)],
 
96
  return await get_playlist(request, playlist_params, proxy_headers)
97
 
98
 
99
+ @proxy_router.get("/mpd/segment.mp4")
100
  async def segment_endpoint(
101
  segment_params: Annotated[MPDSegmentParams, Query()],
102
  proxy_headers: Annotated[ProxyRequestHeaders, Depends(get_proxy_headers)],