diff --git a/app.py b/app.py index 399dff0..1577f6c 100644 --- a/app.py +++ b/app.py @@ -299,6 +299,11 @@ def proxy(video_id): logger.error(f"Failed to retrieve data for video ID '{video_id}'") return Response("Video not found", status=404) + reason_code = params.get('reasonCode', '').upper() + if reason_code in ['HIDDEN_VIDEO']: + logger.warning(f"Video ID '{video_id}' is hidden") + return Response("Video not found", status=404) + thumbnail_url = ( params["video"]["thumbnail"].get("ogp") or params["video"]["thumbnail"].get("player") or