Settings

class Tribler.Core.Modules.restapi.settings_endpoint.SettingsEndpoint(session)[source]

This endpoint is reponsible for handing all requests regarding settings and configuration.

parse_setting(section, option, value)[source]

Set a specific Tribler setting. Throw a ValueError if this setting is not available.

parse_settings_dict(settings_dict, depth=1, root_key=None)[source]

Parse the settings dictionary.

render_GET(request)[source]
GET /settings

A GET request to this endpoint returns all the session settings that can be found in Tribler. It also returns the runtime-determined ports, i.e. the port for the video server. Please note that a port with a value of -1 in the settings means that the port is randomly assigned at startup.

Example request:

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

Example response:

{
    "settings": {
        "libtorrent": {
            "anon_listen_port": -1,
            ...
        },
        ...
    }
}
render_POST(request)[source]
POST /settings

A POST request to this endpoint will update Tribler settings. A JSON-dictionary should be passed as body contents.

Example request:

curl -X POST http://localhost:8085/settings --data "{"

Example response:

{
    "modified": True
}