2016-01-05 17:01:28 +01:00
#!/bin/bash
2016-01-05 17:15:14 +01:00
2016-06-17 00:26:08 +02:00
# Licensed under GPLV3
2016-04-19 11:49:35 +02:00
2016-06-04 22:34:44 +02:00
echo "Send me the audio files that you whish to modify (up to 1.5 gigabytes thanks to @pwrtelegram)"
read url
url=$(echo "$url" | sed 's/^\s*//g;s/\s*$//g')
name="$RANDOM"$(basename "$url")
2016-06-17 00:26:08 +02:00
wget "$url" -qO "$name" || { echo "Couldn't download file. Please try again in a few minutes."; rm "$NAME" &>/dev/null; exit 1; }
mimetype "$name" | sed 's/.*\s//' | grep -qE '^audio/' || { echo "You didn't send me an audio file."; rm "$NAME" &>/dev/null; exit 1; }
2016-06-04 22:34:44 +02:00
help=$(id3v2 --help 2>&1)
echo "Now send me the following tags (send null to ignore tag)"
for f in artist album song comment genre year track;do
echo "$help" | sed '/\-\-'$f'/!d;s/.*\-\-'$f'//g'
case "$f" in
"comment") echo "Set the comment information (both description and language optional)";;
"genre") id3v2 -L | tr -s '\n' ", " | tr -d '&';echo;;
2016-01-05 17:01:28 +01:00
esac
2016-06-04 22:34:44 +02:00
read "read"
[ "$read" != "null" ] && id3v2 --$f "$read" "$name"
2016-01-05 17:01:28 +01:00
done
2016-06-17 00:26:08 +02:00
echo "Send /start to restart the process and check out my other bots: @video_dl_bot, @mklwp_bot, @caption_ai_bot, @cowsaysbot, @cowthinksbot, @figletsbot, @lolcatzbot, @filtersbot, @id3bot, @pwrtelegrambot"
2016-06-04 22:34:44 +02:00
echo "myfilelocationstartshere $name"
2016-01-05 17:01:28 +01:00
exit