Skip to content

ytdl-sub

Description / nameInput element
Your domain name

Overview

ytdl-sub is a lightweight tool to automate downloading and metadata generation with yt-dlp. It uses YAML files to define subscriptions and prepares media for popular media players like Plex, Jellyfin, Kodi, and Emby.


Deployment

sb install sandbox-ytdl-sub

Usage

Visit https://ytdl-sub.iYOUR_DOMAIN_NAMEi.

Basics

The role supports two image types configurable via inventory:

  • GUI Mode (ytdl_sub_image_type: "gui"): Web-based VS Code interface for full management
  • Headless Mode (ytdl_sub_image_type: "headless"): Command-line focused, lightweight deployment (default)

Configure your subscriptions using YAML files in the config directory.

Role Defaults

Use the Inventory to customize variables. (1)

  1. Example override

    ytdl_sub_name: "custom_value"
    

    Avoid overriding variables ending in _default

    When overriding variables that end in _default (like ytdl_sub_docker_envs_default), you replace the entire default configuration. Future updates that add new default values will not be applied to your setup, potentially breaking functionality.

    Instead, use the corresponding _custom variable (like ytdl_sub_docker_envs_custom) to add your changes. Custom values are merged with defaults, ensuring you receive updates.

ytdl_sub_name
# Type: string
ytdl_sub_name: ytdl-sub
ytdl_sub_role_cron_schedule
# Type: string
ytdl_sub_role_cron_schedule: "0 */6 * * *"
ytdl_sub_role_cron_on_start
# Type: string
ytdl_sub_role_cron_on_start: "true"
ytdl_sub_role_image_type
# Type: string
ytdl_sub_role_image_type: "headless"
ytdl_sub_role_web_subdomain
# Type: string
ytdl_sub_role_web_subdomain: "{{ ytdl_sub_name }}"
ytdl_sub_role_web_domain
# Type: string
ytdl_sub_role_web_domain: "{{ user.domain }}"
ytdl_sub_role_web_port
# Type: string
ytdl_sub_role_web_port: "8080"
ytdl_sub_role_web_url
# Type: string
ytdl_sub_role_web_url: "{{ 'https://' + (lookup('role_var', '_web_subdomain', role='ytdl_sub') + '.' + lookup('role_var', '_web_domain', role='ytdl_sub')
                        if (lookup('role_var', '_web_subdomain', role='ytdl_sub') | length > 0)
                        else lookup('role_var', '_web_domain', role='ytdl_sub')) }}"
ytdl_sub_role_dns_record
# Type: string
ytdl_sub_role_dns_record: "{{ lookup('role_var', '_web_subdomain', role='ytdl_sub') }}"
ytdl_sub_role_dns_zone
# Type: string
ytdl_sub_role_dns_zone: "{{ lookup('role_var', '_web_domain', role='ytdl_sub') }}"
ytdl_sub_role_dns_proxy
# Type: bool (true/false)
ytdl_sub_role_dns_proxy: "{{ dns_proxied }}"
ytdl_sub_role_traefik_sso_middleware
# Type: string
ytdl_sub_role_traefik_sso_middleware: "{{ traefik_default_sso_middleware }}"
ytdl_sub_role_traefik_middleware_default
# Type: string
ytdl_sub_role_traefik_middleware_default: "{{ traefik_default_middleware }}"
ytdl_sub_role_traefik_middleware_custom
# Type: string
ytdl_sub_role_traefik_middleware_custom: ""
ytdl_sub_role_traefik_certresolver
# Type: string
ytdl_sub_role_traefik_certresolver: "{{ traefik_default_certresolver }}"
ytdl_sub_role_traefik_enabled
# Type: bool (true/false)
ytdl_sub_role_traefik_enabled: true
ytdl_sub_role_traefik_api_enabled
# Type: bool (true/false)
ytdl_sub_role_traefik_api_enabled: false
ytdl_sub_role_traefik_api_endpoint
# Type: string
ytdl_sub_role_traefik_api_endpoint: ""

Container

ytdl_sub_role_docker_container
# Type: string
ytdl_sub_role_docker_container: "{{ ytdl_sub_name }}"

Image

