{
  "id": "svtplay-dl",
  "name": "svtplay-dl",
  "homepage": "https://svtplay-dl.se",
  "description": "Small command-line program to download videos from some streaming sites.",
  "icon": "https://svtplay-dl.se/favicon.svg",
  "executables": [
    "svtplay-dl"
  ],
  "dotfiles": {
    "paths": [
      "[configHome]/svtplay-dl/svtplay-dl.yaml",
      "~/.svtplay-dl.yaml"
    ],
    "exclude": [],
    "secret": [],
    "secret_paths": [
      {
        "file": [
          "[configHome]/svtplay-dl/svtplay-dl.yaml",
          "~/.svtplay-dl.yaml"
        ],
        "match": {
          "key_path": [
            "password",
            "token",
            "cookies"
          ]
        }
      }
    ]
  },
  "commands": {
    "format": 1,
    "label": "Download video",
    "description": "Download a video from a supported play service. Subtitle, quality and output options are covered; credentials and rarely used flags are left out.",
    "quality": "ai-draft",
    "base": "fig:svtplay-dl",
    "parser": {
      "end_of_options": "--",
      "interleave": "permute",
      "long_equals": true,
      "short_attached": true,
      "short_bundles": false
    },
    "source": [
      {
        "id": "fig",
        "kind": "completion",
        "url": "https://github.com/withfig/autocomplete/blob/master/src/svtplay-dl.ts",
        "license": "MIT"
      }
    ],
    "field": [
      {
        "id": "urls",
        "label": "Video URLs",
        "type": "url",
        "position": 0,
        "multiple": true,
        "sources": [
          "fig"
        ]
      },
      {
        "id": "output",
        "label": "Output file or folder",
        "type": "path",
        "option": [
          "--output",
          "-o"
        ],
        "path": {
          "kind": "any",
          "role": "output",
          "must_exist": false
        },
        "sources": [
          "fig"
        ]
      },
      {
        "id": "quality",
        "label": "Quality",
        "description": "Bitrate or resolution; best by default.",
        "type": "string",
        "option": [
          "--quality",
          "-q"
        ],
        "sources": [
          "fig"
        ]
      },
      {
        "id": "list_quality",
        "label": "List qualities",
        "type": "boolean",
        "option": [
          "--list-quality"
        ],
        "sources": [
          "fig"
        ]
      },
      {
        "id": "subtitle",
        "label": "Download subtitle",
        "type": "boolean",
        "option": [
          "--subtitle",
          "-S"
        ],
        "sources": [
          "fig"
        ]
      },
      {
        "id": "all_subtitles",
        "label": "All subtitles",
        "type": "boolean",
        "option": [
          "--all-subtitles"
        ],
        "sources": [
          "fig"
        ]
      },
      {
        "id": "merge_subtitle",
        "label": "Merge subtitle",
        "type": "boolean",
        "option": [
          "--merge-subtitle",
          "-M"
        ],
        "sources": [
          "fig"
        ]
      },
      {
        "id": "all_episodes",
        "label": "All episodes",
        "type": "boolean",
        "option": [
          "--all-episodes",
          "-A"
        ],
        "sources": [
          "fig"
        ]
      },
      {
        "id": "subfolder",
        "label": "Subfolder per show",
        "type": "boolean",
        "option": [
          "--subfolder"
        ],
        "sources": [
          "fig"
        ]
      },
      {
        "id": "thumbnail",
        "label": "Download thumbnail",
        "type": "boolean",
        "option": [
          "--thumbnail",
          "-t"
        ],
        "sources": [
          "fig"
        ]
      },
      {
        "id": "get_url",
        "label": "Only print URL",
        "type": "boolean",
        "option": [
          "--get-url",
          "-g"
        ],
        "sources": [
          "fig"
        ]
      },
      {
        "id": "force",
        "label": "Overwrite existing",
        "type": "boolean",
        "option": [
          "--force",
          "-f"
        ],
        "effect": "overwrite",
        "sources": [
          "fig"
        ]
      }
    ],
    "task": [
      {
        "id": "download",
        "label": "Download video",
        "fields": [
          "urls",
          "output",
          "quality",
          "subtitle"
        ],
        "required": [
          "urls"
        ]
      },
      {
        "id": "list",
        "label": "List available qualities",
        "set": {
          "list_quality": [
            true
          ]
        },
        "lock": [
          "list_quality"
        ],
        "fields": [
          "urls",
          "list_quality"
        ],
        "required": [
          "urls"
        ]
      },
      {
        "id": "series",
        "label": "Download all episodes",
        "set": {
          "all_episodes": [
            true
          ]
        },
        "fields": [
          "urls",
          "output",
          "all_episodes",
          "subfolder",
          "quality"
        ],
        "required": [
          "urls"
        ]
      }
    ],
    "group": [
      {
        "id": "basic",
        "label": "Basic",
        "fields": [
          "urls",
          "output",
          "quality",
          "list_quality",
          "subtitle",
          "all_episodes"
        ]
      },
      {
        "id": "advanced",
        "label": "Advanced",
        "fields": [
          "subfolder",
          "thumbnail",
          "get_url",
          "force",
          "merge_subtitle",
          "all_subtitles"
        ]
      }
    ]
  }
}
