Events

class Tribler.Core.Modules.restapi.events_endpoint.EventsEndpoint(session)[source]
Important events in Tribler are returned over the events endpoint. This connection is held open. Each event is pushed over this endpoint in the form of a JSON dictionary. Each JSON dictionary contains a type field that indicates the type of the event. Individual events are separated by a newline character (

).

Currently, the following events are implemented:

  • events_start: An indication that the event socket is opened and that the server is ready to push events. This includes information about whether Tribler has started already or not and the version of Tribler used.
  • search_result_channel: This event dictionary contains a search result with a channel that has been found.
  • search_result_torrent: This event dictionary contains a search result with a torrent that has been found.
  • upgrader_started: An indication that the Tribler upgrader has started.
  • upgrader_finished: An indication that the Tribler upgrader has finished.
  • upgrader_tick: An indication that the state of the upgrader has changed. The dictionary contains a human-readable string with the new state.
  • watch_folder_corrupt_torrent: This event is emitted when a corrupt .torrent file in the watch folder is found. The dictionary contains the name of the corrupt torrent file.
  • new_version_available: This event is emitted when a new version of Tribler is available.
  • tribler_started: An indicator that Tribler has completed the startup procedure and is ready to use.
  • channel_discovered: An indicator that Tribler has discovered a new channel. The event contains the name, description and dispersy community id of the discovered channel.
  • torrent_discovered: An indicator that Tribler has discovered a new torrent. The event contains the infohash, name, list of trackers, list of files with name and size, and the dispersy community id of the discovered torrent.
  • torrent_removed_from_channel: An indicator that a torrent has been removed from a channel. The event contains the infohash and the dispersy id of the channel which contained the removed torrent.
  • torrent_finished: A specific torrent has finished downloading. The event includes the infohash and name of the torrent that has finished downloading.
  • torrent_error: An error has occurred during the download process of a specific torrent. The event includes the infohash and a readable string of the error message.
  • tribler_exception: An exception has occurred in Tribler. The event includes a readable string of the error.
  • market_ask: Tribler learned about a new ask in the market. The event includes information about the ask.
  • market_bid: Tribler learned about a new bid in the market. The event includes information about the bid.
  • market_ask_timeout: An ask has expired. The event includes information about the ask.
  • market_bid_timeout: An bid has expired. The event includes information about the bid.
  • market_transaction_complete: A transaction has been completed in the market. The event contains the transaction that was completed.
  • market_payment_received: We received a payment in the market. The events contains the payment information.
  • market_payment_sent: We sent a payment in the market. The events contains the payment information.
  • market_iom_input_required: The Internet-of-Money modules requires user input (like a password or challenge response).
render_GET(request)[source]
GET /events

A GET request to this endpoint will open the event connection.

Example request:

curl -X GET http://localhost:8085/events