Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/dangom/apple-music.el

Search through the apple music catalog from within Emacs
https://github.com/dangom/apple-music.el

Last synced: about 1 month ago
JSON representation

Search through the apple music catalog from within Emacs

Awesome Lists containing this project

README

        

#+TITLE: Apple-Music.el

This small library implements apple music search from within Emacs. After searching, it opens the selection in iTunes.

* Installation

Because it relies on Applescript to call up iTunes, I assume this library will only work for MacOS users. This project is not on Melpa yet, so until then, download the file and put it somewhere your Emacs can find it. Then:

#+BEGIN_SRC emacs-lisp
(use-package apple-music
;; Set this to the country of your apple store region. E.g. "us", "de"
:config (setq apple-music-store-region "nl"))
#+END_SRC

Note: iTunes has a bug in that searching for a song using the applescript API will highlight that search entry in iTunes but not select it. If it were selected, all we'd have to do is send a button press. Unfortunately, because the content is not selected we have to work around and read the elements of the UI. This requires extra accessibility permissions.

* Usage
Call =apple-music-search=, or assign it to your favorite keybinding to initiate the search. Note that this library relies on the iTunes Search API, so if you perform more than 20 searches per minute your IP will probably be blocked.

* TO DOs

- Automatically start playing the selection :: Quite hard actually, as a bug in iTunes means that the selected text is not considered to be selected until manually clicked upon. See [[https://stackoverflow.com/questions/49647648/applescript-play-music-from-itunes-url][this issue over at SO.]]
- Suggest previously played songs :: In the same spirit that Helm-mini offers both a list of buffers and a list of recentf, this library could cache previously chosen songs and offer them again.
- Default to selected region or previous entry :: If a text is selected, use it as the default search term. If not, use a previous entry.
- Add support for searches in own library :: For example implementation in JS see https://github.com/mischah/itunes-remote
- Show current song in modeline :: If a song is playing, show it in the modeline. Plus points if clicking the modeline brings up music metadata.
- Improve UI :: For now completion read gives us "Kind: Title by Artist". Ideally we'd have a clearer interface, similar to what Org-Ref does for bib files.

No need to implement next or previous song, nor play/pause as the functionality is already present on any Mac keyboard and most other keyboards as well.