handle 404 video sponsorblock, #526

This commit is contained in:
Simon 2023-08-26 21:05:17 +07:00
parent 41f6a03751
commit d42bd612d0
No known key found for this signature in database
GPG Key ID: 2C15AA5E89985DD4

View File

@ -228,6 +228,10 @@ class VideoSponsorView(ApiBaseView):
# pylint: disable=unused-argument
self.get_document(video_id)
if not self.response.get("data"):
message = {"message": "video not found"}
return Response(message, status=404)
sponsorblock = self.response["data"].get("sponsorblock")
return Response(sponsorblock)