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_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.
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