Table Of Contents

Previous topic

Download Feeds

Next topic

File System

Download Configuration

Download configuration object

The download configuration is a singleton used to store the downloader preferences.

Global config

DownloadConfiguration
max_downloading_tasks int

max concurrent download tasks

download_dir string

the default path where downloads will be stored (base64 encoded)

watch_dir string

special folder that will be monitored. When a new supported file (.nzb, .torrent) is copied in that folder, the task is automatically added to the download queue.

(base64 encoded)

use_watch_dir bool

if set to false, the watch_dir will not be monitored

throttling DlThrottlingConfig

throttling configuration

news DlNewsConfig

newsgroups configuration

bt DlBtConfig

bittorrent configuration

feed DlFeedConfig

RSS feed configuration

blocklist DlBlockListConfig

block list configuration

Throttling config

DlThrottlingConfig
normal DlRate

download rate for normal time slot (in B/s)

slow DlRate

download rate for normal slow slot (in B/s)

schedule enum[168]

The schedule array represent the list of week hours timeslot, starting on monday a midnight. Therefore the complete week is represented in a array of 168 elements (24 * 7)

Each slot can have the following value:

Type Description
normal downloads will use normal DlRate config for this timeslot
slow downloads will use slow DlRate config for this timeslot
hibernate downloads will be paused for this timeslot
mode enum

Throttling mode can have to following values

Type Description
normal force use of normal rate limits (not using the scheduler)
slow force use of slow rate limits (not using the scheduler)
hibernate force hibernate (not using the scheduler)
schedule use scheduded rate limit
DlRate
tx_rate int

maximum transmit rate (in byte/s) 0 means no limit

rx_rate int

maximum receive rate (in byte/s) 0 means no limit

Newsgroups config

DlNewsConfig
server string

NNTP server hostname

port int

NNTP server port

ssl bool

Use SSL to connect to server if set to true

user string

NNTP auth username (can be empty if no auth is required)

password string Write-only

NNTP auth password (can be empty if no auth is required)

nthreads int

maximum concurrent connections to the NNTP server

auto_repair bool

automatically check and repair downloaded files using the provided par2 files

lazy_par2 bool

if set to true the downloader will download the par2 files only if the download is corrupted

auto_extract bool

automatically attempt to extract downloaded files

erase_tmp bool

if auto_extract is enabled, delete archive files once successfully extracted

Bittorrent config

DlBtConfig
max_peers int

maximum number of peers at a given time

stop_ratio int

default stop_ratio for bt Download tasks

This value is scaled by a factor 100, for instance a stop_ratio of 200 means that the task will stop once tx_bytes = 2 * size

A value of 0 means that the task will continue seeding until it is manually stopped

crypto_support enum

The crypto_support can have the following values

Type Description
unsupported will never use bittorrent crypto
allowed will select plain during handshake
preferred will select crypto during handshake
required will allow plain bittorrent
enable_dht bool

enable the dht protocol

enable_pex bool

enable the peer exchange protocol

announce_timeout int

timeout in seconds for announcing to tracker

main_port int

main bittorrent port

dht_port int

bittorrent dht port

Rss Feeds config

DlFeedConfig
fetch_interval int

interval between automatic RSS refresh (in minutes)

max_items int

maximum feed item to keep

BlockList config

DlBlockListConfig
sources[] string

list of block list URL source

The block list should be in cidr format

e.g.: http://list.iblocklist.com/?list=bt_level1&fileformat=cidr&archiveformat=

Get the current Download configuration

GET /api/v3/downloads/config/

Returns the current DownloadConfiguration

Example request:

GET /api/v3/downloads/config/ HTTP/1.1
Host: mafreebox.freebox.fr

Example response:

HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
{
    "success": true,
    "result": {
       "feed": {
           "max_items": 0,
           "fetch_interval": 60
       },
       "use_watch_dir": true,
       "watch_dir": "L0Rpc3F1ZSBkdXIvLnF1ZXVl", /* /Disque dur/.queue */
       "news": {
           "user": "",
           "erase_tmp": true,
           "port": 119,
           "nthreads": 1,
           "auto_repair": true,
           "ssl": false,
           "auto_extract": true,
           "lazy_par2": true,
           "server": "news.free.fr"
       },
       "bt": {
           "max_peers": 50,
           "stop_ratio": 150,
           "crypto_support": "allowed"
       },
       "max_downloading_tasks": 5,
       "download_dir": "L0Rpc3F1ZSBkdXIvVMOpbMOpY2hhcmdlbWVudHMv", /* /Disque dur/Téléchargements/ */
       "throttling": {
           "normal": {
               "rx_rate": 0,
               "tx_rate": 0
           },
           "slow": {
               "rx_rate": 512,
               "tx_rate": 42
           },
           "schedule": [
               "slow",
               "normal",
               "normal",

                [ ... ]

               "normal",
               "normal",
               "normal",
               "slow"
           ],
           "mode": "normal"
       }
   }
}

Update the Download configuration

PUT /api/v3/downloads/config/

Updates the DownloadConfiguration

Example request:

PUT /api/v3/downloads/config/ HTTP/1.1
Host: mafreebox.freebox.fr

{
    "throttling": {
        "normal": {
            "rx_rate": 512,
            "tx_rate": 40
        },
        "slow": {
            "rx_rate": 128,
            "tx_rate": 10
        },
        "mode": "normal",
        "schedule": [
            "slow",
            "normal",
            "normal",

            [ ... ]

            "normal",
            "normal",
            "normal",
            "normal",
            "slow"
        ]
    },
    "max_downloading_tasks": 5,
    "download_dir": "L0Rpc3F1ZSBkdXIvVMOpbMOpY2hhcmdlbWVudHMv", /* /Disque dur/Téléchargements/ */
    "use_watch_dir": true,
    "watch_dir": "L0Rpc3F1ZSBkdXIvLnF1ZXVl", /* /Disque dur/.queue */
    "news": {
        "server": "news.free.fr",
        "port": "119",
        "ssl": false,
        "nthreads": 1,
        "user": "",
        "lazy_par2": true,
        "auto_repair": true,
        "auto_extract": true,
        "erase_tmp": true
    },
    "bt": {
        "max_peers": 50,
        "stop_ratio": 150,
        "crypto_support": "allowed"
    },
    "feed": {
        "fetch_interval": 60
    }
}

Example response:

HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
{
    "success": true,
    "result": {
        "feed": {
            "max_items": 0,
            "fetch_interval": 60
        },
        "use_watch_dir": true,
        "watch_dir": "L0Rpc3F1ZSBkdXIvLnF1ZXVl", /* /Disque dur/.queue */
        "news": {
            "user": "",
            "erase_tmp": true,
            "port": 119,
            "nthreads": 1,
            "auto_repair": true,
            "ssl": false,
            "auto_extract": true,
            "lazy_par2": true,
            "server": "news.free.fr"
        },
        "bt": {
            "max_peers": 50,
            "stop_ratio": 150,
            "crypto_support": "allowed"
        },
        "max_downloading_tasks": 5,
        "download_dir": "L0Rpc3F1ZSBkdXIvVMOpbMOpY2hhcmdlbWVudHMv", /* /Disque dur/Téléchargements/ */
        "throttling": {
            "normal": {
                "rx_rate": 512,
                "tx_rate": 40
            },
            "slow": {
                "rx_rate": 128,
                "tx_rate": 10
            },
            "schedule": [
                "slow",
                "normal",
                "normal",
                "normal",

                [ ... ]

                "normal",
                "normal",
                "normal",
                "slow"
            ],
            "mode": "normal"
        }
    }

}

Updating the current Throttling mode

PUT /api/v3/downloads/throttling

You can force the throttling mode using this method. You can use any of the throttling modes defined in DlThrottlingConfig. Setting to schedule will automatically set correct throttling mode. Other values will force the throttling mode until you set it back to schedule.

Example request:

PUT /api/v3/downloads/throttling HTTP/1.1
Host: mafreebox.freebox.fr

{
    throttling: "slow"
}

Example response:

HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
{
    "success": true,
    "result": {
        "is_scheduled": false,
        "throttling": "slow"
    }
}