pip install youtube_transcript_api
from youtube_transcript_api import YouTubeTranscriptApi YouTubeTranscriptApi.get_transcript(video_id)