INNER CODE UNIT · Python
YouTubeRequestFailed
jdepoix/youtube-transcript-api · youtube_transcript_api/_errors.py:83
class YouTubeRequestFailed(CouldNotRetrieveTranscript):
CAUSE_MESSAGE = "Request to YouTube failed: {reason}"
def __init__(self, video_id: str, http_error: HTTPError):
self.reason = str(http_error)
super().__init__(video_id)
@property
def cause(self) -> str:
return self.CAUSE_MESSAGE.format(
reason=self.reason,
)
class VideoUnplayable(CouldNotRetrieveTranscript):
CAUSE_MESSAGE = "The video is unplayable for the following reason: {reason}"
SUBREASON_MESSAGE = "\n\nAdditional Details:\n{sub_reasons}"