@@ 2,13 2,17 @@
# Help menu
usage() {
- printf "Usage: $0 [-f <format>] [-d <directory>]" 1>&2
+ printf "Usage: $0 [-f <format>] [-d <directory>] [link]" 1>&2
printf "
--f <format> Sets the format the audio will be downloaded on.
- Default: ogg opus when possible, otherwise vorbis ogg.
--d <directory> Sets the directory where downloaded audio will be stored.
- Default: \$HOME/Downloads/youtube-dl/
+ It downloads on a directory the audio from the provided link.
+ If no link is provided, clipboard content is used.
+
+ -f <format> Sets the format the audio will be downloaded on.
+ Default: ogg opus when possible, otherwise vorbis ogg.
+
+ -d <directory> Sets the directory where downloaded audio will be stored.
+ Default: \$HOME/Downloads/youtube-dl/
" >&2
exit 1
@@ 50,6 54,7 @@ if [ "$format" = "opus" ]; then
youtube-dl -x --audio-quality 0 --audio-format opus "$link"
size="$(stat --printf="%s" "$filename")"
+ # Little hack to check if opus file is ok
if [ "$size" -lt 500000 ]; then
youtube-dl -x --audio-quality 0 --audio-format vorbis "$link"
rm "$filename"