Ignore hidden videos
This commit is contained in:
parent
2ca6d6aa73
commit
e6d7278624
5
app.py
5
app.py
@ -299,6 +299,11 @@ def proxy(video_id):
|
|||||||
logger.error(f"Failed to retrieve data for video ID '{video_id}'")
|
logger.error(f"Failed to retrieve data for video ID '{video_id}'")
|
||||||
return Response("Video not found", status=404)
|
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 = (
|
thumbnail_url = (
|
||||||
params["video"]["thumbnail"].get("ogp") or
|
params["video"]["thumbnail"].get("ogp") or
|
||||||
params["video"]["thumbnail"].get("player") or
|
params["video"]["thumbnail"].get("player") or
|
||||||
|
Loading…
x
Reference in New Issue
Block a user