woob.capabilities.video

class BaseVideo(id='', url=NotLoaded, backend=None)[source]

Bases: BaseImage

Represents a video.

This object has to be inherited to specify how to calculate the URL of the video from its ID.

Variables:
  • url – (str) url

  • title – (str) File title

  • ext – (str) File extension

  • author – (str) File author

  • description – (str) File description

  • date – (date, datetime) File publication date

  • size – (int) File size in bytes (default: Not available)

  • rating – (int, float) Rating (default: Not available)

  • rating_max – (int, float) Maximum rating (default: Not available)

  • license – (str) License name

  • nsfw – (bool) Is this Not Safe For Work (default: False)

  • thumbnail – (Thumbnail) Thumbnail of the image

  • data – (bytes) Data of image

  • duration – (timedelta) file duration

class CapVideo[source]

Bases: CapImage

Video file provider.

search_videos(pattern, sortby=CapImage.SEARCH_RELEVANCE, nsfw=False)[source]

search for a video file

Parameters:
  • pattern (str) – pattern to search on

  • sortby – sort by… (use SEARCH_* constants) (default: CapImage.SEARCH_RELEVANCE)

  • nsfw (bool) – include non-suitable for work videos if True (default: False)

Return type:

iter[BaseVideo]

get_video(_id)[source]

Get a video file from an ID.

Parameters:

_id (str) – video file ID

Return type:

BaseVideo or None is fot found.