ytdl_sub_role_docker_image_pull
# Type: bool (true/false)
ytdl_sub_role_docker_image_pull: true
ytdl_sub_role_docker_image_repo
# Type: string
ytdl_sub_role_docker_image_repo: "{{ 'ghcr.io/jmbannon/ytdl-sub-gui' if lookup('role_var', '_image_type', role='ytdl_sub') == 'gui' else 'ghcr.io/jmbannon/ytdl-sub' }}"
ytdl_sub_role_docker_image_tag
# Type: string
ytdl_sub_role_docker_image_tag: "{{ 'latest' if lookup('role_var', '_image_type', role='ytdl_sub') == 'gui' else 'ubuntu-latest' }}"
ytdl_sub_role_docker_image
# Type: string
ytdl_sub_role_docker_image: "{{ lookup('role_var', '_docker_image_repo', role='ytdl_sub') }}:{{ lookup('role_var', '_docker_image_tag', role='ytdl_sub') }}"

Envs

ytdl_sub_role_docker_envs_default
# Type: dict
ytdl_sub_role_docker_envs_default:
  PUID: "{{ uid }}"
  PGID: "{{ gid }}"
  TZ: "{{ tz }}"
  CRON_SCHEDULE: "{{ lookup('role_var', '_cron_schedule', role='ytdl_sub') }}"
  CRON_RUN_ON_START: "{{ lookup('role_var', '_cron_on_start', role='ytdl_sub') }}"
ytdl_sub_role_docker_envs_custom
# Type: dict
ytdl_sub_role_docker_envs_custom: {}

Volumes

ytdl_sub_role_docker_volumes_default
# Type: list
ytdl_sub_role_docker_volumes_default:
  - "{{ lookup('role_var', '_paths_location', role='ytdl_sub') }}:/config"
  - "{{ lookup('role_var', '_paths_download_folder', role='ytdl_sub') }}:/ytdl_sub"
  - "{{ lookup('role_var', '_paths_download_folder', role='ytdl_sub') }}/tv_shows:/tv_shows"
  - "{{ lookup('role_var', '_paths_download_folder', role='ytdl_sub') }}/movies:/movies"
  - "{{ lookup('role_var', '_paths_download_folder', role='ytdl_sub') }}/music_videos:/music_videos"
  - "{{ lookup('role_var', '_paths_download_folder', role='ytdl_sub') }}/music:/music"
ytdl_sub_role_docker_volumes_custom
# Type: list
ytdl_sub_role_docker_volumes_custom: []

Hostname

ytdl_sub_role_docker_hostname
# Type: string
ytdl_sub_role_docker_hostname: "{{ ytdl_sub_name }}"

Networks

ytdl_sub_role_docker_networks_alias
# Type: string
ytdl_sub_role_docker_networks_alias: "{{ ytdl_sub_name }}"
ytdl_sub_role_docker_networks_default
# Type: list
ytdl_sub_role_docker_networks_default: []
ytdl_sub_role_docker_networks_custom
# Type: list
ytdl_sub_role_docker_networks_custom: []

Restart Policy

ytdl_sub_role_docker_restart_policy
# Type: string
ytdl_sub_role_docker_restart_policy: unless-stopped

State

ytdl_sub_role_docker_state
# Type: string
ytdl_sub_role_docker_state: started

The following advanced options are available via create_docker_container but are not defined in the role. See: docker_container module

Resource Limits

ytdl_sub_role_docker_blkio_weight
# Type: int
ytdl_sub_role_docker_blkio_weight:
ytdl_sub_role_docker_cpu_period
# Type: int
ytdl_sub_role_docker_cpu_period:
ytdl_sub_role_docker_cpu_quota
# Type: int
ytdl_sub_role_docker_cpu_quota:
ytdl_sub_role_docker_cpu_shares
# Type: int
ytdl_sub_role_docker_cpu_shares:
ytdl_sub_role_docker_cpus
# Type: string
ytdl_sub_role_docker_cpus:
ytdl_sub_role_docker_cpuset_cpus
# Type: string
ytdl_sub_role_docker_cpuset_cpus:
ytdl_sub_role_docker_cpuset_mems
# Type: string
ytdl_sub_role_docker_cpuset_mems:
ytdl_sub_role_docker_kernel_memory
# Type: string
ytdl_sub_role_docker_kernel_memory:
ytdl_sub_role_docker_memory
# Type: string
ytdl_sub_role_docker_memory:
ytdl_sub_role_docker_memory_reservation
# Type: string
ytdl_sub_role_docker_memory_reservation:
ytdl_sub_role_docker_memory_swap
# Type: string
ytdl_sub_role_docker_memory_swap:
ytdl_sub_role_docker_memory_swappiness
# Type: int
ytdl_sub_role_docker_memory_swappiness:
ytdl_sub_role_docker_shm_size
# Type: string
ytdl_sub_role_docker_shm_size:

Security & Devices

