Closed janaasaad closed 3 years ago
I don't see any errors, can you tell me what's going wrong?
Hi Adriano,
Thanks for getting back to me. The script didnโt mute the ads and there was an error message showing up at the bottom. I thought I copied and pasted the whole thing. I was using Spotify o the browser but figured it should work if I use the app?
Thanks, Jana
Get Outlook for iOShttps://aka.ms/o0ukef
From: Adriano Galello notifications@github.com Sent: Sunday, February 21, 2021 1:51:55 AM To: gdi3d/mute-spotify-ads-mac-osx mute-spotify-ads-mac-osx@noreply.github.com Cc: janaasaad jana.asad@gmail.com; Author author@noreply.github.com Subject: Re: [gdi3d/mute-spotify-ads-mac-osx] Error with mute-spotify-ads for mac (#7)
I don't see any errors, can you tell me what's going wrong?
โ You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/gdi3d/mute-spotify-ads-mac-osx/issues/7#issuecomment-782829727, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AS5W2IWS66AQZEFKAZZPURLTADJTXANCNFSM4X6TPVXQ.
Yes, the script is for the Spotify app.
I will close the ticket then. Thanks for contributing anyways ๐๐ป
Thanks Adriano!
Get Outlook for iOShttps://aka.ms/o0ukef
From: Adriano Galello notifications@github.com Sent: Monday, February 22, 2021 12:50:20 AM To: gdi3d/mute-spotify-ads-mac-osx mute-spotify-ads-mac-osx@noreply.github.com Cc: janaasaad jana.asad@gmail.com; Author author@noreply.github.com Subject: Re: [gdi3d/mute-spotify-ads-mac-osx] Error with mute-spotify-ads for mac (#7)
Closed #7https://github.com/gdi3d/mute-spotify-ads-mac-osx/issues/7.
โ You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/gdi3d/mute-spotify-ads-mac-osx/issues/7#event-4358397897, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AS5W2IQPZNDIEITDXWVQ2ITTAILEZANCNFSM4X6TPVXQ.
!/bin/bash
CURRENT_VER=9
set -e
Detect OSX version
OSX_VERSION=$(defaults read loginwindow SystemVersionStampAsString) OSX_VERSION="${OSX_VERSION//.}"
OS_BIGSUR=1101 OS_CATALINA=10157 OS_MOJAVE=10146 OS_HIGH_SIERRA=10136 OS_SIERRA=10126 OS_EL_CAPITAN=10116 OS_YOSEMITE=10105 OS_MAVERICKS=1095 OS_MOUNTAIN_LION=1085 OS_LION=1075 OS_SNOW_LEOPARD=1068 OS_LEOPARD=1058 OS_TIGER=10411 OS_PANTHER=1039 OS_JAGUAR=1028 OS_PUMA=1015 OS_CHEETAH=1004
check for HDMI flag. In this case we will lower the volume of spotify application
instead of system audio
HDMI=0 if [ "$1" == "hdmi" ]; then HDMI=1 fi
check if version is up-to-date
INSTALLATION_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
check that curl is present in the system
if ! [ -x "$(command -v curl)" ]; then echo "curl command is not present. Auto Update function is disabled" else LATEST_VER=$(curl -s https://raw.githubusercontent.com/gdi3d/mute-spotify-ads-mac-osx/master/NoAdsSpotify.sh | grep "CURRENT_VER=" | head -n1 | awk -F '=' '{print $2}')
fi
echo echo "Spotify Ads will be silenced while this program is running!." echo "This program was downloaded from https://gdi3d.github.io/mute-spotify-ads-mac-osx/ (check for documentation here)" echo "If you are using HDMI speakers please run this command like this: sh ~/MuteSpotifyAds/NoAdsSpotify.sh hdmi" echo echo "If the program is not working properly please open an issue at: https://github.com/gdi3d/mute-spotify-ads-mac-osx/issues/new" echo echo "Press control+c to close this program or close the terminal window" echo
Regex of events that will tell us that a new song/ad is playing
SPOTIFY_EVENT_CATALINA="com.spotify.client.+nowPlayingItem.+{" SPOTIFY_EVENT_MOJAVE="com.spotify.client.+playbackQueue.+{"
Regex to detec ads
AD_REG="albumName = \"\";" SONG_REG="albumName = (\w+|\".+\");"
EVENT_PRESENT=0 # switch to 1 when a the regex SPOTIFY_EVENT_xxxx matches CURRENT_VOLUME=$(osascript -e "output volume of (get volume settings)") AD_DETECTED=0 # switch to 1 when an ad is playing
Set vars to prevent double print on alerts
MSG_AD_ECHOED=0 MSG_SONG_PLAYING_ECOHED=0
log stream --process="mediaremoted" --type="log" --color="none" --style="compact" | \ while read STREAM_LINE do
check for OS version and look for the event that tell us that
echo an error message before exiting on error
trap 'echo ">>> ๐ Oops! Something failed and the program is not running. Please open a new issue at: https://github.com/gdi3d/mute-spotify-ads-mac-osx/issues/new and copy and paste the whole output of this window into yet so I can fix it."' EXIT