
Security News
Vite Releases Technical Preview of Rolldown-Vite, a Rust-Based Bundler
Vite releases Rolldown-Vite, a Rust-based bundler preview offering faster builds and lower memory usage as a drop-in replacement for Vite.
github.com/hightemp/youtube-transcript-api-go
This is a Go version of the YouTube Transcript API library, which allows you to retrieve transcriptions (subtitles) for YouTube videos. Based on https://github.com/jdepoix/youtube-transcript-api/.
go get github.com/hightemp/youtube-transcript-api-go
package main
import (
"fmt"
"log"
"os"
"github.com/hightemp/youtube-transcript-api-go/api"
)
func main() {
// Set proxy (if necessary)
os.Setenv("HTTP_PROXY", "http://your-proxy-server:port")
youtubeAPI := api.NewYouTubeTranscriptApi()
videoID := "aBcDeFgHiJk" // Replace with the actual video ID
languages := []string{"en", "ru"} // Language priority
transcript, err := youtubeAPI.GetTranscript(videoID, languages)
if err != nil {
log.Fatalf("Error getting transcript: %v", err)
}
fmt.Printf("Transcript for video %s in language %s:\n", videoID, transcript.Language)
for _, entry := range transcript.Entries {
fmt.Printf("[%.2f - %.2f]: %s\n", entry.Start, entry.Start+entry.Duration, entry.Text)
}
}
In the examples/get_transcript
directory, there's an example demonstrating how to get a transcript for a video with ID "pPjDPe0duXc" in Russian. To run this example, execute the following commands:
cd examples/get_transcript
go run main.go
HTTP_PROXY=http://your-proxy-server:port youtube-transcript-api-go -video=aBcDeFgHiJk -languages=en,ru -format=text
Available options:
-video
: YouTube video ID (required parameter)-languages
: Language codes separated by commas (default "en")-format
: Output format (text, json, srt) (default "text")This project is distributed under the MIT license. See the LICENSE file for details.
FAQs
Unknown package
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Vite releases Rolldown-Vite, a Rust-based bundler preview offering faster builds and lower memory usage as a drop-in replacement for Vite.
Research
Security News
A malicious npm typosquat uses remote commands to silently delete entire project directories after a single mistyped install.
Research
Security News
Malicious PyPI package semantic-types steals Solana private keys via transitive dependency installs using monkey patching and blockchain exfiltration.