Skip to content

ccmikechen/videx

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Build status Videx version Hex.pm Inline docs

Videx

Videx is a simple video url parser for parsing and generating video urls.

Usage

Parse Youtube video url.

Videx.parse("https://www.youtube.com/watch?v=Hh9yZWeTmVM")
# %Videx.Youtube{id: "Hh9yZWeTmVM", params: %{}, type: :long}

Generate Youtube video url.

video = %Videx.Youtube{id: "Hh9yZWeTmVM"}
Videx.Youtube.generate(video, :long)
# "https://www.youtube.com/watch?v=Hh9yZWeTmVM"

Here is how you can convert Youtube video url to another format.

"https://www.youtube.com/watch?v=Hh9yZWeTmVM"
|> Videx.parse()
|> Videx.Youtube.generate(:short)
# "https://youtu.be/Hh9yZWeTmVM"

Installation

Add Videx to your mix.exs:

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

After that, run mix deps.get.

Features

Current Features or To-Do

License

Videx is under MIT license. Check the LICENSE file for more details.

About

An Elixir video url parser.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages