diff --git a/app.py b/app.py index 417a311..1e8d48e 100644 --- a/app.py +++ b/app.py @@ -293,8 +293,9 @@ def cdn_redirect(video_id): Only responds to requests from Discord bots. """ logger.info(f"{video_id}: CDN redirect request received") - request_user_agent = request.headers.get('User-Agent', '').lower() - if 'discordbot' not in request_user_agent: + request_user_agent = request.headers.get('User-Agent', '') + # Discord uses a more realistic user agent for file requests + if 'Firefox/38.0' not in request_user_agent and 'Macintosh' not in request_user_agent: logger.info(f"{video_id}: Video CDN redirect ignored due to user agent ({request_user_agent})") return Response("Video not found", status=404)