Nat! bio photo

Nat!

Senior Mull

Twitter Github Twitch

Making an Amazon Music Player for Linux

Screenshot of Amazon Music Player

Granted the Spotify player (App) is much, much better than the Amazon Music Player (Web).

But just for listening to some random music, Amazon isn’t too bad. Since I already have Prime, I don’t get ads. Whereas Spotify gives me an ad like every 10 minutes (and always the same ads…).

I use Amazon Music as a “radio” and Spotify, if I want to listen to a specific track. So whats wrong with Amazon Music in a Firefox browser tab ?

  • it’s inconvenient to locate the tab quickly, to skip a song
  • music stops, when I restart the browser or accidentally close too many tabs
  • can’t see whats playing at a glance
  • lame look and feel
  • my Firefox clears cookies, so I have to re-login every time

Fail 1 : Amazon Music Player app

There is an actual “Amazon Music Player” app, but it is just a electron junk app that wraps the website. And it’s not available on Linux. I tried running it in a Windows VM, but this is just not convenient enough to bother with.

Fail 2 : Custom service in Ferdium

I thought it would be kinda neat to create a service in Ferdium for Amazon Music. That wasn’t very hard, but the Ferdium browser couldn’t provide the required DRM plugin. I didn’t try very hard to figure out, how to enable DRM in Ferdium though, because I got a better idea…

Success : Custom Firefox profile

You can run multiple Firefox instances with their own profiles.

  1. Use the firefox --ProfileManager to create a Amazon Music profile. Before saving, mark the original “default” profile as the “Use the selected profile without asking at startup” and not the new “Amazon Music” profile!
  2. Start Firefox with the new profile firefox -P 'Amazon Music'. Configure this Firefox profile, so everything is super permissive. This instance won’t be used for browsing.
  3. Open Amazon Music Player in this profile, accept all cookies. Let Firefox install DRM extensions. Login and navigate to the place which you want to be your home page. Make this your home page in Firefox settings.
  4. Remove all GUI elements manually, except the navigation bar which contains the search bar.
  5. In about:config set toolkit.legacyUserProfileCustomization.stylesheets to true
  6. Copy MrOtherGuys userChrome.css into ~/.mozilla/firefox/*.Amazon\ Music/chrome/userChrome.css
  7. Create desktop file for GNOME (see below)
  8. Restart and enjoy

Amazon Music GNOME desktop file

Place this text into a ~/.local/share/applications/amazon-music.desktop file:

[Desktop Entry]
Version=1.0
Type=Application
Name=Amazon Music Player
Comment=Play Music with Amazon Music Prime
GenericName=Music Player
Categories=GNOME;GTK;Network;Music
Keywords=Amazon;Player;Music
Icon=amazon-music
Exec=firefox -P Amazon\ Music --class AmazonMusic %u
StartupWMClass=AmazonMusic
Terminal=false
StartupNotify=true

Place this SVG SVG file (Wikipedia) into ~/.local/share/icons/hicolor/symbolic/apps/amazon-music.svg.


Post a comment

All comments are held for moderation; basic HTML formatting accepted.

Name:
E-mail: (not published)
Website: