An Interest In:
Web News this Week
- April 22, 2024
- April 21, 2024
- April 20, 2024
- April 19, 2024
- April 18, 2024
- April 17, 2024
- April 16, 2024
Getting the Transcription of a Video From Youtube using google cloud platform.
So, the other day I was searching for python code that gives me a transcript of any video, I did what all we do I searched everywhere on Internet but was unfortunate. But we are programmers best thing we do is search more on the internet. finally, I got the code I wanted, all thanks to
Pragnakalp Techlabs
. Although the code was a little different from my expectations I did some filters on it and made it to view the transcripts of the youtube video.
Be patient there are going to be few steps involved in our process !!
# pip install google-api-python-client# pip install youtube_transcript_apifrom apiclient.discovery import buildfrom youtube_transcript_api import YouTubeTranscriptApiapi_key = "Secret Key" # replace it with your API keyvideo_id = str(input("Enter the video id: ")) # replace it with your channel idyoutube = build('youtube', 'v3',developerKey=api_key)try: responses = YouTubeTranscriptApi.get_transcript( video_id, languages=['en']) print('
'+"Video: "+"https://www.youtube.com/watch?v=" + str(video_id)+'
'+'
'+"Captions:") for response in responses: text = response['text'] print(text)except Exception as e: print(e)
For full tutorial how to get the API key and all that thing you can check out my medium article on this
https://medium.com/@computer_geek/getting-the-transcription-of-a-video-from-youtube-using-google-cloud-platform-3c862d1276a5
To be honest, I am finding it little difficult to write code and syntax highlighting and inserting images on dev platform, but the code may not look very attractive but that works fine for any video on youtube.
And also you can follow me on my twitter
Original Link: https://dev.to/computergeek/getting-the-transcription-of-a-video-from-youtube-using-google-cloud-platform-19ed
Dev To
An online community for sharing and discovering great ideas, having debates, and making friendsMore About this Source Visit Dev To