tribler.core.content_discovery.payload ====================================== .. py:module:: tribler.core.content_discovery.payload Classes ------- .. autoapisummary:: tribler.core.content_discovery.payload.HealthRequestPayload tribler.core.content_discovery.payload.HealthFormat tribler.core.content_discovery.payload.HealthPayload tribler.core.content_discovery.payload.VersionRequest tribler.core.content_discovery.payload.VersionResponse tribler.core.content_discovery.payload.RemoteSelectPayload tribler.core.content_discovery.payload.SelectResponsePayload Module Contents --------------- .. py:class:: HealthRequestPayload Bases: :py:obj:`ipv8.messaging.lazy_payload.VariablePayload` A request to be sent the health information of torrents. .. py:attribute:: msg_id :value: 3 .. py:attribute:: format_list :value: ['B'] .. py:attribute:: names :value: ['request_type'] .. py:attribute:: request_type :type: int .. py:class:: HealthFormat Bases: :py:obj:`ipv8.messaging.lazy_payload.VariablePayload` A payload for torrent health information. .. py:attribute:: format_list :value: ['20s', 'I', 'I', 'Q', 'varlenHutf8'] .. py:attribute:: names :value: ['infohash', 'seeders', 'leechers', 'timestamp', 'tracker'] .. py:attribute:: infohash :type: bytes .. py:attribute:: seeders :type: int .. py:attribute:: leechers :type: int .. py:attribute:: timestamp :type: int .. py:attribute:: tracker :type: str .. py:class:: HealthPayload Bases: :py:obj:`ipv8.messaging.lazy_payload.VariablePayload` A payload for a list of torrent health information. .. py:attribute:: msg_id :value: 4 .. py:attribute:: format_list .. py:attribute:: names :value: ['response_type', 'torrents', 'extra_bytes'] .. py:attribute:: response_type :type: int .. py:attribute:: torrents :type: list[HealthFormat] .. py:method:: create(request_type: int, health_infos: list[tribler.core.torrent_checker.healthdataclasses.HealthInfo]) -> Self :classmethod: Create a payload from the given list. .. py:method:: get_health_info() -> list[tribler.core.torrent_checker.healthdataclasses.HealthInfo] Gets the list of HealthInfo objects. .. py:class:: VersionRequest Bases: :py:obj:`ipv8.messaging.lazy_payload.VariablePayload` A request for the Tribler version and Operating System of a peer. .. py:attribute:: msg_id :value: 101 .. py:class:: VersionResponse Bases: :py:obj:`ipv8.messaging.lazy_payload.VariablePayload` A response to a request for Tribler version and OS. .. py:attribute:: msg_id :value: 102 .. py:attribute:: format_list :value: ['varlenI', 'varlenI'] .. py:attribute:: names :value: ['version', 'platform'] .. py:attribute:: version :type: str .. py:attribute:: platform :type: str .. py:method:: fix_pack_version(value: str) -> bytes Convert the (utf-8) Tribler version string to bytes. .. py:method:: fix_pack_platform(value: str) -> bytes Convert the (utf-8) platform description string to bytes. .. py:method:: fix_unpack_version(value: bytes) -> str :classmethod: Convert the packed Tribler version back to a string. .. py:method:: fix_unpack_platform(value: bytes) -> str :classmethod: Convert the packed platform description back to a string. .. py:class:: RemoteSelectPayload Bases: :py:obj:`ipv8.messaging.lazy_payload.VariablePayload` A payload to sent SQL queries to other peers. .. py:attribute:: msg_id :value: 201 .. py:attribute:: format_list :value: ['I', 'varlenH'] .. py:attribute:: names :value: ['id', 'json'] .. py:attribute:: id :type: int .. py:attribute:: json :type: bytes .. py:class:: SelectResponsePayload Bases: :py:obj:`ipv8.messaging.lazy_payload.VariablePayload` A response to a select request. .. py:attribute:: msg_id :value: 202 .. py:attribute:: format_list :value: ['I', 'raw'] .. py:attribute:: names :value: ['id', 'raw_blob'] .. py:attribute:: id :type: int .. py:attribute:: raw_blob :type: bytes