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

Method start

apps/proxy/views.py:13–41  ·  view source on GitHub ↗

Start a proxy server for a channel

(self, request)

Source from the content-addressed store, hash-verified

11
12 @action(detail=False, methods=['post'])
13 def start(self, request):
14 """Start a proxy server for a channel"""
15 try:
16 proxy_type = request.data.get('type', 'hls')
17 channel_id = request.data.get('channel', 'default')
18 url = request.data.get('url')
19
20 if not url:
21 return Response(
22 {'error': 'URL is required'},
23 status=status.HTTP_400_BAD_REQUEST
24 )
25
26 proxy_app = apps.get_app_config('proxy')
27 proxy_server = getattr(proxy_app, f'{proxy_type}_proxy')
28 proxy_server.initialize_channel(url, channel_id)
29
30 return Response({
31 'message': f'{proxy_type.upper()} proxy started',
32 'channel': channel_id,
33 'url': url
34 })
35
36 except Exception as e:
37 logger.error(f"Error starting proxy: {e}")
38 return Response(
39 {'error': str(e)},
40 status=status.HTTP_500_INTERNAL_SERVER_ERROR
41 )
42
43 @action(detail=False, methods=['post'])
44 def stop(self, request):

Callers 9

setUpMethod · 0.45
setUpMethod · 0.45
setUpMethod · 0.45
run_recordingFunction · 0.45
stopMethod · 0.45
refresh_artworkMethod · 0.45
destroyMethod · 0.45

Calls 2

getMethod · 0.45
initialize_channelMethod · 0.45

Tested by 5

setUpMethod · 0.36
setUpMethod · 0.36
setUpMethod · 0.36