tribler.core.content_discovery.payload

Classes

HealthRequestPayload

A request to be sent the health information of torrents.

HealthFormat

A payload for torrent health information.

HealthPayload

A payload for a list of torrent health information.

VersionRequest

A request for the Tribler version and Operating System of a peer.

VersionResponse

A response to a request for Tribler version and OS.

RemoteSelectPayload

A payload to sent SQL queries to other peers.

SelectResponsePayload

A response to a select request.

Module Contents

class tribler.core.content_discovery.payload.HealthRequestPayload

Bases: ipv8.messaging.lazy_payload.VariablePayload

A request to be sent the health information of torrents.

msg_id = 3
format_list = ['B']
names = ['request_type']
request_type: int
class tribler.core.content_discovery.payload.HealthFormat

Bases: ipv8.messaging.lazy_payload.VariablePayload

A payload for torrent health information.

format_list = ['20s', 'I', 'I', 'Q', 'varlenHutf8']
names = ['infohash', 'seeders', 'leechers', 'timestamp', 'tracker']
infohash: bytes
seeders: int
leechers: int
timestamp: int
tracker: str
class tribler.core.content_discovery.payload.HealthPayload

Bases: ipv8.messaging.lazy_payload.VariablePayload

A payload for a list of torrent health information.

msg_id = 4
format_list
names = ['response_type', 'torrents', 'extra_bytes']
response_type: int
torrents: list[HealthFormat]
classmethod create(request_type: int, health_infos: list[tribler.core.torrent_checker.healthdataclasses.HealthInfo]) Self

Create a payload from the given list.

get_health_info() list[tribler.core.torrent_checker.healthdataclasses.HealthInfo]

Gets the list of HealthInfo objects.

class tribler.core.content_discovery.payload.VersionRequest

Bases: ipv8.messaging.lazy_payload.VariablePayload

A request for the Tribler version and Operating System of a peer.

msg_id = 101
class tribler.core.content_discovery.payload.VersionResponse

Bases: ipv8.messaging.lazy_payload.VariablePayload

A response to a request for Tribler version and OS.

msg_id = 102
format_list = ['varlenI', 'varlenI']
names = ['version', 'platform']
version: str
platform: str
fix_pack_version(value: str) bytes

Convert the (utf-8) Tribler version string to bytes.

fix_pack_platform(value: str) bytes

Convert the (utf-8) platform description string to bytes.

classmethod fix_unpack_version(value: bytes) str

Convert the packed Tribler version back to a string.

classmethod fix_unpack_platform(value: bytes) str

Convert the packed platform description back to a string.

class tribler.core.content_discovery.payload.RemoteSelectPayload

Bases: ipv8.messaging.lazy_payload.VariablePayload

A payload to sent SQL queries to other peers.

msg_id = 201
format_list = ['I', 'varlenH']
names = ['id', 'json']
id: int
json: bytes
class tribler.core.content_discovery.payload.SelectResponsePayload

Bases: ipv8.messaging.lazy_payload.VariablePayload

A response to a select request.

msg_id = 202
format_list = ['I', 'raw']
names = ['id', 'raw_blob']
id: int
raw_blob: bytes