vishap package

vishap.base module

class vishap.base.BaseVideoPlugin[source]

Bases: object

Base video plugin.

description = None
embed_code = None
height_param_code = 'height="{height}"'
id_pattern = None
match(url)[source]

Check if URL matches the pattern.

Parameters:url (str) –
Return bool:
name = None
render(url, width=None, height=None)[source]

Renders the HTML code of embed video based on from URL given.

Parameters:
  • url (str) –
  • width (int) –
  • height (int) –
Return str:
thumbnail_pattern = None
uid = None
url_pattern = None
width_param_code = 'width="{width}"'

vishap.utils module

vishap.utils.render_video(url, width=None, height=None, plugin_uid=None)[source]

Renders the video.

Parameters:
  • url (str) –
  • width (int) –
  • height (int) –
  • plugin_uid (str) – Preferred plugin to render to video.
Return str:

Returns empty string on failure.

vishap.utils.ensure_autodiscover()[source]

Ensures that plugins are autodiscovered.

vishap.utils.get_registered_plugins()[source]

Gets a list of registered plugins in a form if tuple (plugin name, plugin description). If not yet autodiscovered, autodiscovers them.

Return list:
vishap.utils.get_registered_plugin_uids()[source]

Gets a list of registered plugins in a form if tuple (plugin name, plugin description). If not yet autodiscovered, autodiscovers them.

Return list: