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!
MIT License
2.55k stars 280 forks source link

SSL Errors when using transcript API #239

Closed vahndi closed 6 months ago

vahndi commented 6 months ago

DO NOT DELETE THIS! Please take the time to fill this out properly. I am not able to help you if I do not know what you are executing and what error messages you are getting. If you are having problems with a specific video make sure to include the video id.

To Reproduce

Steps to reproduce the behavior:

What code / cli command are you executing?

I am running

from youtube_transcript_api import YouTubeTranscriptApi
transcript_list = YouTubeTranscriptApi.list_transcripts('pxiP-HJLCx0')

Which Python version are you using?

Python 3.9

Which version of youtube-transcript-api are you using?

youtube-transcript-api 0.6.1

Expected behavior

Get list of transcripts for video

Actual behaviour

Instead I received the following error message:

SSLError: HTTPSConnectionPool(host='www.youtube.com', port=443): Max retries exceeded with url: /watch?v=pxiP-HJLCx0 (Caused by SSLError(SSLZeroReturnError(6, 'TLS/SSL connection has been closed (EOF) (_ssl.c:1129)')))
benrapport commented 6 months ago

I am seeing this as well!

sumersao commented 6 months ago

Also having this issue!

lober-io commented 6 months ago

With Python 3.10.11 and youtube-transcript-api 0.6.1 its working for me

vahndi commented 6 months ago

I realized this is an OpenSSL issue in Windows. This was causing requests (and pip) to fail.