From 23798f205de55a4a5b3b1c787495524d34e6aea2 Mon Sep 17 00:00:00 2001 From: Your Name Date: Mon, 25 Jan 2021 17:36:27 +0100 Subject: [PATCH] improve message as per jdepoix suggestion --- youtube_transcript_api/_errors.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/youtube_transcript_api/_errors.py b/youtube_transcript_api/_errors.py index c19a820..1b8360a 100644 --- a/youtube_transcript_api/_errors.py +++ b/youtube_transcript_api/_errors.py @@ -39,11 +39,10 @@ class VideoUnavailable(CouldNotRetrieveTranscript): CAUSE_MESSAGE = 'The video is no longer available' class TooManyRequests(CouldNotRetrieveTranscript): - CAUSE_MESSAGE = ('YouTube is receiving too many requests from this IP, ' - '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.' - ) + CAUSE_MESSAGE = ("YouTube is receiving too many requests from this IP and now requires solving a captcha to continue. One of the following things can be done to work around this:\n\ + - Manually solve the captcha in a browser and export the cookie. Read here how to use that cookie with youtube-transcript-api: https://github.com/jdepoix/youtube-transcript-api#cookies\n\ + - Use a different IP address\n\ + - Wait until the ban on your IP has been lifted") class TranscriptsDisabled(CouldNotRetrieveTranscript): CAUSE_MESSAGE = 'Subtitles are disabled for this video'