Skip to content

phewera/videoembed

Repository files navigation

python python python python python main

videoembed

Videoembed is a tool to create embed codes from video URLs by using oembed. You are also able to get thumbnail data.

Supported platforms:

  • YouTube
  • Vimeo

Installation

Use the package manager pip to install videoembed.

pip install videoembed

Usage

Basic usage:

from videoembed import Embedder

embedder = Embedder()
video = embedder('https://www.youtube.com/watch?v=VIDEOID')

# get embed code
embed_code = video.embed_code

# get thumbnail data
thumbnail = video.thumbnail

You can also pass some configuration data to the embedder:

from videoembed import Embedder

config = {
    'width': 600,
    'height': 360,
    'autoplay': True
}
embedder = Embedder(**config)

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.