Programmation

April 19, 2026 ยท View on GitHub

A new feature allow you to schedule ydl_dlp executions. This feature requires redis.

The daemon runs at the interval (in seconds) defined in _programmation_interval within its own worker.

To disable this feature you can simple remove the corresponding block in the workers.ini file.

Three use cases:

  • Continuously download a livestream when it's available
  • Archive a channel at given hours
  • Schedule a download at a precise date for a precise duration

Representation

Here what a programmation object looks like in database :

{
  "id": "string (generated)",
  "url": "string",
  "user_token": "string (null)",
  "enabled": "bool (true)",
  "planning": {
    "recording_start_date": "string date : YYYY-MM-DD hh:mm (null)",
    "recording_duration": "int > 0 (null)",
    "recording_stops_at_end": "bool (false)",
    "recording_restarts_during_duration": "bool (true)",
    "recurrence_cron": "string (null)",
    "recurrence_start_date": "string date : YYYY-MM-DD hh:mm (null)",
    "recurrence_end_date": "string date : YYYY-MM-DD hh:mm (null)"
  },
  "presets": [
    "string"
  ],
  "extra_parameters": {}
}

Fields:

  • id : generated by the api
  • url : url to download, it will not be checked
  • user_token : unused if the _allow_programmation is not explicitly set at true in the user config
  • enabled : if false, the programmation will be ignored
  • planning.recording_start_date
  • planning.recording_duration : how many minutes recording is supposed to long
  • planning.recording_stops_at_end : if true, the download will be force stopped when recording_duration is reached
  • planning.recording_restarts_during_duration : if False, the download will not be restarted if stopped before recording_duration
  • planning.recurrence_cron : same cron as linux
  • planning.recurrence_start_date : useful only if recurrence_cron is used
  • planning.recurrence_end_date : useful only if recurrence_cron is used
  • presets : list of presets names, you must use presets already defined in params.ini
  • extra_parameters : an arbitrary object of parameters you can use to store information or directives to use in hooks

Notes:

  • recording_start_date and recurrence_cron cannot be used at the same type
  • if recording_duration is set, the download will be relaunched automatically if stopped during the interval

Reliability

The launch hours are not perfectly exact and have an error range of 1 minute

Examples of minimal configurations

Continuous download

{
  "url": "string"
}

Continuous download with preset

{
  "url": "string",
  "presets": [
    "HD"
  ],
  "planning": {
    "recurrence_end_date": "2026-05-14 16:44"
  }
}

Continuous download end date

{
  "url": "string",
  "presets" : ["HD"]
}

Archiving execution

{
  "url": "string",
  "planning": {
    "recurrence_cron": "00 01 * * *"
  }
}

Special program

Every day in December from 13:00 to 14:00

{
  "url": "string",
  "planning": {
    "recording_duration": 60,
    "recording_stops_at_end": true,
    "recurrence_cron": "00 13 * * *",
    "recurrence_start_date": "2022-12-01 00:00",
    "recurrence_end_date": "2022-12-31 23:00"
  }
}

One time special program

Will last at least 4 hours

{
  "url": "string",
  "planning": {
    "recording_start_date": "2022-12-31 22:00",
    "recording_duration": 240
  }
}

Programmation with extra parameters

{
  "url": "string",
  "planning": {
    "recurrence_cron": "00 * * * *"
  },
  "extra_parameters": {
    "notification_level": "critical",
    "video_description": "Josephine Ange Gardien - 25th anniversary epic trailer"
  }
}

Programmation API

# Get programmations in database
GET {{host}}/programmation?token=user_token

# Add a new programmation
POST {{host}}/programmation?url=an_added_url&token=user_token

{
  "id" : "you_can_chose_the_id" // optional : will be generated if not provided
  "planning": {
    "recording_duration": 60,
    "recurrence_cron": "00 12 * * *"
  }
} 

# Update a programmation
PUT {{host}}/programmation/<id>

{
  "planning": {
    "recurrence_end_date" : "2022-12-31 00:00"
  }
}

# Delete a programmation by ID
DELETE {{host}}/programmation/<ID>

# Delete all programmations for the URL
DELETE {{host}}/programmation?url=url

API return

Example of api return :

{
  "id": "c2a76180-cf26-4b3d-9b9c-a8df2fa7d5f2",
  "url": "video_url",
  "user_token": null,
  "enabled": true,
  "presets": null,
  "planning": {
    "recording_start_date": null,
    "recording_duration": null,
    "recording_stops_at_end": false,
    "recording_restarts_during_duration": true,
    "recurrence_cron": "25 10 * * *",
    "recurrence_start_date": null,
    "recurrence_end_date": null
  },
  "extra_parameters": {
    "send_notification": false
  }
}