MCPcopy Create free account
hub / github.com/Dispatcharr/Dispatcharr / initialize_stream

Function initialize_stream

apps/proxy/hls_proxy/views.py:83–101  ·  view source on GitHub ↗

Initialize a new HLS stream channel

(request, channel_id)

Source from the content-addressed store, hash-verified

81@csrf_exempt
82@require_http_methods(["POST"])
83def initialize_stream(request, channel_id):
84 """Initialize a new HLS stream channel"""
85 try:
86 data = json.loads(request.body)
87 url = data.get('url')
88 if not url:
89 return JsonResponse({'error': 'No URL provided'}, status=400)
90
91 proxy_server.initialize_channel(url, channel_id)
92 return JsonResponse({
93 'message': 'Stream initialized',
94 'channel': channel_id,
95 'url': url
96 })
97 except json.JSONDecodeError:
98 return JsonResponse({'error': 'Invalid JSON'}, status=400)
99 except Exception as e:
100 logger.error(f"Failed to initialize stream: {e}")
101 return JsonResponse({'error': str(e)}, status=500)

Callers

nothing calls this directly

Calls 2

getMethod · 0.45
initialize_channelMethod · 0.45

Tested by

no test coverage detected