forked from natto1784/dotfiles
10 lines
320 B
Plaintext
10 lines
320 B
Plaintext
#!/usr/bin/env nix-shell
|
|
#! nix-shell -i bash -p ffmpeg youtube-dl
|
|
youtube-dl -f bestaudio -o "ytmp3.%(title)s.%(ext)s" "$1"
|
|
file=$(echo ytmp3.*.*)
|
|
newfile=$(echo $file | cut -c 7-)
|
|
mv "$file" "$newfile"
|
|
ffmpeg -i "$newfile" -c:a mp3 "${newfile%.*}.mp3"
|
|
rm "$newfile"
|
|
#trust me ive a reason for lossy->lossy transcoding
|