
Security News
ESLint Adds Official Support for Linting HTML
ESLint now supports HTML linting with 48 new rules, expanding its language plugin system to cover more of the modern web development stack.
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
ESLint now supports HTML linting with 48 new rules, expanding its language plugin system to cover more of the modern web development stack.
Security News
CISA is discontinuing official RSS support for KEV and cybersecurity alerts, shifting updates to email and social media, disrupting automation workflows.
Security News
The MCP community is launching an official registry to standardize AI tool discovery and let agents dynamically find and install MCP servers.