woob.capabilities.torrent

class woob.capabilities.torrent.CapTorrent

Bases: woob.capabilities.base.Capability

Torrent trackers.

get_torrent(_id)

Get a torrent object from an ID.

Parameters

_id (str) – ID of torrent

Return type

Torrent

get_torrent_file(_id)

Get the content of the .torrent file.

Parameters

_id (str) – ID of torrent

Return type

bytes

iter_torrents(pattern)

Search torrents and iterate on results.

Parameters

pattern (str) – pattern to search

Return type

iter[Torrent]

exception woob.capabilities.torrent.MagnetOnly(magnet)

Bases: woob.capabilities.base.UserError

Raised when trying to get URL to torrent but only magnet is available.

class woob.capabilities.torrent.Torrent(id='', url=NotLoaded, backend=None)

Bases: woob.capabilities.base.BaseObject

Torrent object.

Variables
  • name – (str) Name of torrent

  • size – (float) Size of torrent

  • date – (date, datetime) Date when torrent has been published

  • magnet – (str) URI of magnet

  • seeders – (int, int) Number of seeders

  • leechers – (int, int) Number of leechers

  • files – (list) Files in torrent

  • description – (str) Description of torrent

  • filename – (str) Name of .torrent file