Git Product home page Git Product logo

beatbind's Introduction

BeatBind - Spotify Global Hotkeys

build version python contributions welcome

Are you tired of constantly switching back and forth between your game and Spotify just to adjust the volume? With this app, you can finally control Spotify and adjust it's volume separately, all without the hassle of alt+tabbing.

This background Python Windows application utilizes the global_hotkeys module to listen for basic hotkeys, allowing users to easily control Spotify without the window focused. The app leverages the power of Spotify's Web API through the use of Spotipy, providing seamless integration between the app and the music streaming platform.

You'll create your own Spotify API to control your Spotify application. YOU are the one in control.



Buy Me A Coffee

This app does not control your Spotify locally. It sends an API request over the internet to control your Spotify, so expect a slight delay. The delay experienced can vary depending on your internet speed.

Please see FAQ for more information or if you encounter any issues. If your issue isn't listed, please create an Issue ticket.

Table of Contents

Download

Download the latest version from the Releases page.

The .exe file is within the root of the BeatBind folder with the other files and folders. Search or sort by file type to find the .exe file.

You can build the .exe yourself with the provided build command in the build.py file.

Requirements

  • Internet connection
  • Windows 10/11
  • Spotify App on your device of choice
  • Spotify Premium
    • Unfortunately, the endpoints used in Spotify's Web API only works for premium users, so it's not possible for this app to work for free users. There are other apps online that work locally instead, allowing it to work for free and premium users.

Instructions

After downloading the .zip folder, extract the contents somewhere on your computer.

*If you extracted it to your Program Files folder, you'll need to run the app in admin mode to be able to write and save your settings and token. I recommend placing it somewhere else.

The app requires the user to input three fields:

Client ID and Client Secret

  1. To obtain the Client ID and Client Secret, head to the following link Spotify for Developers.
  2. Sign-in and click on your profile in the top-right corner, then click on "Dashboard".
  3. Click on the "Create app" button to the right.
  4. Enter any "App name" and "App description" you want.
  5. In the app, you can change the Port field if it's already being used on your local network.
  6. Back on the website, enter the following into "Redirect URI" with the port you chose (e.g., 8888):
    http://localhost:8888/callback
    
  7. Click on the checkbox and then "Save".

  8. Click on the "Settings" button to the top-right.
  9. Copy your Client ID and Client Secret (press "View client secret") and paste it into the BeatBind app.

Device ID

  1. To obtain your Device ID, press the button "Get Devices" in the BeatBind app once your Client ID and Client Secret are filled in.
  2. Click on the drop-down arrow and select your device of choice.
  3. If you don't see your device listed:
    • Open the Spotify app (not the web player) on that device and play something, then check again.
    • If you still don't see your devices, manually obtain it by heading to this link and then click on the green "Try it" button to the right. Copy and paste the id into the app.

Once you're done, click on Save within the app to save your settings. Click on Start & Close to close the window and start listening for your hotkeys!

You can open the settings again by right-clicking on the app's system tray icon.

Updating

  1. Copy and save your beatbind-config.json file somewhere
  2. Replace your BeatBind folder with the updated version
  3. Paste inside the folder your saved beatbind-config.json file

Troubleshooting

Please go through the below steps before creating an Issue ticket.

  1. Is your issue hotkey related? This app uses the global_hotkeys module by btsdev: https://github.com/btsdev/global_hotkeys. I recommend creating the Issue ticket there so they can solve your issue. Once it's solved, create an Issue ticket here and let me know to update the app.
  2. Exclude the BeatBind folder from your anti-virus software.
  3. If your settings are not saving, please see Why Are My Settings Not Saving?
  4. If your app is not starting/opening, please see Why Is The App Crashing?
  5. If your app is not starting on Windows startup, please see Why Isn't The App Starting on Windows Startup?
  6. If you're getting a "Server listening on localhost has not been accessed error", please see Server Listening On Localhost Has Not Been Accessed Error and Issue #12
  7. Make sure your Client ID and Secret is correct and matches what is displayed in the Spotify developer site.
  8. Check if you have the Spotify app installed, and make sure the Device ID selected is the correct one.
  9. Check if you're able to see the app within the system tray after pressing Start & Close.
  10. After confirming the above and it still doesn’t work, it is likely a port problem and you’re already using the selected port on your network. Choose a different port in the app, and also change the Redirect URI set in the Spotify developer site.

FAQ

Free Users?

Unfortunately, the endpoints used in Spotify's Web API only works for Spotify premium users, so it's not possible for this app to work for free users. There are other apps online that work locally instead, allowing it to work for free and premium users.

How Do I Disable Certain Hotkeys?

  1. Uncheck all of the Modifiers checkboxes.
  2. In the Key field, press "Backspace" or "Delete" on your keyboard to clear the field.

Where Is My Information Saved?

Your information is stored locally within the BeatBind folder. It stores your configuration settings and the token information required to interact with Spotify's Web API.

What Information Is Saved?

