dotfiles/.local/bin/ytdl
2019-04-19 22:18:25 +02:00

20 lines
237 B
Bash
Executable file

#!/bin/bash
actualpwd="$PWD"
temp=$(mktemp -d)
cd "$temp"
for file in "${actualpwd}/"*
do
ln -s "$file" ./
done
youtube-dl -o '%(title)s.%(ext)s' "$@" --exec "mv -n {} \"${actualpwd}/\""
status="$?"
#rm -rf "$temp"
exit $status