diff --git a/apps/output/views.py b/apps/output/views.py index 958dd3be..a2da5597 100644 --- a/apps/output/views.py +++ b/apps/output/views.py @@ -1933,9 +1933,6 @@ def xc_get_user(request): def xc_get_info(request, full=False): - if not network_access_allowed(request, 'XC_API'): - return JsonResponse({'error': 'Forbidden'}, status=403) - user = xc_get_user(request) if user is None: @@ -1984,9 +1981,6 @@ def xc_get_info(request, full=False): def xc_player_api(request, full=False): - if not network_access_allowed(request, 'XC_API'): - return JsonResponse({'error': 'Forbidden'}, status=403) - action = request.GET.get("action") user = xc_get_user(request) @@ -2021,9 +2015,6 @@ def xc_player_api(request, full=False): def xc_panel_api(request): - if not network_access_allowed(request, 'XC_API'): - return JsonResponse({'error': 'Forbidden'}, status=403) - user = xc_get_user(request) if user is None: diff --git a/apps/proxy/ts_proxy/views.py b/apps/proxy/ts_proxy/views.py index cb926890..35946815 100644 --- a/apps/proxy/ts_proxy/views.py +++ b/apps/proxy/ts_proxy/views.py @@ -564,6 +564,9 @@ def stream_xc(request, username, password, channel_id): extension = pathlib.Path(channel_id).suffix channel_id = pathlib.Path(channel_id).stem + if not network_access_allowed(request, 'STREAMS', user): + return Response({"error": "Forbidden"}, status=403) + custom_properties = user.custom_properties or {} if "xc_password" not in custom_properties: @@ -572,9 +575,6 @@ def stream_xc(request, username, password, channel_id): if custom_properties["xc_password"] != password: return Response({"error": "Invalid credentials"}, status=401) - if not network_access_allowed(request, 'STREAMS', user): - return Response({"error": "Invalid credentials"}, status=401) - if user.user_level < 10: user_profile_count = user.channel_profiles.count() diff --git a/apps/proxy/vod_proxy/views.py b/apps/proxy/vod_proxy/views.py index c5d39fb9..f73f48b4 100644 --- a/apps/proxy/vod_proxy/views.py +++ b/apps/proxy/vod_proxy/views.py @@ -1023,6 +1023,9 @@ def stream_xc_movie(request, username, password, stream_id, extension): user = get_object_or_404(User, username=username) + if not network_access_allowed(request, 'STREAMS', user): + return Response({"error": "Forbidden"}, status=403) + custom_properties = user.custom_properties or {} if "xc_password" not in custom_properties: @@ -1031,9 +1034,6 @@ def stream_xc_movie(request, username, password, stream_id, extension): if custom_properties["xc_password"] != password: return Response({"error": "Invalid credentials"}, status=401) - if not network_access_allowed(request, 'STREAMS', user): - return Response({"error": "Invalid credentials"}, status=401) - # All authenticated users get access to VOD from all active M3U accounts filters = {"movie_id": stream_id, "m3u_account__is_active": True} @@ -1060,6 +1060,9 @@ def stream_xc_episode(request, username, password, stream_id, extension): user = get_object_or_404(User, username=username) + if not network_access_allowed(request, 'STREAMS', user): + return Response({"error": "Forbidden"}, status=403) + custom_properties = user.custom_properties or {} if "xc_password" not in custom_properties: @@ -1068,9 +1071,6 @@ def stream_xc_episode(request, username, password, stream_id, extension): if custom_properties["xc_password"] != password: return Response({"error": "Invalid credentials"}, status=401) - if not network_access_allowed(request, 'STREAMS', user): - return Response({"error": "Invalid credentials"}, status=401) - # All authenticated users get access to series/episodes from all active M3U accounts filters = {"episode_id": stream_id, "m3u_account__is_active": True}