jdepoix / youtube-transcript-api

This is a python API which allows you to get the transcript/subtitles for a given YouTube video. It also works for automatically generated subtitles and it does not require an API key nor a headless browser, like other selenium based solutions do!

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Bug in _transcripts.py line 37 raise YouTubeRequestFailed(error, video_id)

tbelfort opened this issue · comments

I deleted, because it's not relevant. I just spotted this while reading the code. :-)

The code in _errors.py is

class YouTubeRequestFailed(CouldNotRetrieveTranscript):
CAUSE_MESSAGE = 'Request to YouTube failed: {reason}'

def init(self, video_id, http_error):
self.reason = str(http_error)
super(YouTubeRequestFailed, self).init(video_id)

Ie, video_id, http_error, but it's called with YouTubeRequestsFailed(error, video_id)

Hi @tbelfort,
Could you please elaborate what you think the issue is here, I don't think I completely understand 🤔
super(YouTubeRequestFailed, self).__init__(video_id) is a call to the parent constructor of CouldNotRetrieveTranscript, which seems fine to me?

closed due to inactivity