scripts: fix video downloader
This commit is contained in:
parent
a1a6df8eac
commit
4cab0e1e7a
1 changed files with 10 additions and 1 deletions
|
@ -1,10 +1,19 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
|
cleanup() {
|
||||||
|
if test "$?" != 0; then
|
||||||
|
notify-send "Failed to download"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
trap cleanup EXIT INT
|
||||||
|
|
||||||
DIR=$(mktemp -d)
|
DIR=$(mktemp -d)
|
||||||
|
|
||||||
cd "$DIR"
|
cd "$DIR"
|
||||||
|
|
||||||
yt-dlp --merge-output-format mp4 "$(wl-paste)"
|
yt-dlp --cookies-from-browser firefox --merge-output-format mp4 "$(wl-paste)"
|
||||||
|
|
||||||
FILENAME="$(ls | head -n1)"
|
FILENAME="$(ls | head -n1)"
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue