weboob.capabilities.file

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

Bases: weboob.capabilities.base.BaseObject

Represent a file.
Variables:
  • title – (unicode) File title
  • ext – (unicode) File extension
  • author – (unicode) File author
  • description – (unicode) File description
  • date – (date, datetime) File publication date
  • size – (int, long) File size in bytes (default: NotAvailable)
  • rating – (int, long, float) Rating (default: NotAvailable)
  • rating_max – (int, long, float) Maximum rating (default: NotAvailable)
  • license – (unicode) License name
classmethod id2url(_id)

Overloaded in child classes provided by backends.

page_url

Get file page URL

class weboob.capabilities.file.CapFile

Bases: weboob.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]