Error message more descriptive

This commit is contained in:
Your Name 2021-01-22 14:18:56 +01:00
parent fb819c06e4
commit dbf5eeafe6
1 changed files with 5 additions and 2 deletions

View File

@ -39,8 +39,11 @@ class VideoUnavailable(CouldNotRetrieveTranscript):
CAUSE_MESSAGE = 'The video is no longer available' CAUSE_MESSAGE = 'The video is no longer available'
class TooManyRequests(CouldNotRetrieveTranscript): class TooManyRequests(CouldNotRetrieveTranscript):
CAUSE_MESSAGE = ('YouTube is receiving too many requests from this IP,' CAUSE_MESSAGE = ('YouTube is receiving too many requests from this IP, '
' and now requires that a captcha must be solved in order to continue.') 'and now requires that a captcha must be solved in order to continue. '
'You can solve the captcha in a browser and pass the generated cookie file to youtube-transcript-api, '
'or you can use a different IP, or maybe wait for the ban to be lifted.'
)
class TranscriptsDisabled(CouldNotRetrieveTranscript): class TranscriptsDisabled(CouldNotRetrieveTranscript):
CAUSE_MESSAGE = 'Subtitles are disabled for this video' CAUSE_MESSAGE = 'Subtitles are disabled for this video'