Skip to content

Elixir's library for fetching video transcriptions from YouTube 👓

Notifications You must be signed in to change notification settings

patrykwozinski/youtex

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

92 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Youtex Build Status Hex pm

A tool to list or to retrieve video transcriptions from Youtube.

Installation

Add youtex to the list of dependencies inside mix.exs:

def deps do
  [
    {:youtex, "~> 0.2.0"}
  ]
end

Usage

There are 2 main functions:

Youtex.list_transcripts(video_id)

Youtex.list_transcripts("lxYFOM3UJzo")

{:ok,
 [
   %Youtex.Transcript{
     generated: false,
     language_code: "en",
     name: "Inglês",
     sentences: [],
     url: "https://www.youtube.com/api/timedtext..."
   },
   %Youtex.Transcript{...},
   ...
 ]}

Youtex.get_transcription(video_id, language \\ "en")

Youtex.get_transcription("lxYFOM3UJzo")

{:ok,
 %Youtex.Transcript{
   generated: false,
   language_code: "en",
   name: "Inglês",
   sentences: [
     %Youtex.Transcript.Sentence{
       duration: 9.3,
       start: 9.53,
       text: "I remember like my first computer was a\nPentium 100 megahertz. I would be in"
     },
     %Youtex.Transcript.Sentence{...},
     ...
   ],
   url: "https://www.youtube.com/api/timedtext..."
 }}

If you don't need to pattern match {:ok, data} and {:error, reason}, there are also trailing bang versions for every function.

About

Elixir's library for fetching video transcriptions from YouTube 👓

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages