{
  "id": "youtube-dl",
  "name": "youtube-dl",
  "homepage": "https://ytdl-org.github.io/youtube-dl/",
  "description": "A command-line program to download videos from YouTube.com and a few more sites.",
  "executables": [
    "youtube-dl"
  ],
  "dotfiles": {
    "paths": [
      "~/.config/youtube-dl/config",
      "~/youtube-dl.conf",
      "%APPDATA%/youtube-dl/config.txt"
    ],
    "exclude": [
      "[xdgCache]/youtube-dl/"
    ],
    "secret": [],
    "side_effect": false,
    "machine_lines": [
      {
        "file": [
          "~/.config/youtube-dl/config",
          "~/youtube-dl.conf",
          "%APPDATA%/youtube-dl/config.txt"
        ],
        "match": {
          "prefix": [
            "--cache-dir",
            "--cookies"
          ]
        },
        "scope": "backup"
      },
      {
        "file": [
          "~/.config/youtube-dl/config",
          "~/youtube-dl.conf",
          "%APPDATA%/youtube-dl/config.txt"
        ],
        "match": {
          "prefix": [
            "--ffmpeg-location"
          ]
        },
        "scope": "platform"
      }
    ]
  },
  "commands": {
    "format": 1,
    "label": "Download video",
    "description": "Download videos and audio from a URL. Authentication, proxy, geo-bypass and post-processing details are mostly left out.",
    "quality": "ai-draft",
    "base": "fig:youtube-dl",
    "parser": {
      "end_of_options": "--",
      "interleave": "permute",
      "long_equals": true,
      "short_attached": true,
      "short_bundles": true
    },
    "source": [
      {
        "id": "fig",
        "kind": "completion",
        "url": "https://github.com/withfig/autocomplete/blob/master/src/youtube-dl.ts",
        "license": "MIT"
      }
    ],
    "field": [
      {
        "id": "urls",
        "label": "URLs",
        "type": "url",
        "position": 0,
        "multiple": true,
        "sources": [
          "fig"
        ]
      },
      {
        "id": "format",
        "label": "Format code",
        "type": "string",
        "option": [
          "--format",
          "-f"
        ],
        "suggestions": [
          {
            "value": "bestvideo+bestaudio",
            "label": "Best video + audio"
          },
          {
            "value": "best",
            "label": "Best single file"
          }
        ],
        "sources": [
          "fig"
        ]
      },
      {
        "id": "list_formats",
        "label": "List formats only",
        "type": "boolean",
        "option": [
          "--list-formats",
          "-F"
        ],
        "sources": [
          "fig"
        ]
      },
      {
        "id": "extract_audio",
        "label": "Extract audio",
        "type": "boolean",
        "option": [
          "--extract-audio",
          "-x"
        ],
        "sources": [
          "fig"
        ]
      },
      {
        "id": "audio_format",
        "label": "Audio format",
        "type": "string",
        "option": [
          "--audio-format"
        ],
        "suggestions": [
          {
            "value": "mp3",
            "label": "MP3"
          },
          {
            "value": "m4a",
            "label": "M4A"
          },
          {
            "value": "opus",
            "label": "Opus"
          },
          {
            "value": "flac",
            "label": "FLAC"
          },
          {
            "value": "wav",
            "label": "WAV"
          },
          {
            "value": "best",
            "label": "Best"
          }
        ],
        "sources": [
          "fig"
        ]
      },
      {
        "id": "output",
        "label": "Output template",
        "type": "string",
        "option": [
          "--output",
          "-o"
        ],
        "sources": [
          "fig"
        ]
      },
      {
        "id": "no_playlist",
        "label": "Single video only",
        "type": "boolean",
        "option": [
          "--no-playlist"
        ],
        "sources": [
          "fig"
        ]
      },
      {
        "id": "write_sub",
        "label": "Write subtitles",
        "type": "boolean",
        "option": [
          "--write-sub"
        ],
        "sources": [
          "fig"
        ]
      },
      {
        "id": "embed_thumbnail",
        "label": "Embed thumbnail",
        "type": "boolean",
        "option": [
          "--embed-thumbnail"
        ],
        "sources": [
          "fig"
        ]
      },
      {
        "id": "limit_rate",
        "label": "Rate limit",
        "type": "string",
        "option": [
          "--limit-rate",
          "-r"
        ],
        "sources": [
          "fig"
        ]
      },
      {
        "id": "cookies",
        "label": "Cookies file",
        "type": "path",
        "option": [
          "--cookies"
        ],
        "path": {
          "kind": "file",
          "role": "input",
          "must_exist": true
        },
        "sources": [
          "fig"
        ]
      },
      {
        "id": "simulate",
        "label": "Simulate only",
        "type": "boolean",
        "option": [
          "--simulate",
          "-s"
        ],
        "sources": [
          "fig"
        ]
      }
    ],
    "task": [
      {
        "id": "video",
        "label": "Download video",
        "fields": [
          "urls",
          "format",
          "output",
          "no_playlist"
        ],
        "required": [
          "urls"
        ]
      },
      {
        "id": "audio",
        "label": "Download audio",
        "set": {
          "extract_audio": [
            true
          ]
        },
        "lock": [
          "extract_audio"
        ],
        "fields": [
          "urls",
          "audio_format",
          "output",
          "no_playlist"
        ],
        "required": [
          "urls"
        ]
      },
      {
        "id": "formats",
        "label": "List formats",
        "set": {
          "list_formats": [
            true
          ]
        },
        "lock": [
          "list_formats"
        ],
        "fields": [
          "urls"
        ],
        "required": [
          "urls"
        ]
      }
    ],
    "group": [
      {
        "id": "basic",
        "label": "Basic",
        "fields": [
          "urls",
          "format",
          "extract_audio",
          "audio_format",
          "output",
          "no_playlist"
        ]
      },
      {
        "id": "advanced",
        "label": "Advanced",
        "fields": [
          "list_formats",
          "write_sub",
          "embed_thumbnail",
          "limit_rate",
          "cookies",
          "simulate"
        ]
      }
    ]
  }
}
