apps: output: views.py: exclude M3U endpointfrom CSRF protection

Excludes the M3U generation view from CSRF protection. This allows IPTV Smarters apps (I only tested on Android) to access the playlist. Otherwise a 403 error is returned because instead of an GET request these apps are doing a POST request with empty body to the endpoint.
This commit is contained in:
Marlon Alkan 2025-05-31 01:25:28 +02:00
parent a9cdc9e37a
commit 669120e35a
No known key found for this signature in database
GPG key ID: 274AEA6F2D6A8CC2

View file

@ -3,10 +3,12 @@ from django.urls import reverse
from apps.channels.models import Channel, ChannelProfile
from apps.epg.models import ProgramData
from django.utils import timezone
from django.views.decorators.csrf import csrf_exempt
from datetime import datetime, timedelta
import re
import html # Add this import for XML escaping
@csrf_exempt
def generate_m3u(request, profile_name=None):
"""
Dynamically generate an M3U file from channels.