• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

simonmeusel/MuteSpotifyAds: A efficent MacOS application automatically silencing ...

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称(OpenSource Name):

simonmeusel/MuteSpotifyAds

开源软件地址(OpenSource Url):

https://github.com/simonmeusel/MuteSpotifyAds

开源编程语言(OpenSource Language):

Swift 98.0%

开源软件介绍(OpenSource Introduction):

MuteSpotifyAds

size download size macOS version support

This is a native and efficient macOS application automatically silencing ads on the Spotify desktop app.

This application is very CPU and power efficient, since it only checks for an ad when a new song gets played.

This application is not in any way affiliated with Spotify.

Features

  • Mute ads
  • Endless private session
  • Song log file
  • Restart spotify to skip ads
  • Auto-start Spotify with MuteSpotifyAds or run MuteSpotifyAds at startup

Usage

Instead of running Spotify directly, start this application. It will automatically start Spotify. Furthermore it will mute any ads it sees. When you close Spotify this program will also terminate, and thus it no longer has any effect on your battery or CPU.

As of version 1.5.0 you can also enable a option to automatically skip ads, by restarting Spoitify. Therefore, click the ☀︎ in the status bar of your mac (at the top of your screen), and then click ◎ Restart to skip ads.

Installation

Via homebrew: brew cask install mutespotifyads

Manual installation:

  1. Download this application from the releases page
  2. Move it to your Applications folder
  3. Run it using Right Click -> Open. You need to do this because I don't pay Apple $99 every year.
  4. If you like the app, leave a star!

This application is tested from macOS High Sierra (10.13.5) to and macOS Catalina (10.15.1) with Spotify 1.1.19.480.g7d17e3ce.

To uninstall the application, you can simply trash MuteSpotifyAds.app.

Troubleshooting

If the Application does not work, follow the steps for enabling a endless private Spotify session.

Endless private Spotify session

You can also use this application to enforce a endless private session. This requires you to grant this application additional priviledges. To enable them, do the following:

  1. Go to System PreferencesSecurity & PrivacyPrivacy tab → Accessibility → Enable the check mark next to this application.
  2. Go to System PreferencesSecurity & PrivacyPrivacy tab → Automation → Enable the check marks next to this application (for Spotify and System Events).

To enable/disable the endless private session, click the ☀︎ in the status bar of your mac (at the top of your screen), and then click ∞ Private session. This will ensure that the Spotify private session is enabled whenever the current song changes.

The state of the endless private session will be saved and restored on program restart.

This application enables the private session using the following apple script:

tell application "System Events" to tell process "Spotify"
tell menu bar item 2 of menu bar 1 -- AppleScript indexes are 1-based
tell menu item "Private Session" of menu 1
set isChecked to value of attribute "AXMenuItemMarkChar" is "✓"
if not isChecked then click it
end tell
end tell
end tell

How is it so efficient?

Whenever the track changes, the following file will get modified by Spotify:

# When a song plays next
~/Library/Application Support/Spotify/Users/($SPOTIFY_USER_NAME)-user/recently_played.bnk
# When a ad plays next
~/Library/Application Support/Spotify/Users/($SPOTIFY_USER_NAME)-user/ad-state-storage.bnk

This application simply watches for a change at those files and then runs the following apple script, to detect ads:

tell application "Spotify" to (get spotify url of current track)

If the Spotify URL starts with spotify:ad, the volume will be set to 0. Once a normal track plays, your initial volume will be restored (if you haven't already enabled sound man).

To set and get the volume, the following apple script is used:

tell application "Spotify" to (get sound volume)
tell application "Spotify" to set sound volume to ($VOLUME)

Using those techniques, it uses only 0.4% CPU when the track changes (rate: 5 seconds), and 0% in idle. It has a energy impact of less than one tenth of Spotify when the track changes, and a energy impact of 0.0 - 0.1 in idle.

Contributing

If you want to contribute, feel free to do so. If you need help, just open a issue.

You can also contribute by adding support for another language. To do so, clone the repo, and then follow the instruction from this image. Then add the translations and open a pull request.

Currently supported languages are:

  • Chinese
  • English
  • German
  • Italian
  • Spanish
  • Turkish

Thanks

Thanks to Carlo Federico Vescovo for the restart-spotify feature, the auto-start option and help with the documentation! Thanks to Artem Gordinsky and the other contributors of Spotifree! Thanks to vadian for the help!

License

GNU General Public License v3.0

Copyright (C) 2018 Simon Meusel




鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap