This commit is contained in:
elenapan 2020-04-08 01:06:17 +03:00
commit 6f06cfe6a4

View file

@ -56,9 +56,10 @@ main() {
# Get URL
linktoplay="$(grep -m 1 "$choice" $playlist_file | cut -d '@' -f 2)"
# If the choice does not exist, exit
# If the choice does not exist, try searching for it
if [ ${#linktoplay} -eq "0" ]; then
exit 1
yid=$(youtube-dl ytsearch:"$choice" -s | grep "\[youtube\]" | cut -d ']' -f 2 | awk -F ':' '{print $1}' | cut -c 2-)
linktoplay=https://www.youtube.com/watch\?v\="$yid"
fi
# Send notification