id = "svtplay-dl" name = "svtplay-dl" homepage = "https://svtplay-dl.se" description = "Small command-line program to download videos from some streaming sites." # The project's own SVG favicon. icon = "https://svtplay-dl.se/favicon.svg" executables = ["svtplay-dl"] [dotfiles] # https://svtplay-dl.se/config/ lists the search order, and # lib/svtplay_dl/utils/parser.py implements it: on Windows # os.path.join(APPDATA, "svtplay-dl", "svtplay-dl.yaml"); elsewhere # os.path.join(XDG_CONFIG_HOME or os.path.expanduser("~/.config"), # "svtplay-dl", "svtplay-dl.yaml"), with os.path.expanduser("~/.svtplay-dl.yaml") # as the legacy home-directory spelling it still falls back to. The XDG # directory and the Windows one are the same location, [configHome]. A # svtplay-dl.yaml in the working directory wins over both and belongs to that # directory, not to the user, so it is not listed. paths = [ "[configHome]/svtplay-dl/svtplay-dl.yaml", "~/.svtplay-dl.yaml", ] exclude = [] secret = [] # The same parser defines username, password, token and cookies as config # keys, so a site login written into the file is a credential sitting in an # otherwise ordinary options file. Both spellings are named: the consumer # matches whichever one it resolved on this machine, and a rule that knew only # the base-directory path would let the legacy file sync in the clear. [[dotfiles.secret_paths]] file = [ "[configHome]/svtplay-dl/svtplay-dl.yaml", "~/.svtplay-dl.yaml", ] match = { key_path = ["password", "token", "cookies"] } # No machine_lines: what is left is quality, subtitle and naming preferences, # which is what a user wants carried. `output` names a download directory and # could be machine-local, but it is just as often a relative path, so no rule # is claimed for it. [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 } [[commands.source]] id = "fig" kind = "completion" url = "https://github.com/withfig/autocomplete/blob/master/src/svtplay-dl.ts" license = "MIT" [[commands.field]] id = "urls" label = "Video URLs" type = "url" position = 0 multiple = true sources = ["fig"] [[commands.field]] id = "output" label = "Output file or folder" type = "path" option = ["--output", "-o"] path = { kind = "any", role = "output", must_exist = false } sources = ["fig"] [[commands.field]] id = "quality" label = "Quality" description = "Bitrate or resolution; best by default." type = "string" option = ["--quality", "-q"] sources = ["fig"] [[commands.field]] id = "list_quality" label = "List qualities" type = "boolean" option = ["--list-quality"] sources = ["fig"] [[commands.field]] id = "subtitle" label = "Download subtitle" type = "boolean" option = ["--subtitle", "-S"] sources = ["fig"] [[commands.field]] id = "all_subtitles" label = "All subtitles" type = "boolean" option = ["--all-subtitles"] sources = ["fig"] [[commands.field]] id = "merge_subtitle" label = "Merge subtitle" type = "boolean" option = ["--merge-subtitle", "-M"] sources = ["fig"] [[commands.field]] id = "all_episodes" label = "All episodes" type = "boolean" option = ["--all-episodes", "-A"] sources = ["fig"] [[commands.field]] id = "subfolder" label = "Subfolder per show" type = "boolean" option = ["--subfolder"] sources = ["fig"] [[commands.field]] id = "thumbnail" label = "Download thumbnail" type = "boolean" option = ["--thumbnail", "-t"] sources = ["fig"] [[commands.field]] id = "get_url" label = "Only print URL" type = "boolean" option = ["--get-url", "-g"] sources = ["fig"] [[commands.field]] id = "force" label = "Overwrite existing" type = "boolean" option = ["--force", "-f"] effect = "overwrite" sources = ["fig"] [[commands.task]] id = "download" label = "Download video" fields = ["urls", "output", "quality", "subtitle"] required = ["urls"] [[commands.task]] id = "list" label = "List available qualities" set = { list_quality = [true] } lock = ["list_quality"] fields = ["urls", "list_quality"] required = ["urls"] [[commands.task]] id = "series" label = "Download all episodes" set = { all_episodes = [true] } fields = ["urls", "output", "all_episodes", "subfolder", "quality"] required = ["urls"] [[commands.group]] id = "basic" label = "Basic" fields = ["urls", "output", "quality", "list_quality", "subtitle", "all_episodes"] [[commands.group]] id = "advanced" label = "Advanced" fields = ["subfolder", "thumbnail", "get_url", "force", "merge_subtitle", "all_subtitles"]