question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

requests.exceptions.ConnectionError: HTTPSConnectionPool(host='www.youtube.com', port=443): Max retries exceeded with url: /watch?

See original GitHub issue

Hello, 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:

logs.txt

Your help is appreciated ! 😃) thanks

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:11 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
jdepoixcommented, Dec 7, 2021

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.

0reactions
BMouhcinecommented, Dec 7, 2021

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).

image

Read more comments on GitHub >

github_iconTop Results From Across the Web

Max retries exceeded with URL in requests - python
when I tried to download a file specified in the url. The error was HTTPSConnectionPool(host, port=443): Max retries exceeded with url (Caused ...
Read more >
(Python) ConnectionError: Max retries exceeded with url
To solve the requests ConnectionError: Max retries exceeded with url, use a `Retry` object and specify how many connection-related errors to retry on...
Read more >
Fix “Max retries exceeded with URL” error in Python ...
The error message usually begins with requests.exceptions.ConnectionError , which tell us that there is something bad happened when requests was ...
Read more >
max-retries-exceeded exceptions are confusing #1198
requests.exceptions.ConnectionError: HTTPConnectionPool(host='localhost', port=1111): Max retries exceeded with url: / (Caused by <class 'socket.error'>: ...
Read more >
how to handle python requests.exceptions.ConnectionError
... request=request) requests. exceptions. ConnectionError : HTTPConnectionPool ( host =' youtube.com', port =80): Max retries exceeded with url : ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found