Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

how to download the captions of a youtube video

# pip install youtube_transcript_api

from youtube_transcript_api import YouTubeTranscriptApi

video_link = 'https://www.youtube.com/watch?v=Vdj1TNWJAZ4&t=8s'

video_id = video_link.split('watch?v=')[1]

subtitle = YouTubeTranscriptApi.get_transcript(video_id=video_id, languages=['en'])

# you can do anything with downloaded caption.
# for example:
print(subtitle)
Comment

PREVIOUS NEXT
Code Example
Python :: merge dictionaries in python 
Python :: python remove multiple characters from string 
Python :: python sizeof 
Python :: except python 
Python :: join pandas dataframe by column 
Python :: ym ip 
Python :: python pyramid 
Python :: string split in pandas 
Python :: python with file 
Python :: json filter python 
Python :: How to search where a character is in an array in python 
Python :: python get string from decimal 
Python :: clahe opencv 
Python :: conda import django 
Python :: playsound error python 
Python :: Conversion of number string to float in django 
Python :: sqlite3 delete row python 
Python :: Make a Basic Face Detection Algorithm in Python Using OpenCV and Haar Cascades 
Python :: create new env in anaconda 
Python :: pathlib path python 
Python :: adf test python 
Python :: python requests post 
Python :: how to change font in tkinter 
Python :: write a list into csv python 
Python :: how to reset index after dropping rows pandas 
Python :: sort by multiple keys in object python 
Python :: pyautogui moveTo overtime 
Python :: continual vs continuous 
Python :: change x axis frequency 
Python :: python count multiple characters in string 
ADD CONTENT
Topic
Content
Source link
Name
7+1 =