requests.exceptions.ConnectionError: HTTPSConnectionPool(host='www.youtube.com', port=443): Max retries exceeded with url: /watch?
See original GitHub issueHello,
I am using youtube-transcript-api and this error is thrown from time to time.
requests.exceptions.ConnectionError: HTTPSConnectionPool(host='www.youtube.com', port=443): Max retries exceeded with url: /watch?v=N1pseW9waNI (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7f2148e536d0>: Failed to establish a new connection: [Errno -5] No address associated with hostname'))
I’ve also added a time.sleep(2.4) (politeness delay of 2.4s between two requests) but this doesn’t solve the problem. PS: When I get the error, I wait approx. 20mn and I send the request, it works, and just after, the error thrown, and so forth…
The line producing the error is : transcript_list = YouTubeTranscriptApi.list_transcripts(video_id)
Whole ERROR logs:
Your help is appreciated ! 😃) thanks
Issue Analytics
- State:
- Created 2 years ago
- Comments:11 (6 by maintainers)
Top GitHub Comments
That is more the kind of result I expected. Unfortunately though, I don’t think there is much I can help you with here. If your machine isn’t even able to curl YouTube, there isn’t much that YouTube Transcript API can do, to work around this. Maybe there is something in your networking stack which is causing this problem, but it also could be that YouTube is blocking your requests. In the later case there isn’t really anything you can do other than changing your IP address. In the first case you’ll probably have to debug that yourself, as this is really hard to do without being able to play around on your infrastructure and quite frankly this is a bit out of the scope of this module. Sorry, I can’t help here! I will close this issue for now, but feel free to share more information for future readers if you happen to find a solution for your specific problem.
Hello @jdepoix . Something new: I tried to curl the youtube video link, then result returned is this. (I’ve tried to curl youtube & google as well).