From cde49f9ddb635bb0043eebc328908e31fe32ff2f Mon Sep 17 00:00:00 2001 From: DT Date: Fri, 26 Apr 2019 17:28:49 -0400 Subject: [PATCH] remove :user:[a-zA-Z0-9]+ from playlist uri --- spotify | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/spotify b/spotify index 46f816f..1a551cd 100755 --- a/spotify +++ b/spotify @@ -234,18 +234,18 @@ while [ $# -gt 0 ]; do results=$( \ curl -s -G $SPOTIFY_SEARCH_API --data-urlencode "q=$Q" -d "type=playlist&limit=10&offset=0" -H "Accept: application/json" -H "Authorization: Bearer ${SPOTIFY_ACCESS_TOKEN}" \ - | grep -E -o "spotify:user:[a-zA-Z0-9_]+:playlist:[a-zA-Z0-9]+" -m 10 \ + | grep -E -o "spotify:playlist:[a-zA-Z0-9]+" -m 10 \ ) count=$( \ - echo "$results" | grep -c "spotify:user" \ + echo "$results" | grep -c "spotify:playlist" \ ) if [ "$count" -gt 0 ]; then random=$(( $RANDOM % $count)); SPOTIFY_PLAY_URI=$( \ - echo "$results" | awk -v random="$random" '/spotify:user:[a-zA-Z0-9]+:playlist:[a-zA-Z0-9]+/{i++}i==random{print; exit}' \ + echo "$results" | awk -v random="$random" '/spotify:playlist:[a-zA-Z0-9]+/{i++}i==random{print; exit}' \ ) fi;;