From 7f41681bd732e76910cf96d060240f3d51d54b7e Mon Sep 17 00:00:00 2001 From: Wiwi Kuan Date: Sat, 24 Aug 2024 20:16:17 +0800 Subject: [PATCH] Add files via upload --- yt-res.sh | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 yt-res.sh diff --git a/yt-res.sh b/yt-res.sh new file mode 100644 index 0000000..c64c896 --- /dev/null +++ b/yt-res.sh @@ -0,0 +1,16 @@ +#!/bin/bash + +# Check if two arguments are provided. +if [ "$#" -ne 2 ]; then + echo "Usage: $0 " + exit 1 +fi + +# Define the resolution to be used in the download. +resolution=$1 + +# Define the URL from which the video should be downloaded. +url=$2 + +# Use yt-dlp to download a video with the specified resolution. +yt-dlp -f "bestvideo[height<=${resolution}]+bestaudio/best[height<=${resolution}]" $url