woob.capabilities.gallery

class woob.capabilities.gallery.BaseGallery(_id, title=NotLoaded, url=NotLoaded, cardinality=NotLoaded, date=NotLoaded, rating=NotLoaded, rating_max=NotLoaded, thumbnail=NotLoaded, thumbnail_url=None, nsfw=False)

Bases: woob.capabilities.base.BaseObject

Represents a gallery.

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

Variables
  • title – (str) Title of gallery

  • description – (str) Description of gallery

  • cardinality – (int, int) Cardinality of gallery

  • date – (date, datetime) Date of gallery

  • rating – (float) Rating of this gallery

  • rating_max – (float) Max rating available

  • thumbnail – (Thumbnail) Thumbnail

classmethod id2url(_id)

Overloaded in child classes provided by backends.

iter_image()

Iter images.

property page_url

Get URL to page of this gallery.

class woob.capabilities.gallery.BaseImage(_id='', index=None, thumbnail=NotLoaded, url=NotLoaded, ext=NotLoaded, gallery=None)

Bases: woob.capabilities.image.BaseImage

Base class for images.

Variables
class woob.capabilities.gallery.CapGallery

Bases: woob.capabilities.base.Capability

This capability represents the ability for a website backend to provide videos.

SEARCH_DATE = 3
SEARCH_RATING = 1
SEARCH_RELEVANCE = 0
SEARCH_VIEWS = 2

Get gallery from an ID.

Parameters

_id (str) – the gallery id. It can be a numeric ID, or a page url, or so.

Return type

Gallery

Iterate images from a Gallery.

Return type

iter(BaseImage)

search_galleries(pattern, sortby=0)

Iter results of a search on a pattern.

Parameters
  • pattern (str) – pattern to search on

  • sortby (SEARCH_*) – sort by…

Return type

BaseGallery