{
  "description": "Download metadata, video, audio, or captions for YouTube content you own or are authorized to download.",
  "properties": {
    "allow4K": {
      "default": false,
      "description": "Enable 1440p/2160p SDR downloads. These are capped at 10 minutes and 1000 MB and may use MKV with VP9/AV1 because YouTube rarely serves H.264 above 1080p.",
      "prefill": false,
      "title": "Allow 4K",
      "type": "boolean"
    },
    "audioFormat": {
      "default": "m4a",
      "description": "Source audio passthrough format used when audioOnly is enabled.",
      "editor": "select",
      "enum": [
        "m4a",
        "opus"
      ],
      "enumTitles": [
        "M4A (AAC passthrough)",
        "Opus (passthrough)"
      ],
      "prefill": "m4a",
      "title": "Audio Format",
      "type": "string"
    },
    "audioOnly": {
      "default": false,
      "description": "Download the source audio track without video and without re-encoding.",
      "prefill": false,
      "title": "Audio Only",
      "type": "boolean"
    },
    "channelUrls": {
      "default": [],
      "description": "YouTube channel URLs, @handles, or UC channel IDs. The Videos tab is used.",
      "editor": "stringList",
      "items": {
        "type": "string"
      },
      "prefill": [],
      "title": "Channel URLs",
      "type": "array"
    },
    "container": {
      "default": "auto",
      "description": "Auto uses MP4 H.264/AAC when available and MKV for VP9/AV1. Explicit MP4 never relabels AV1/Opus content as MP4; if no compatible stream exists the video gets a failure row.",
      "editor": "select",
      "enum": [
        "auto",
        "mp4",
        "webm",
        "mkv"
      ],
      "enumTitles": [
        "Auto (compatible first)",
        "MP4 (H.264/AAC)",
        "WebM (VP9/AV1 + Opus)",
        "MKV (any codec)"
      ],
      "prefill": "auto",
      "title": "Container",
      "type": "string"
    },
    "cookies": {
      "description": "Optional cookies.txt content for age-restricted or members-only videos. Public videos work without cookies.",
      "editor": "textarea",
      "isSecret": true,
      "title": "Cookies (Netscape format)",
      "type": "string"
    },
    "downloadSubtitles": {
      "default": false,
      "description": "Fetch available manual or automatic captions for the requested languages.",
      "prefill": false,
      "title": "Download Subtitles",
      "type": "boolean"
    },
    "includeTranscript": {
      "default": false,
      "description": "Add a plain-text transcript from the first requested caption track.",
      "prefill": false,
      "title": "Include Transcript Text",
      "type": "boolean"
    },
    "kvsName": {
      "default": "",
      "description": "Named key-value store name when storage=named_kvs. Defaults to youtube-downloader.",
      "editor": "textfield",
      "prefill": "",
      "title": "KVS Name",
      "type": "string"
    },
    "maxMB": {
      "default": 500,
      "description": "Reject oversized downloads. Values above 500 are only used for 4K opt-in downloads, which are capped at 1000 MB.",
      "maximum": 1000,
      "minimum": 1,
      "prefill": 100,
      "title": "Max MB Per Video",
      "type": "integer"
    },
    "maxMinutes": {
      "default": 30,
      "description": "Reject a video before download when its duration exceeds this cap. 4K opt-in downloads are additionally capped at 10 minutes.",
      "maximum": 30,
      "minimum": 1,
      "prefill": 30,
      "title": "Max Minutes Per Video",
      "type": "integer"
    },
    "maxVideos": {
      "default": 10,
      "description": "Total videos processed across all inputs.",
      "maximum": 50,
      "minimum": 1,
      "prefill": 1,
      "title": "Max Videos",
      "type": "integer"
    },
    "mode": {
      "default": "metadata",
      "description": "What to return: metadata only, media files, or caption files without media.",
      "editor": "select",
      "enum": [
        "metadata",
        "download",
        "subtitles"
      ],
      "enumTitles": [
        "Metadata only",
        "Download media",
        "Subtitles only"
      ],
      "prefill": "metadata",
      "title": "Mode",
      "type": "string"
    },
    "playlistUrls": {
      "default": [],
      "description": "YouTube playlist URLs. Videos are expanded up to maxVideos in total.",
      "editor": "stringList",
      "items": {
        "type": "string"
      },
      "prefill": [],
      "title": "Playlist URLs",
      "type": "array"
    },
    "proxyConfiguration": {
      "default": {
        "useApifyProxy": true
      },
      "description": "Optional. Metadata and player extraction use this connection; media bytes are downloaded directly.",
      "editor": "proxy",
      "prefill": {
        "useApifyProxy": true
      },
      "title": "Proxy Configuration",
      "type": "object"
    },
    "s3AccessKeyId": {
      "description": "Optional access key ID when storage=s3.",
      "editor": "textfield",
      "isSecret": true,
      "title": "S3 Access Key ID",
      "type": "string"
    },
    "s3Bucket": {
      "description": "Bucket name when storage=s3.",
      "editor": "textfield",
      "title": "S3 Bucket",
      "type": "string"
    },
    "s3Endpoint": {
      "description": "Custom endpoint for S3-compatible storage such as Cloudflare R2.",
      "editor": "textfield",
      "title": "S3 Endpoint",
      "type": "string"
    },
    "s3Prefix": {
      "default": "youtube-downloader",
      "description": "Object key prefix when storage=s3.",
      "editor": "textfield",
      "prefill": "youtube-downloader",
      "title": "S3 Prefix",
      "type": "string"
    },
    "s3PublicBaseUrl": {
      "description": "Optional public bucket URL. When set, files use public URLs instead of expiring presigned URLs.",
      "editor": "textfield",
      "title": "S3 Public Base URL",
      "type": "string"
    },
    "s3Region": {
      "default": "auto",
      "description": "Region for S3 or S3-compatible storage.",
      "editor": "textfield",
      "prefill": "auto",
      "title": "S3 Region",
      "type": "string"
    },
    "s3SecretAccessKey": {
      "description": "Optional secret access key when storage=s3.",
      "editor": "textfield",
      "isSecret": true,
      "title": "S3 Secret Access Key",
      "type": "string"
    },
    "searchQueries": {
      "default": [],
      "description": "YouTube search phrases. Each query resolves public results up to maxVideos in total.",
      "editor": "stringList",
      "items": {
        "type": "string"
      },
      "prefill": [],
      "title": "Search Queries",
      "type": "array"
    },
    "storage": {
      "default": "ephemeral_kvs",
      "description": "Where downloaded files are written. Named KVS persists while the store exists; ephemeral KVS follows your Apify account retention.",
      "editor": "select",
      "enum": [
        "ephemeral_kvs",
        "named_kvs",
        "s3"
      ],
      "enumTitles": [
        "Ephemeral Apify KVS",
        "Named Apify KVS",
        "S3 or S3-compatible (R2)"
      ],
      "prefill": "ephemeral_kvs",
      "title": "Storage",
      "type": "string"
    },
    "storageRetentionDays": {
      "default": 7,
      "description": "Signed-link lifetime for S3/R2 storage (1-7 days). KVS retention is controlled by your Apify account.",
      "maximum": 7,
      "minimum": 1,
      "prefill": 7,
      "title": "Storage Retention Days",
      "type": "integer"
    },
    "subtitleFormat": {
      "default": "vtt",
      "description": "File format for downloaded captions.",
      "editor": "select",
      "enum": [
        "vtt",
        "srt"
      ],
      "enumTitles": [
        "WebVTT (.vtt)",
        "SubRip (.srt)"
      ],
      "prefill": "vtt",
      "title": "Subtitle Format",
      "type": "string"
    },
    "subtitleLanguages": {
      "default": [
        "en"
      ],
      "description": "Caption language codes to request. Only tracks that already exist on the video are used; translations are not promised.",
      "editor": "select",
      "items": {
        "enum": [
          "en",
          "en-US",
          "en-GB",
          "es",
          "es-419",
          "pt",
          "pt-BR",
          "fr",
          "de",
          "it",
          "nl",
          "pl",
          "ru",
          "uk",
          "tr",
          "ar",
          "fa",
          "he",
          "hi",
          "bn",
          "ta",
          "te",
          "mr",
          "ur",
          "gu",
          "kn",
          "ml",
          "pa",
          "zh-Hans",
          "zh-Hant",
          "ja",
          "ko",
          "vi",
          "th",
          "id",
          "ms",
          "fil",
          "sv",
          "no",
          "da",
          "fi",
          "cs",
          "sk",
          "hu",
          "ro",
          "bg",
          "el",
          "hr",
          "sr",
          "sl",
          "lt",
          "lv",
          "et",
          "is",
          "sq",
          "mk",
          "bs",
          "ca",
          "gl",
          "eu",
          "af",
          "sw",
          "am",
          "km",
          "lo",
          "my",
          "ne",
          "si",
          "ka",
          "hy",
          "az",
          "kk",
          "ky",
          "uz",
          "mn",
          "mt",
          "cy",
          "ga"
        ],
        "enumTitles": [
          "English",
          "English (US)",
          "English (UK)",
          "Spanish",
          "Spanish (Latin America)",
          "Portuguese",
          "Portuguese (Brazil)",
          "French",
          "German",
          "Italian",
          "Dutch",
          "Polish",
          "Russian",
          "Ukrainian",
          "Turkish",
          "Arabic",
          "Persian",
          "Hebrew",
          "Hindi",
          "Bengali",
          "Tamil",
          "Telugu",
          "Marathi",
          "Urdu",
          "Gujarati",
          "Kannada",
          "Malayalam",
          "Punjabi",
          "Chinese (Simplified)",
          "Chinese (Traditional)",
          "Japanese",
          "Korean",
          "Vietnamese",
          "Thai",
          "Indonesian",
          "Malay",
          "Filipino",
          "Swedish",
          "Norwegian",
          "Danish",
          "Finnish",
          "Czech",
          "Slovak",
          "Hungarian",
          "Romanian",
          "Bulgarian",
          "Greek",
          "Croatian",
          "Serbian",
          "Slovenian",
          "Lithuanian",
          "Latvian",
          "Estonian",
          "Icelandic",
          "Albanian",
          "Macedonian",
          "Bosnian",
          "Catalan",
          "Galician",
          "Basque",
          "Afrikaans",
          "Swahili",
          "Amharic",
          "Khmer",
          "Lao",
          "Burmese",
          "Nepali",
          "Sinhala",
          "Georgian",
          "Armenian",
          "Azerbaijani",
          "Kazakh",
          "Kyrgyz",
          "Uzbek",
          "Mongolian",
          "Maltese",
          "Welsh",
          "Irish"
        ],
        "type": "string"
      },
      "prefill": [
        "en"
      ],
      "title": "Subtitle Languages",
      "type": "array"
    },
    "videoQuality": {
      "default": "720p",
      "description": "SDR target quality. 360p-1080p prefer H.264/AAC MP4. 1440p and 2160p require allow4K and are delivered with their real codec and container.",
      "editor": "select",
      "enum": [
        "360p",
        "480p",
        "720p",
        "1080p",
        "1440p",
        "2160p",
        "best"
      ],
      "enumTitles": [
        "360p",
        "480p",
        "720p (default)",
        "1080p",
        "1440p (requires allow4K)",
        "2160p / 4K (requires allow4K)",
        "Best available (capped at 1080p unless allow4K)"
      ],
      "prefill": "360p",
      "title": "Video Quality",
      "type": "string"
    },
    "videoUrls": {
      "default": [],
      "description": "Direct YouTube video, Shorts, live-replay, or youtu.be URLs, or 11-character video IDs.",
      "editor": "stringList",
      "items": {
        "type": "string"
      },
      "prefill": [
        "https://www.youtube.com/watch?v=jNQXAC9IVRw"
      ],
      "title": "Video URLs",
      "type": "array"
    }
  },
  "required": [
    "mode"
  ],
  "schemaVersion": 1,
  "title": "YouTube Video Downloader Input",
  "type": "object"
}
