woob.capabilities.file

class woob.capabilities.file.BaseFile(id='', url=NotLoaded, backend=None)

Bases: woob.capabilities.base.BaseObject

Represent a file.

Variables
  • title – (str) File title

  • ext – (str) File extension

  • author – (str) File author

  • description – (str) File description

  • size – (int, int) File size in bytes (default: NotAvailable)

  • rating – (int, int, float) Rating (default: NotAvailable)

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

  • license – (str) License name

date = <woob.capabilities.date.DateField object>
classmethod id2url(_id)

Overloaded in child classes provided by backends.

property page_url

Get file page URL

class woob.capabilities.file.CapFile

Bases: woob.capabilities.base.Capability

Provide file download

SEARCH_DATE = 3
SEARCH_RATING = 1
SEARCH_RELEVANCE = 0
SEARCH_VIEWS = 2
get_file(_id)

Get a file from an ID

Parameters

_id (str) – the file id. I can be a numeric ID, or a page url

Return type

BaseFile or None if not found.

search_file(pattern, sortby=0)
Parameters
  • pattern (str) – pattern to search on

  • sortby – sort by … (user SEARCH_* constants)

Return type

iter[BaseFile]