dotfiles/.local/bin/ytdl

21 lines
237 B
Text
Raw Normal View History

2018-12-26 00:40:38 +01:00
#!/bin/bash
2019-01-21 08:16:41 +01:00
actualpwd="$PWD"
temp=$(mktemp -d)
cd "$temp"
for file in "${actualpwd}/"*
do
ln -s "$file" ./
done
2019-04-19 22:18:25 +02:00
youtube-dl -o '%(title)s.%(ext)s' "$@" --exec "mv -n {} \"${actualpwd}/\""
2019-01-21 08:16:41 +01:00
status="$?"
2019-04-19 22:18:25 +02:00
#rm -rf "$temp"
2019-01-21 08:16:41 +01:00
exit $status