ytdl_sub_role_docker_cap_drop
# Type: list
ytdl_sub_role_docker_cap_drop:
ytdl_sub_role_docker_cgroupns_mode
# Type: string
ytdl_sub_role_docker_cgroupns_mode:
ytdl_sub_role_docker_device_cgroup_rules
# Type: list
ytdl_sub_role_docker_device_cgroup_rules:
ytdl_sub_role_docker_device_read_bps
# Type: list
ytdl_sub_role_docker_device_read_bps:
ytdl_sub_role_docker_device_read_iops
# Type: list
ytdl_sub_role_docker_device_read_iops:
ytdl_sub_role_docker_device_requests
# Type: list
ytdl_sub_role_docker_device_requests:
ytdl_sub_role_docker_device_write_bps
# Type: list
ytdl_sub_role_docker_device_write_bps:
ytdl_sub_role_docker_device_write_iops
# Type: list
ytdl_sub_role_docker_device_write_iops:
ytdl_sub_role_docker_devices
# Type: list
ytdl_sub_role_docker_devices:
ytdl_sub_role_docker_devices_default
# Type: string
ytdl_sub_role_docker_devices_default:
ytdl_sub_role_docker_groups
# Type: list
ytdl_sub_role_docker_groups:
ytdl_sub_role_docker_privileged
# Type: bool (true/false)
ytdl_sub_role_docker_privileged:
ytdl_sub_role_docker_security_opts
# Type: list
ytdl_sub_role_docker_security_opts:
ytdl_sub_role_docker_user
# Type: string
ytdl_sub_role_docker_user:
ytdl_sub_role_docker_userns_mode
# Type: string
ytdl_sub_role_docker_userns_mode:

Networking

ytdl_sub_role_docker_dns_opts
# Type: list
ytdl_sub_role_docker_dns_opts:
ytdl_sub_role_docker_dns_search_domains
# Type: list
ytdl_sub_role_docker_dns_search_domains:
ytdl_sub_role_docker_dns_servers
# Type: list
ytdl_sub_role_docker_dns_servers:
ytdl_sub_role_docker_domainname
# Type: string
ytdl_sub_role_docker_domainname:
ytdl_sub_role_docker_exposed_ports
# Type: list
ytdl_sub_role_docker_exposed_ports:
ytdl_sub_role_docker_hosts
# Type: dict
ytdl_sub_role_docker_hosts:
ytdl_sub_role_docker_hosts_use_common
# Type: bool (true/false)
ytdl_sub_role_docker_hosts_use_common:
ytdl_sub_role_docker_ipc_mode
# Type: string
ytdl_sub_role_docker_ipc_mode:
ytdl_sub_role_docker_links
# Type: list
ytdl_sub_role_docker_links:
ytdl_sub_role_docker_network_mode
# Type: string
ytdl_sub_role_docker_network_mode:
ytdl_sub_role_docker_pid_mode
# Type: string
ytdl_sub_role_docker_pid_mode:
ytdl_sub_role_docker_ports
# Type: list
ytdl_sub_role_docker_ports:
ytdl_sub_role_docker_uts
# Type: string
ytdl_sub_role_docker_uts:

Storage

ytdl_sub_role_docker_keep_volumes
# Type: bool (true/false)
ytdl_sub_role_docker_keep_volumes:
ytdl_sub_role_docker_mounts
# Type: list
ytdl_sub_role_docker_mounts:
ytdl_sub_role_docker_storage_opts
# Type: dict
ytdl_sub_role_docker_storage_opts:
ytdl_sub_role_docker_tmpfs
# Type: list
ytdl_sub_role_docker_tmpfs:
ytdl_sub_role_docker_volume_driver
# Type: string
ytdl_sub_role_docker_volume_driver:
ytdl_sub_role_docker_volumes_from
# Type: list
ytdl_sub_role_docker_volumes_from:
ytdl_sub_role_docker_volumes_global
# Type: bool (true/false)
ytdl_sub_role_docker_volumes_global:
ytdl_sub_role_docker_working_dir
# Type: string
ytdl_sub_role_docker_working_dir:

Monitoring & Lifecycle

ytdl_sub_role_docker_auto_remove
# Type: bool (true/false)
ytdl_sub_role_docker_auto_remove:
ytdl_sub_role_docker_cleanup
# Type: bool (true/false)
ytdl_sub_role_docker_cleanup:
ytdl_sub_role_docker_force_kill
# Type: string
ytdl_sub_role_docker_force_kill:
ytdl_sub_role_docker_healthcheck
# Type: dict
ytdl_sub_role_docker_healthcheck:
ytdl_sub_role_docker_healthy_wait_timeout
# Type: int
ytdl_sub_role_docker_healthy_wait_timeout:
ytdl_sub_role_docker_init
# Type: bool (true/false)
ytdl_sub_role_docker_init:
ytdl_sub_role_docker_kill_signal
# Type: string
ytdl_sub_role_docker_kill_signal:
ytdl_sub_role_docker_log_driver
# Type: string
ytdl_sub_role_docker_log_driver:
ytdl_sub_role_docker_log_options
# Type: dict
ytdl_sub_role_docker_log_options:
ytdl_sub_role_docker_oom_killer
# Type: bool (true/false)
ytdl_sub_role_docker_oom_killer:
ytdl_sub_role_docker_oom_score_adj
# Type: int
ytdl_sub_role_docker_oom_score_adj:
ytdl_sub_role_docker_output_logs
# Type: bool (true/false)
ytdl_sub_role_docker_output_logs:
ytdl_sub_role_docker_paused
# Type: bool (true/false)
ytdl_sub_role_docker_paused:
ytdl_sub_role_docker_recreate
# Type: bool (true/false)
ytdl_sub_role_docker_recreate:
ytdl_sub_role_docker_restart_retries
# Type: int
ytdl_sub_role_docker_restart_retries:
ytdl_sub_role_docker_stop_timeout
# Type: int
ytdl_sub_role_docker_stop_timeout:

Other Options

ytdl_sub_role_docker_capabilities
# Type: list
ytdl_sub_role_docker_capabilities:
ytdl_sub_role_docker_cgroup_parent
# Type: string
ytdl_sub_role_docker_cgroup_parent:
ytdl_sub_role_docker_commands
# Type: list
ytdl_sub_role_docker_commands:
ytdl_sub_role_docker_create_timeout
# Type: int
ytdl_sub_role_docker_create_timeout:
ytdl_sub_role_docker_entrypoint
# Type: string
ytdl_sub_role_docker_entrypoint:
ytdl_sub_role_docker_env_file
# Type: string
ytdl_sub_role_docker_env_file:
ytdl_sub_role_docker_labels
# Type: dict
ytdl_sub_role_docker_labels:
ytdl_sub_role_docker_labels_use_common
# Type: bool (true/false)
ytdl_sub_role_docker_labels_use_common:
ytdl_sub_role_docker_read_only
# Type: bool (true/false)
ytdl_sub_role_docker_read_only:
ytdl_sub_role_docker_runtime
# Type: string
ytdl_sub_role_docker_runtime:
ytdl_sub_role_docker_sysctls
# Type: list
ytdl_sub_role_docker_sysctls:
ytdl_sub_role_docker_ulimits
# Type: list
ytdl_sub_role_docker_ulimits:
ytdl_sub_role_autoheal_enabled
# Enable or disable Autoheal monitoring for the container created when deploying
# Type: bool (true/false)
ytdl_sub_role_autoheal_enabled: true
ytdl_sub_role_cron_on_start
# Type: string
ytdl_sub_role_cron_on_start:
ytdl_sub_role_cron_schedule
# Type: string
ytdl_sub_role_cron_schedule:
ytdl_sub_role_depends_on
# List of container dependencies that must be running before the container start
# Type: string
ytdl_sub_role_depends_on: ""
ytdl_sub_role_depends_on_delay
# Delay in seconds before starting the container after dependencies are ready
# Type: string (quoted number)
ytdl_sub_role_depends_on_delay: "0"
ytdl_sub_role_depends_on_healthchecks
# Enable healthcheck waiting for container dependencies
# Type: string ("true"/"false")
ytdl_sub_role_depends_on_healthchecks:
ytdl_sub_role_diun_enabled
# Enable or disable Diun update notifications for the container created when deploying
# Type: bool (true/false)
ytdl_sub_role_diun_enabled: true
ytdl_sub_role_dns_enabled
# Enable or disable automatic DNS record creation for the container
# Type: bool (true/false)
ytdl_sub_role_dns_enabled: true
ytdl_sub_role_docker_controller
# Enable or disable Saltbox Docker Controller management for the container
# Type: bool (true/false)
ytdl_sub_role_docker_controller: true
ytdl_sub_role_docker_image_repo
# Type: string
ytdl_sub_role_docker_image_repo:
ytdl_sub_role_docker_image_tag
# Type: string
ytdl_sub_role_docker_image_tag:
ytdl_sub_role_docker_volumes_download
# Type: bool (true/false)
ytdl_sub_role_docker_volumes_download:
ytdl_sub_role_image_type
# Type: string
ytdl_sub_role_image_type:
ytdl_sub_role_paths_download_folder
# Type: string
ytdl_sub_role_paths_download_folder:
ytdl_sub_role_paths_location
# Type: string
ytdl_sub_role_paths_location:
ytdl_sub_role_themepark_addons
# Type: string
ytdl_sub_role_themepark_addons:
ytdl_sub_role_themepark_app
# Type: string
ytdl_sub_role_themepark_app:
ytdl_sub_role_themepark_theme
# Type: string
ytdl_sub_role_themepark_theme:
ytdl_sub_role_traefik_api_endpoint
# Type: dict/omit
ytdl_sub_role_traefik_api_endpoint:
ytdl_sub_role_traefik_api_middleware
# Type: string
ytdl_sub_role_traefik_api_middleware:
ytdl_sub_role_traefik_api_middleware_http
# Type: string
ytdl_sub_role_traefik_api_middleware_http:
ytdl_sub_role_traefik_autodetect_enabled
# Enable Traefik autodetect middleware for the container
# Type: bool (true/false)
ytdl_sub_role_traefik_autodetect_enabled: false
ytdl_sub_role_traefik_certresolver
# Type: string
ytdl_sub_role_traefik_certresolver:
ytdl_sub_role_traefik_crowdsec_enabled
# Enable CrowdSec middleware for the container
# Type: bool (true/false)
ytdl_sub_role_traefik_crowdsec_enabled: false
ytdl_sub_role_traefik_error_pages_enabled
# Enable custom error pages middleware for the container
# Type: bool (true/false)
ytdl_sub_role_traefik_error_pages_enabled: false
ytdl_sub_role_traefik_gzip_enabled
# Enable gzip compression middleware for the container
# Type: bool (true/false)
ytdl_sub_role_traefik_gzip_enabled: false
ytdl_sub_role_traefik_middleware_http
# Type: string
ytdl_sub_role_traefik_middleware_http:
ytdl_sub_role_traefik_middleware_http_api_insecure
# Type: bool (true/false)
ytdl_sub_role_traefik_middleware_http_api_insecure:
ytdl_sub_role_traefik_middleware_http_insecure
# Type: bool (true/false)
ytdl_sub_role_traefik_middleware_http_insecure:
ytdl_sub_role_traefik_priority
# Type: string
ytdl_sub_role_traefik_priority:
ytdl_sub_role_traefik_robot_enabled
# Enable robots.txt middleware for the container
# Type: bool (true/false)
ytdl_sub_role_traefik_robot_enabled: true
ytdl_sub_role_traefik_tailscale_enabled
# Enable Tailscale-specific Traefik configuration for the container
# Type: bool (true/false)
ytdl_sub_role_traefik_tailscale_enabled: false
ytdl_sub_role_traefik_wildcard_enabled
# Enable wildcard certificate for the container
# Type: bool (true/false)
ytdl_sub_role_traefik_wildcard_enabled: true
ytdl_sub_role_web_domain
# Type: string
ytdl_sub_role_web_domain:
ytdl_sub_role_web_fqdn_override
# Override the Traefik fully qualified domain name (FQDN) for the container
# Type: list
ytdl_sub_role_web_fqdn_override:

Example Override

ytdl_sub_role_web_fqdn_override:
  - "{{ traefik_host }}"
  - "ytdl_sub2.{{ user.domain }}"
  - "ytdl_sub.otherdomain.tld"

Note: Include {{ traefik_host }} to preserve the default FQDN alongside your custom entries

ytdl_sub_role_web_host_override
# Override the Traefik web host configuration for the container
# Type: string
ytdl_sub_role_web_host_override:

Example Override

ytdl_sub_role_web_host_override: "Host(`{{ traefik_host }}`) || Host(`{{ 'ytdl_sub2.' + user.domain }}`)"

Note: Use {{ traefik_host }} to include the default host configuration in your custom rule

ytdl_sub_role_web_http_port
# Type: string (quoted number)
ytdl_sub_role_web_http_port:
ytdl_sub_role_web_http_scheme
# Type: string ("http"/"https")
ytdl_sub_role_web_http_scheme:
ytdl_sub_role_web_http_serverstransport
# Type: dict/omit
ytdl_sub_role_web_http_serverstransport:
ytdl_sub_role_web_scheme
# URL scheme to use for web access to the container
# Type: string ("http"/"https")
ytdl_sub_role_web_scheme:
ytdl_sub_role_web_serverstransport
# Type: dict/omit
ytdl_sub_role_web_serverstransport:
ytdl_sub_role_web_subdomain
# Type: string
ytdl_sub_role_web_subdomain: