From e763c4a75370b4e184c9418fe3ef940688d6e0b8 Mon Sep 17 00:00:00 2001 From: Wiktor Zykubek Date: Wed, 13 May 2020 12:13:51 +0200 Subject: [PATCH] Add 'ytdl' script --- .local/bin/scripts/ytdl | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100755 .local/bin/scripts/ytdl diff --git a/.local/bin/scripts/ytdl b/.local/bin/scripts/ytdl new file mode 100755 index 0000000..187cc00 --- /dev/null +++ b/.local/bin/scripts/ytdl @@ -0,0 +1,19 @@ +#!/bin/sh + +# Simple youtube-dl wrapper script for better user syntax. + +Y() { youtube-dl -i -4 -o "%(title)s.%(ext)s" "$@"; } + +audio() { + Y -x --audio-format opus --audio-quality 0 "$@" +} + +video() { + Y -f best "$@" +} + +thumbnail() { + Y --write-thumbnail --skip-download "$@" +} + +"$1" "$2" && notify-send " Downloaded!"