1
0
mirror of https://github.com/danog/id3bot.git synced 2024-11-30 04:19:02 +01:00
id3bot/question
2016-06-17 00:26:08 +02:00

26 lines
1.2 KiB
Bash
Executable File

#!/bin/bash
# Licensed under GPLV3
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")
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; }
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;;
esac
read "read"
[ "$read" != "null" ] && id3v2 --$f "$read" "$name"
done
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"
echo "myfilelocationstartshere $name"
exit