Jump to content

Apple Music search with Alfred


Recommended Posts

  • 2 months later...

Hey @gingerbeardman. The workflow is really great!

 

However, I have one problem: 

 

When I am searching for song/artists/albums the results in Alfred work great. If, however, I hit the first option "Search Apple Music for songs matching <some name>", Apple Music opens and displays a spinning wheel loading animation in the middle of the screen which never ends.

 

Thanks,

McLawrence

Link to comment
  • 2 months later...
  • 2 weeks later...
  1. have Alfred with Powerpack
  2. install Workflow
  3. look at commands listed in Workflow (artist, album, song, etc)
  4. summon Alfred
  5. type command from earlier (artist, album, song, etc)

 

Note, this is an old workflow so requires one of the following folders to be present to work.

  • ~/Library/Caches/com.runningwithcrayons.Alfred-3/Workflow Data
  • ~/Library/Application Support/Alfred 3/Workflow Data
     
Edited by gingerbeardman
Link to comment
  • 2 months later...
  • 2 weeks later...

Stumbled over this post and ran into the same issues that other users have mentioned when running macOS Catalina 10.15.

 

After running the debug I saw a duplicate error showing a missing directory, so as an experiment, I ran the following in Terminal:

 

mkdir ~/Library/Caches/com.runningwithcrayons.Alfred-3/ && mkdir ~/Library/Caches/com.runningwithcrayons.Alfred-3/Workflow\ Data/

This created the directory where the python script returns album thumbnails from the Album & Song search commands.

 

Additionally since Catalina replaces iTunes.app with Music.app, I went through the three python scripts and archived some of the URL scheme that Music doesn't seem to need. I bumped up the workflow version to 2.1 for tracking purposes.

 

Search Apple Music.alfredworkflow [Google Drive]

 

Thanks to all the creators who have put this together!

 

Pro-Tip: Update Line 19/20 in the artist, album, and song python scripts to your country code to improve search results with images.

Link to comment
  • 6 months later...
On 4/9/2020 at 10:36 PM, morgdaddy said:

This is a great idea. For what it's worth, I'd definitely donate if you ever upgrade this to work with Catalina (totally get your aversion to it, but it came installed on my new machine so I went with it).

"I'll donate if you put yourself through a world of pain" that's not how this donation thing works. It should be "here's some money to try to persuade you to solve my problem". IMHO

 

On 4/19/2020 at 8:22 AM, godbout said:

seems only artist is working in the latest edition of that workflow? song and album return errors.

I use album search every day, works for me. See my note about missing directories, and the quote below.

 

On 4/21/2020 at 5:15 PM, Macchio said:

Stumbled over this post and ran into the same issues that other users have mentioned when running macOS Catalina 10.15.

 

After running the debug I saw a duplicate error showing a missing directory, so as an experiment, I ran the following in Terminal:

As I mentioned in my previous post!

Link to comment
  • 4 months later...
On 4/21/2020 at 6:15 PM, Macchio said:

Stumbled over this post and ran into the same issues that other users have mentioned when running macOS Catalina 10.15.

 

After running the debug I saw a duplicate error showing a missing directory, so as an experiment, I ran the following in Terminal:

 


mkdir ~/Library/Caches/com.runningwithcrayons.Alfred-3/ && mkdir ~/Library/Caches/com.runningwithcrayons.Alfred-3/Workflow\ Data/

This created the directory where the python script returns album thumbnails from the Album & Song search commands.

 

Additionally since Catalina replaces iTunes.app with Music.app, I went through the three python scripts and archived some of the URL scheme that Music doesn't seem to need. I bumped up the workflow version to 2.1 for tracking purposes.

 

Search Apple Music.alfredworkflow [Google Drive]

 

Thanks to all the creators who have put this together!

 

Pro-Tip: Update Line 19/20 in the artist, album, and song python scripts to your country code to improve search results with images.

 

Artist work for me, album and song doesn't 🤔 Any suggestions?

 

image.thumb.png.2596dd0c6624c403a5a53ba342b558e8.png

image.thumb.png.fa8a086231c10d2b9d15fe890a9e7e21.png

image.thumb.png.6ce7786c348f118d1862cc2c32bb08a1.png

 

Link to comment
1 minute ago, gingerbeardman said:

There was a problem with song, please re-download my 2.1 to fix that.

 

All now work for me.

 

 

Screen shot 2021-03-17 at 23.29.45.png

Screen shot 2021-03-17 at 23.35.50.png

Screen shot 2021-03-17 at 23.36.02.png

 

I downloaded the workflow from link https://drive.google.com/file/d/1XmXl5nq9Qn8Lvo7Zv1ESyCmaRDhyh-2u/view but I'm still seeing the same behavior. I just re-downloaded to make sure, no dice. When did you fix it? Latest change in the workflow files were April 21st 2020.

Link to comment

That's not my file, that's a modification by somebody else.

 

My original files are here: https://www.gingerbeardman.com/alfred/

 

I just fixed it before my last message.

 

Also, make sure you search for reasonable terms:

  • song taylor, generates an error somewhere at Apple for whatever reason (invalid resulting data?)
  • song shake it off, returns good results
  • song taylor shake, also good
Edited by gingerbeardman
Link to comment
9 minutes ago, gingerbeardman said:

That's not my file, that's a modification by somebody else.

 

My original files are here: https://www.gingerbeardman.com/alfred/

 

I just fixed it before my last message.

 

Also, make sure you search for reasonable terms:

  • song taylor, generates an error somewhere at Apple for whatever reason (probably too many results?)
  • song shake it off, returns good results
  • song taylor shake, also good

 

Ah my bad.. unfortunately still only artist work for me. Downloaded from https://www.gingerbeardman.com/alfred/Search Apple Music.alfredworkflow

 

image.thumb.png.627827d304416abe8c48463d586ed46b.png

image.thumb.png.8c6b9a30bafa293defd8f74ff0a6cd8b.png

Link to comment

How long are you waiting?

 

Queries take 5 to 15 seconds for me.

 

I've just re-uploaded the version I have here, just in case.

 

If it's not working after re-downloading one more time, then we'll have to debug:

  1. view the workflow in Alfred
  2. click the bug icon
  3. pop up alfred bar and do a query, eg. song hyperballad 
  4. copy the debug output from main Alfred window to a pastebin/gist
  5. paste a link to it here


I see this output: https://pastebin.com/raw/yAzL8WRb

 

 

Edited by gingerbeardman
Link to comment

I think the ones failing for you are the ones with thumbnail images.

 

So, please make sure you have the required folders:

  • ~/Library/Caches/com.runningwithcrayons.Alfred-3/
  • ~/Library/Caches/com.runningwithcrayons.Alfred-3/Workflow Data/

See earlier messages for more about this.

 

It's always good to read the thread :)

Link to comment
7 minutes ago, gingerbeardman said:

How long are you waiting?

 

Queries take 5 to 15 seconds for me.

 

I've just re-uploaded the version I have here, just in case.

 

If it's not working after re-downloading one more time, then we'll have to debug:

  1. view the workflow in Alfred
  2. click the bug icon
  3. pop up alfred bar and do a query, eg. song hyperballad 
  4. copy the debug output from main Alfred window to a pastebin/gist
  5. paste a link to it here


I see this output: https://pastebin.com/raw/yAzL8WRb

 

 

I pressed "Paste" on pastebin, but then the text just vanished and I couldn't see any link. I'm not logged in. So you'll get it here.

 

This is the output. Have just replaced my real username with [USERNAME]:

 

```

[01:06:16.161] Logging Started...

[01:06:26.188] Search Apple Music[Script Filter] Queuing argument 'hyperballad'

[01:06:28.355] Search Apple Music[Script Filter] Script with argv '(null)' finished

[01:06:28.356] ERROR: Search Apple Music[Script Filter] Code 1: Traceback (most recent call last):

  File "song.py", line 48, in <module>

    filepath = os.path.join(alfred.work(True), str(e['trackId'])+".png")

  File "/Users/[USER]/Documents/-sync/Alfred/Alfred.alfredpreferences/workflows/user.workflow.B27FA796-BE33-4980-B971-E4C970639005/alfred.py", line 77, in work

    return _create(os.path.join(os.path.expanduser(path), bundleid))

  File "/Users/[USER]/Documents/-sync/Alfred/Alfred.alfredpreferences/workflows/user.workflow.B27FA796-BE33-4980-B971-E4C970639005/alfred.py", line 90, in _create

    os.mkdir(path)

OSError: [Errno 2] No such file or directory: '/Users/[USER]/Library/Caches/com.runningwithcrayons.Alfred-3/Workflow Data/com.gingerbeardman.alfredv3.applemusic'

```

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...