[
  {
    "path": "README.md",
    "content": "# SpotifyAdBlocker-macOS\n\n## DISCLAIMER : I can't maintain this project anymore as I don't have a Mac. PR will be reviewed and accepted.\n\n---\n\nScript based on [Ruvelro/Spotihosts](https://github.com/ruvelro/Spotihosts) which adds a few lines to hosts file to block Spotify ads.\n\n## Install \n\nRun this at the Terminal : \n`sudo bash -c \"$(curl -Ss https://raw.githubusercontent.com/amgxv/SpotifyAdBlocker-macOS/master/install.sh)\"`\n\n### Uninstall\n\nRun this at the Terminal : \n`sudo bash -c \"$(curl -Ss https://raw.githubusercontent.com/amgxv/SpotifyAdBlocker-macOS/master/uninstall.sh)\"`\n\n### Update \n\nRun this at the Terminal : \n`sudo bash -c \"$(curl -Ss https://raw.githubusercontent.com/amgxv/SpotifyAdBlocker-macOS/master/update.sh)\"`\n\n### How can I assure that hosts are enabled or deleted?\n* Open your Terminal\n* Run ```cat /private/etc/hosts```\n* If you can see the following [hosts](https://raw.githubusercontent.com/amgxv/SpotifyAdBlocker-macOS/master/hosts/hosts.txt) below ```#[Spotify Ad-Block Hosts]``` line you have the correct hosts configured.\n* If you want to fully assure that hosts are completely removed from your system, check if there are hosts remaining from other Spotyblock versions\n* You can edit this hosts file with your favorite text editor, you'll need admin privileges to edit this file\n"
  },
  {
    "path": "hosts/hosts.txt",
    "content": "0.0.0.0 adeventtracker.spotify.com\n:: adeventtracker.spotify.com\n0.0.0.0 ads-fa.spotify.com\n:: ads-fa.spotify.com\n0.0.0.0 analytics.spotify.com\n:: analytics.spotify.com\n0.0.0.0 audio2.spotify.com\n:: audio2.spotify.com\n0.0.0.0 b.scorecardresearch.com\n:: b.scorecardresearch.com\n0.0.0.0 bounceexchange.com\n:: bounceexchange.com\n0.0.0.0 bs.serving-sys.com\n:: bs.serving-sys.com\n0.0.0.0 content.bitsontherun.com\n:: content.bitsontherun.com\n0.0.0.0 core.insightexpressai.com\n:: core.insightexpressai.com\n0.0.0.0 crashdump.spotify.com\n:: crashdump.spotify.com\n0.0.0.0 desktop.spotify.com\n:: desktop.spotify.com\n0.0.0.0 ds.serving-sys.com\n:: ds.serving-sys.com\n0.0.0.0 gtssl2-ocsp.geotrust.com\n:: gtssl2-ocsp.geotrust.com\n0.0.0.0 log.spotify.com\n:: log.spotify.com\n0.0.0.0 media-match.com\n:: media-match.com\n0.0.0.0 omaze.com\n:: omaze.com\n0.0.0.0 redirector.gvt1.com\n:: redirector.gvt1.com\n0.0.0.0 s0.2mdn.net\n:: s0.2mdn.net\n0.0.0.0 v.jwpcdn.com\n:: v.jwpcdn.com\n0.0.0.0 weblb-wg.gslb.spotify.com\n:: weblb-wg.gslb.spotify.com\n0.0.0.0 www.omaze.com\n:: www.omaze.com"
  },
  {
    "path": "hosts/old_hosts.txt",
    "content": "0.0.0.0 adeventtracker.spotify.com\n:: adeventtracker.spotify.com\n0.0.0.0 ads-fa.spotify.com\n:: ads-fa.spotify.com\n0.0.0.0 analytics.spotify.com\n:: analytics.spotify.com\n0.0.0.0 audio2.spotify.com\n:: audio2.spotify.com\n0.0.0.0 b.scorecardresearch.com\n:: b.scorecardresearch.com\n0.0.0.0 bounceexchange.com\n:: bounceexchange.com\n0.0.0.0 bs.serving-sys.com\n:: bs.serving-sys.com\n0.0.0.0 content.bitsontherun.com\n:: content.bitsontherun.com\n0.0.0.0 core.insightexpressai.com\n:: core.insightexpressai.com\n0.0.0.0 crashdump.spotify.com\n:: crashdump.spotify.com\n0.0.0.0 desktop.spotify.com\n:: desktop.spotify.com\n0.0.0.0 ds.serving-sys.com\n:: ds.serving-sys.com\n0.0.0.0 gtssl2-ocsp.geotrust.com\n:: gtssl2-ocsp.geotrust.com\n0.0.0.0 log.spotify.com\n:: log.spotify.com\n0.0.0.0 media-match.com\n:: media-match.com\n0.0.0.0 omaze.com\n:: omaze.com\n0.0.0.0 redirector.gvt1.com\n:: redirector.gvt1.com\n0.0.0.0 s0.2mdn.net\n:: s0.2mdn.net\n0.0.0.0 v.jwpcdn.com\n:: v.jwpcdn.com\n0.0.0.0 weblb-wg.gslb.spotify.com\n:: weblb-wg.gslb.spotify.com\n0.0.0.0 www.omaze.com\n:: www.omaze.com\n.0.0.0 omaze.com\n0.0.0.0 spclient.wg.spotify.com\n"
  },
  {
    "path": "install.sh",
    "content": "#!/usr/bin/env bash\n\nif [ \"$EUID\" -ne 0 ]; then\n  printf \"\\nThis script needs to be run as root.\\nPassword will be asked...\\n\"\n  sudo \"$0\"\n  exit\nfi\n\nclear\nprintf \"\\nThis script will edit your hosts file... \\n\"\nprintf \"\\nDo you want to continue? [y|n] \\n\"\nread -r conf\n\nif [[ $conf = Y ]] || [[ $conf = y ]]; then\n  clear\n  \n  if grep -q \"Spotify Ad-Block Hosts\" \"/private/etc/hosts\"; then\n    printf \"You have already ran this script\\n\"\n    read -rp \"  Press enter to exit\"\n    clear\n    exit 0\n  fi\n  \n  echo -e \"#[Spotify Ad-Block Hosts]\" >> \"/private/etc/hosts\"\n  curl -Ss https://raw.githubusercontent.com/amgxv/SpotifyAdBlocker-macOS/master/hosts/hosts.txt -o /tmp/spotyblockhosts\n  while read -r line\n  do\n    echo -e $line >> \"/private/etc/hosts\"\n  done < \"/tmp/spotyblockhosts\"\n\n  rm /tmp/spotyblockhosts\n  killall mDNSResponder\n  killall mDNSResponderHelper\nelif [[ $conf = N ]] || [[ $conf = n ]]; then\n  clear\n  exit 0\nelse\n\tprintf \"\\nInvalid value, program will exit...\\n\"\n\tread -rp \"  Press enter to exit\"\n\texit 1\nfi\n\nif grep -q \"Spotify Ad-Block Hosts\" \"/private/etc/hosts\"; then\n  clear\n  printf \"Hosts file modified successfully!\n  Enjoy Spotify without Ads\\n\"\n  read -rp \"  Press enter to exit\"\n  clear\nelse\n  clear\n  printf \"Error modifying hosts file :c\\n\"\n  read -rp \"  Press enter to exit\"\n  clear\nfi\n"
  },
  {
    "path": "uninstall.sh",
    "content": "#!/usr/bin/env bash\n\necho \"Uninstalling Spotyblock...\"\nsudo sed -i -e \"/#\\[Spotify Ad-Block Hosts\\]/d\" \"/private/etc/hosts\"\ncurl -Ss https://raw.githubusercontent.com/amgxv/SpotifyAdBlocker-macOS/master/hosts/hosts.txt -o /tmp/spotyblockhosts\ncurl -Ss https://raw.githubusercontent.com/amgxv/SpotifyAdBlocker-macOS/master/hosts/old_hosts.txt -o /tmp/spotyblockoldhosts\n\nwhile read -r line\ndo\n  sudo sed -i -e \"/$line/d\" \"/private/etc/hosts\"\ndone < \"/tmp/spotyblockhosts\"\n\nwhile read -r line\ndo\n  sudo sed -i -e \"/$line/d\" \"/private/etc/hosts\"\ndone < \"/tmp/spotyblockoldhosts\"\n\nrm /tmp/spotyblockhosts\nrm /tmp/spotyblockoldhosts\nsudo killall mDNSResponder\nsudo killall mDNSResponderHelper\n"
  },
  {
    "path": "update.sh",
    "content": "#!/usr/bin/env bash\n\nbash <(curl -Ss https://raw.githubusercontent.com/amgxv/SpotifyAdBlocker-macOS/master/uninstall.sh)\nbash <(curl -Ss https://raw.githubusercontent.com/amgxv/SpotifyAdBlocker-macOS/master/install.sh)\n"
  }
]