There are two files stored within the BeatBind folder:

  1. beatbind-config.json, which contains your Client ID, Secret, Port, Device ID, and your hotkey combinations.
  2. .cache, which contains your token information to communicate with the Spotify app.

Why Are My Settings Not Saving?

You most likely extracted the BeatBind folder into a location where it requires Administrator privileges, such as the Program Files folder. Place the BeatBind folder into a different location, or try running the app in admin mode.

Why Isn't The App Starting on Windows Startup?

This happens if the location of the .exe file was changed. The registry key used to start the app on Windows startup needs to be updated to the new .exe path. Starting the app again will update the path in the registry key and should resolve the issue.

If it still does not resolve the issue, try moving the BeatBind folder into a another location, such as your desktop.

You can check if the registry key was added correctly in the following path of Registry Editor:

Computer\HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run

Why Is The App Crashing?

  1. If you had "Start minimized" checked, you can find the app's icon hidden within your system tray and then right-click on it to find the settings menu.
  2. Within your BeatBind folder, delete the following files and try to open it again:
    • beatbind-config.json
    • .cache

My Hotkeys Stop Registering After Waking From Sleep

There are rare cases where hotkeys stop registering on system wake up from sleep, and pressing Start & Close button again fixes the listener. For a more permanent fix, try disabling Windows Fast Startup. If the bug keeps occurring after disabling Fast Startup, please create an Issue ticket.

Server Listening On Localhost Has Not Been Accessed Error

Please see the top answer solution from here https://superuser.com/questions/565409/how-to-stop-an-automatic-redirect-from-http-to-https-in-chrome

beatbind's People

Contributors

chriskjm avatar justinknguyen avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

beatbind's Issues

Usage WITHOUT Premium

Would highly appreciate it if you could make the app run without premium AKA without spotify's api for free users

Windows blocks app

Describe the bug
Windows Security is blocking the app from starting. I can allow the app to run under Actions and it will start, as a workaround.
image

Windows Key (Win+<key>)

Describe the solution you'd like
Being able to use Windows key to hold in as you push another key instead of ctrl/shift/alt. So, win+ins for play/pause for example.

Describe alternatives you've considered
Mapping some keys to those shortcut keys available like win+ins with autokey to ctrl+shift+alt p etc. But too much indirection.

Prevent/hijack key propagation

First off, thanks for the project, I've been looking for a working Toastify replacement for a while now!

Is your feature request related to a problem? Please describe.
I've used Ctrl+Shift+Z/X/C/V/B for global multimedia controls ever since WinAmp (and later Toastify) and while I'm able to use these with BeatBind as well, I quickly noticed that the hotkeys "leak" or get propagated and for example in Chrome whenever I CTRL+SHIFT+C to pause my song, the Chrome Dev Tools start inspecting and CTRL+SHIFT+B brings up the bookmarks bar.

Describe the solution you'd like
Make the hotkey "neutral" or somehoe stop the keypresses from being propagated.

Describe alternatives you've considered

Additional context

Rewind song instead of going to previous one

Back when I used Toastify, I sometimes utilised the option to go to the beginning of a song by pressing the "previous song" keybind (it would rewind to the start if more than 3 seconds of the song have elapsed, and go to the previous song otherwise).

I noticed that in this app this isn't a thing, so my feature request is to add that as a toggleable setting.

opening, then immediately closing

Describe the bug
Downloaded and working great yesterday. Today, did not launch when PC turned on. Was not displaying in system tray as it was yesterday either. Opened from the file location, and app would open then immediately close. Tried many times, and finally was able to click in the app fast enough, but it would close just a moment after. Hotkeys that were working yesterday are not working either.

To Reproduce
Steps to reproduce the behavior:

  1. Go to app
  2. Click on open/run
  3. Scroll down to '....' (N/A)
  4. See error

Expected behavior
Able to launch the app on startup, or even just when I open it as normal.

Desktop (please complete the following information):

  • OS: Windows 10
  • Version v1.1.0

Server listening on localhost has not been accessed error

  • I filled the ClientID, ClientSecret and Port fields according to the instruction
  • After clicking Get Devices button the browser opens and I receive the following error in a few seconds.

BeatBind_UMx9jsFVhv

In the browser I receive an error: ERR_CONNECTION_REFUSED

I've tried several different free ports but the problem remains. Also I've tried running Chrome in safe mode but that didn't helped.

  • OS: Windows 10
  • Version 1.3.0

Settings are not saved on PC startup

Describe the bug
Each morning that I turn on my PC, the BeatBind window pops up and I must redo all of my settings including the client ID and device ID, as if starting BeatBind for the first time.

To Reproduce
Steps to reproduce the behavior:
Add the client ID, client secret, click on get devices and select my device. Then I unselect 'shift' in the modifiers for play/pause, previous track and next track. Then I update the play/pause key to be 'up'. Then I check 'start on windows startup' and 'start minimized'. Then I click 'save' and then I click 'start & close'.

Expected behavior
I expect my settings to save.

Desktop (please complete the following information):

  • OS: Windows 11 Home, 22H2, Build 22621.3155
  • Version 1.3.0

Does not work.

I downloaded your program, i did everything you said but it didnt work, when i press the hotkey it doesnt do anything. Does it need to download something else besides your program ?

Being able to bind Media control keys on the keyboard to the program

Is your feature request related to a problem? Please describe.
Not a problem but a small inconvinience for people who already have media controls on their keyboards like Corsair K95 and Razor Huntsman

Describe the solution you'd like
Media keys already present on many keyboards can be used as 1 button binds but the program fails to register media keys for keybinds, this includes Play/Pause, stop, next /prev track and Volume roller/dial/bittons.

Describe alternatives you've considered
for now i used AHK to make a workaround to this by binding keyboard media keys to the shortcuts bound in the program but its yet another process running in the bg..

Additional context
Would really appreciate if you could honor this feature request, was looking for a program like this for the longest time and 90% perfect the way it is. i want to thank you for taking the effort to make something like this!

Use of special characters like "æ, ø, å" crashes app with no error

Describe the bug
If you use any special characters for hotkeys, such as the Scandinavian "æ", "ø" and "å", then the app will not start when pressing the "Start & Close" button. It fails silently with no shown error, and I was not able to find any kind of logfile. Replacing the characters with non-special characters made the program start up succesfully.

To Reproduce
Steps to reproduce the behavior:

  1. Set any hotkey to use any of the special characters I mentioned.
  2. Click on "Save" button.
  3. Click on "Start & Close" button.
  4. Notice app fails to start.

Expected behavior
I expected the app to start.

Screenshots
Not applicable.

Desktop (please complete the following information):

  • OS: Windows 11 23H2, build 22631.3447
  • Version 1.5.2 (I also checked with version 1.5.1)

Additional context
Here is the hotkey settings taken from beatbind-config.json:

    "hotkeys": {
        "play/pause": "control+\u00e6",
        "prev_track": "control+alt+\u00e6",
        "next_track": "control+\u00f8",
        "volume_up": "control+shift+\u00f8",
        "volume_down": "control+shift+\u00e6",
        "mute": "",
        "seek_forward": "",
        "seek_backward": ""
    }

Not launching on startup.

Describe the bug
Beatbind doesn't launch on startup despite the registry key possessing the correct path, the task being enabled in the startup tab in task manager, and startup set to true in the config json.

To Reproduce
Not really applicable because I'm not getting an error message but:

  1. Launch Beatbind
  2. Tick "Start on Windows startup" and "Start minimized"
  3. Click "Save"
  4. Restart PC
  5. Beatbind doesn't start with windows

Expected behavior
It should launch on startup.

Screenshots
From config.json
image

From the registry key that holds the path to the executable:
image

From task manager>startup tab:
image

Desktop (please complete the following information):

  • OS: Windows 10 Enterprise LTSC
  • Version: 21H2

Additional context
N/A but even though this feature isn't functioning correctly at the moment, I am grateful that you created this utility.

No delay after button press option?

I started using this tool just recently and it works well, but one thing I noticed is that each time I press a set hotkey combination, be it pause/play, next track or volume control, there's always a very noticeable delay between the button press and the action. This is particularly... annoying when I need to lower the volume significantly and quickly (for example when a song in a playlist sound much louder than a previous one), so I start smashing the volume down combo and the delays kinda start stacking leading to a sudden significant volume drop a second or two later, after my button presses register. I'm not sure if this delay is a bug or a feature, but it would be nice to have an option to have your hotkey presses have an instant effect without any delay, if it's possible. I know BeatBind is it's own program so not comparing the two, but I've been using a similar tool called Toastify before it for years (until as it stopped working for me completely just recently) and the hotkey presses were always registering instantly with it, so I'm guessing it would be possible to implement this on BeatBind as well, right? Perhaps as a separate option? Thanks.

Please add a MUTE bind feature

I previously used Toasify to control Spotify via keyboard binds. I use a joystick controller (aurdino) to control a button/knob for audio volume +/- and I would love to also be able to push the button to MUTE Spotify.

In Toastify, I bound the three to keyboard actions, which is fine and would work for me, but really I would love to be able to use a Joystick device to control Spotify. You can download a great Joystick emulator to test out here: https://github.com/shauleiz/vJoy
There's newer forks that you can access from the original page.

So my feature request is to add a MUTE feature.

Incorrect handling of keybindings

Describe the bug
Keybindings still work even if some extra buttons are pressed.

To Reproduce
Steps to reproduce the behavior:

  1. Set the Play\Stop binding as Ctrl+P
  2. Save
  3. Press Ctrl+Shift+P or Ctr+Alt+P or any other combination, but it must include keys which are specified in key binding
  4. Play\Stop actions work

Expected behavior
Keybinding should work when and only when keys in the binding are pressed. So if Play\Stop is bent to Ctrl+P, it should not work when Ctrl+Shift+P or any other combination, only when exactly Ctrl+P is pressed.

Desktop (please complete the following information):

  • OS: Windows 10
  • Version v1.2.0

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.