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. Throws an error if the options dictionary seems to be invalid (i.e. there are keys not available in the configuration or the depth of the dictionary is too high.

render_GET(request)[source]
GET /settings

A GET request to this endpoint returns all the session settings that can be found in Tribler. Please note that a port with a value of -1 means that the port is randomly assigned at startup.

Example request:

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

Example response:

{
    "settings": {
        "barter_community": {
            "enabled": false
        },
        "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
}