woob.capabilities.torrent

exception MagnetOnly(magnet)[source]

Bases: UserError

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

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

Bases: BaseObject

Torrent object.

Variables:
  • url – (str) url

  • 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) Number of seeders

  • leechers – (int) Number of leechers

  • files – (list) Files in torrent

  • description – (str) Description of torrent

  • filename – (str) Name of .torrent file

class CapTorrent[source]

Bases: Capability

Torrent trackers.

iter_torrents(pattern)[source]

Search torrents and iterate on results.

Parameters:

pattern (str) – pattern to search

Return type:

iter[Torrent]

get_torrent(_id)[source]

Get a torrent object from an ID.

Parameters:

_id (str) – ID of torrent

Return type:

Torrent

get_torrent_file(_id)[source]

Get the content of the .torrent file.

Parameters:

_id (str) – ID of torrent

Return type:

bytes