jwzlyrics 1.20

jwzlyrics works again. I retooled it to scrape Genius, now that LyricsWiki is gone forever.

Who knows how long this will continue to work, before they change something in their generated HTML. Such are the indignities of This Modern World. If there are better options, I don't know of them.

LyricsWiki had an actual API. It was annoying but stable. Genius technically has an API, but using it would require each user of this program to create an account there, which is far too onerous.

I also applied some countermeasures to their weird steganography!

It's amazing to me the the music conglomerates have basically conceded that all music is available everywhere for a dollar a month and nobody's ever going to get paid, but they are still treating the lyrics like those are the most precious thing they own.


The source also includes "itunesxml", a command line utility that generates an XML file nearly identical to the file that iTunes used to keep up-to-date in "~/Music/iTunes/iTunes Music Library.xml", that last existed in macOS 10.14. This means that tools that need to access the iTunes database, e.g. the Mac::iTunes::Library::XML Perl module, can continue to work.

Previously, previously, previously, previously, previously, previously.

Tags: , , , , , ,

34 Responses:

  1. klokop says:

    It's a bit crashy on my M1 MacBook Air. Crashes on skip-to-nex-song.

  2. Scott Cheloha says:

    Have you ever found an explanation for why lyrics never became standard metadata on CD tracks?

    They could even put a copyright notice in the text of the lyrics. Just let me have them with my perpetual license.

    • jwz says:
      1

      Nope.

    • Carlos says:

      Lyrics weren't (aren't?) always even provided with physical albums (vinyl, tape, or CD); in my collection only maybe 15% of them included lyrics.  And some of those were very obviously not actually provided by the songwriter/band, as they contained obvious mondegreens from whoever transcribed the lyrics from the recording.

      I suspect the record labels just didn't/don't have the lyrics to include as metadata on the CDs in the first place.

      C.

  3. John Holland says:

    On my M1 MacBook Pro, it doesn't work (no lyrics or anything at all appear in window) when I run it by double-clicking on it. It works fine though, if I go into Terminal and drill into Downloads/jwzlyrics.app/Contents/MacOS and run it with ./jwzlyrics. The first time I did it it prompted me to grant some privilege to Terminal but I didn't notice exactly what that was.

      I also downloaded the source and tried to build it. When I changed your "Development Team" in jwzlyrics.xcodeproj/project.pbxproj to mine it built with a "make" command, but when I ran that build something was wrong with Sparkle framework involving signing I think. You're on another plane of existence than me, looking at the code etc, so just ignore this paragraph.

    • jwz says:

      Double-clicking should have gotten the "OMG something you downloaded from the internet!!" dialog but not the "unknown developer" dialog, because it is signed and notarized. Opening it from Terminal should be kind of like right-click and selecting "Open", which may do something slightly different, so maybe that's worth a try.

      Sparkle is the software-update framework and it's weird. Building the Xcode "jwzlyrics_store" target might work better for you since that doesn't include Sparkle. (That was an attempt to build a version that would survive transit through the macOS App Store, but I never finished it.)

      I built the package on a 12.3.1 system, and just tested downloading and running it on a 10.13 system where it had never been installed before, and all the signing crap seemed to pass just fine, so I dunno.

      • John Holland says:

        Double clicking did get the OMG internet app warning. The downloaded app had no issue with signing etc. That was only on my attempt to build it myself.

        Double clicking started it up and the menus and stuff worked but it didn't pick up on what was playing in Music. When running it from the terminal it picked up the songs and got the lyrics.

        • John Holland says:

          I'm on 12.3.1 also.

        • jwz says:

          There probably should have been a dialog asking for access to the Music app? Maybe check to see if there's anything weird going on in "System Preferences / Security & Privacy / Media & Apple Music" or maybe "Files and Folders".

          • John Holland says:

            No sign of it there. (Security & Privacy/ Media & Apple Music)

            • John Holland says:

              Also, I get this in both the lyrics window and the terminal:  "The application “notifier” could not be launched because a miscellaneous error occurred."  I found notifier.app in my build attempt and copied it to /Applications but still getting this.

              • jwz says:

                Well, that's weird too. Notifier is in "jwzlyrics.app/Contents/Resources/notifier.app". That's the helper app that pops up messages, it has nothing to do with being able to read lyrics from Music.app.

                "codesign --display --entitlements :- /Applications/jwzlyrics.app" shows that it is requesting com.apple.security.scripting-targets, so it should have asked you for access to com.apple.Music.

                • John Holland says:

                  OK, the notifier thing was because I ran it from the command line where I downloaded it. Running it from the command line in /Applications/jwzlyrics.app/Contents/MacOS, now the notifier works. Still no lyrics when double-clicking on it.   Might be something weird on my machine (malwarebytes maybe?).   Great app though!

      • Carlos says:
        1

        ... by the way, the new comment editor is great.  And it remembers me!

        C.

  4. dzm says:

    Adding to the "doesn't work well here" reports:

    MBPro, 13", M1, 2020 vintage
    macOS Monterey 12.4B4 (21F5071b)

    Observed behavior:
    Double-click gets "ZOMG! Downloaded from Interwebs!" alert. Upon granting permission to launch anyway I get a light blue window with a title bar labeled "Lyrics". There is nothing in the window.

    File-> Search Band gets me a browser window with Google complaining that I searched for "" (two double-quotes with nothing between them).

    At no time have I been prompted to grant access to Music.app." When I go to Apple -> System Preferences -> Privacy & Security -> Privacy -> Media & Apple Music I see no indication that there has been a request made and accidentally rejected (I also see no way to say "Yeah, just grant the damn permission of the app that I'm going to select.")

    So it basically looks like the app runs and doesn't crash, but whatever under-the-hood thing is supposed to ask for permission to access Music.app never even fires.

    • jwz says:

      Well, I am stumped.

      • John Holland says:

        This is a better description of my experience. dzm, try opening Terminal and going inside the Applications/jwzlyrics.app folder to get to Contents/MacOS and from there run it with ./jwzlyrics  I think it will work for you then.

        • jwz says:

          Yeah, it works fine on 10.13, but on 12.0, when launched from Finder, or with "open -a jwzlyrics", it never asks for permission to access "Music". But if you use Terminal to run "/Applications/jwzlyrics.app/Contents/MacOS/jwzlyrics" directly, it prompts you with "Terminal wants to access Music" and then it works.

          Launching it the same way a second time from Terminal still works, so it is remembering that setting. And yet, nothing is listed in "System Preferences / Security & Privacy / Media & Apple Music".

          • dzm says:
            On my system when I go into the app bundle and launch via ./jwzlyrics I get no prompt. I DO get:

            dzm-mbpro-13 MacOS % ./jwzlyrics
            2022-05-06 22:59:39.642 jwzlyrics[60256:1950835] Can't find app with identifier com.apple.iTunes
            dzm-mbpro-13 MacOS %
  5. incster says:

    Crashes for me as well.

    MacBook Pro (13-inch, 2016, Four Thunderbolt 3 Ports)

    -------------------------------------
    Translated Report (Full Report Below)
    -------------------------------------

    Process:               jwzlyrics [86861]
    Path:                  /Applications/jwzlyrics.app/Contents/MacOS/jwzlyrics
    Identifier:            org.jwz.jwzlyrics
    Version:               1.20 (1.20)
    Code Type:             X86-64 (Native)
    Parent Process:        launchd [1]
    User ID:               501

    Date/Time:             2022-05-06 15:32:53.7160 -0400
    OS Version:            macOS 12.3.1 (21E258)
    Report Version:        12
    Bridge OS Version:     3.0 (14Y910)
    Anonymous UUID:        0308E6CA-3AAF-5B74-2194-21403CFF247B

    Sleep/Wake UUID:       32AA3141-2691-4932-9F6C-DF7C1B58F626

    Time Awake Since Boot: 260000 seconds
    Time Since Wake:       108 seconds

    System Integrity Protection: enabled

    Crashed Thread:        0  Dispatch queue: com.apple.main-thread

    Exception Type:        EXC_CRASH (SIGABRT)
    Exception Codes:       0x0000000000000000, 0x0000000000000000
    Exception Note:        EXC_CORPSE_NOTIFY

    Application Specific Information:
    *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[__NSCFConstantString stringByAppendingString:]: nil argument'
    terminating with uncaught exception of type NSException
    abort() called

    Application Specific Backtrace 0:
    0   CoreFoundation                      0x00007ff81554d1e3 __exceptionPreprocess + 242
    1   libobjc.A.dylib                     0x00007ff8152adc13 objc_exception_throw + 48
    2   Foundation                          0x00007ff8162d1185 -[NSString stringByAppendingString:] + 238
    3   jwzlyrics                           0x000000010f9666e8 -[jwzlyricsAppDelegate loadArtistURL] + 517
    4   CoreFoundation                      0x00007ff8154c703c __CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER__ + 12
    5   CoreFoundation                      0x00007ff815564592 ___CFXRegistrationPost_block_invoke + 49
    6   libdispatch.dylib                   0x00007ff81524f0cc _dispatch_call_block_and_release + 12
    7   libdispatch.dylib                   0x00007ff815250317 _dispatch_client_callout + 8
    8   libdispatch.dylib                   0x00007ff81525cc78 _dispatch_main_queue_drain + 943
    9   libdispatch.dylib                   0x00007ff81525c8bb _dispatch_main_queue_callback_4CF + 31
    10  CoreFoundation                      0x00007ff81550f9c7 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 9
    11  CoreFoundation                      0x00007ff8154d093f __CFRunLoopRun + 2771
    12  CoreFoundation                      0x00007ff8154cf7ac CFRunLoopRunSpecific + 562
    13  HIToolbox                           0x00007ff81e156ce6 RunCurrentEventLoopInMode + 292
    14  HIToolbox                           0x00007ff81e156a4a ReceiveNextEventCommon + 594
    15  HIToolbox                           0x00007ff81e1567e5 _BlockUntilNextEventMatchingListInModeWithFilter + 70
    16  AppKit                              0x00007ff817ef653d _DPSNextEvent + 927
    17  AppKit                              0x00007ff817ef4bfa -[NSApplication(NSEvent) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 1394
    18  AppKit                              0x00007ff817ee72a9 -[NSApplication run] + 586
    19  AppKit                              0x00007ff817ebb227 NSApplicationMain + 817
    20  dyld                                0x000000011b22051e start + 462

  6. jwz says:
    Ok, get this:

    • macOS 10.13: jwzlyrics 1.19 and jwzlyrics 1.20 display this dialog on first launch:
    • macOS 12.x: jwzlyrics 1.20 does not display the dialog, and can't talk to Music.app.
    • macOS 12.x: jwzlyrics 1.19 does display the dialog, and can talk to Music.app!
    • If you say "Ok" to the dialog for 1.19, then jwzlyrics 1.20 inherits that setting, and works fine.

    So clearly 1.19 and 1.20 are doing something different, but I have no idea what that is. I also don't see any clues in "sudo log show --info --last 2m", but that is so incredibly verbose it's easy to miss everything.

  7. jwz says:

    Aha! Apparently if the Hardened Runtime is enabled, you now need to set the "com.apple.security.automation.apple-events" entitlement, or the access dialog won't pop up. In addition to the com.apple.security.scripting-targets entitlements, because why not.

    Anyway, download 1.21 and it should work, I hope.

    • Dr. Fancypants says:

      I just took 1.21 for a spin on MacOS 12.3.1, and can confirm it works. Very cool stuff.

    • dzm says:
      Now it does new stuff!

      If Music.app isn't running then no prompts for control, etc. Also, I THINK I didn't get the default window, but now can't repro that.

      When I launched from the CLI I got:

      dzm-mbpro-13 MacOS % ./jwzlyrics
      2022-05-06 23:22:01.866 jwzlyrics[60608:1963550] Can't find app with identifier com.apple.iTunes
      2022-05-06 23:22:39.758 jwzlyrics[60608:1963550] Internal Error: 15865: Ollin - Smiling Moon: The application “notifier” could not be launched because a miscellaneous error occurred.
      2022-05-06 23:23:03.341 jwzlyrics[60608:1963550] Internal Error: 17971: The Pogues - The Balinalee: The application “notifier” could not be launched because a miscellaneous error occurred.
      2022-05-06 23:23:15.820 jwzlyrics[60608:1963550] Internal Error: 27511: Ray Charles - 'Deed I Do: The application “notifier” could not be launched because a miscellaneous error occurred.
      2022-05-06 23:23:18.548 jwzlyrics[60608:1963550] Internal Error: 27511: Ray Charles - 'Deed I Do: 15 redirects: https://genius.com/Ray-charles-deed-i-do-lyrics
      The first error happened 'cause Music.app wasn't running. Upon launching and starting to play things, these other errors got thrown. Some of the tracks had no lyrics, some did. Errors happened. No lyrics were displayed.
      • jwz says:

        Running it from the command line is never gonna work quite right, so that's not really interesting. But that it showed you track names at all means that it is successfully talking to Music.app, which was not happening before.

        1.21 is working for me on a fresh-ish install of 12.3.1. But maybe do "tccutil reset All" to make the all the dialogs happen again.

        • dzm says:

          I've finally had a chance to circle around to this. Now works as expected. I blame the shit-show above on having been sitting in an utterly deplorable hotel network. Everything is now working as expected.

  8. incster says:

    I am using 1.21 with Spotify. If I double click on a track, jwzlyrics crashes. It seems to work otherwise.

    • jwz says:

      Need a backtrace. I don't use Spotify so I don't know how to test that.

      • incster says:

        -------------------------------------
        Translated Report (Full Report Below)
        -------------------------------------

        Process:               jwzlyrics [88627]
        Path:                  /Applications/jwzlyrics.app/Contents/MacOS/jwzlyrics
        Identifier:            org.jwz.jwzlyrics
        Version:               1.21 (1.21)
        Code Type:             X86-64 (Native)
        Parent Process:        launchd [1]
        User ID:               501

        Date/Time:             2022-05-07 13:35:00.7747 -0400
        OS Version:            macOS 12.3.1 (21E258)
        Report Version:        12
        Bridge OS Version:     3.0 (14Y910)
        Anonymous UUID:        0308E6CA-3AAF-5B74-2194-21403CFF247B

        Sleep/Wake UUID:       D09AF938-446E-4A6D-B6BE-189F1269A10D

        Time Awake Since Boot: 270000 seconds
        Time Since Wake:       826 seconds

        System Integrity Protection: enabled

        Crashed Thread:        0  Dispatch queue: com.apple.main-thread

        Exception Type:        EXC_CRASH (SIGABRT)
        Exception Codes:       0x0000000000000000, 0x0000000000000000
        Exception Note:        EXC_CORPSE_NOTIFY

        Application Specific Information:
        *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[__NSCFConstantString stringByAppendingString:]: nil argument'
        terminating with uncaught exception of type NSException
        abort() called

        Application Specific Backtrace 0:
        0   CoreFoundation                      0x00007ff81554d1e3 __exceptionPreprocess + 242
        1   libobjc.A.dylib                     0x00007ff8152adc13 objc_exception_throw + 48
        2   Foundation                          0x00007ff8162d1185 -[NSString stringByAppendingString:] + 238
        3   jwzlyrics                           0x000000010b18f6e8 -[jwzlyricsAppDelegate loadArtistURL] + 517
        4   CoreFoundation                      0x00007ff8154c703c __CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER__ + 12
        5   CoreFoundation                      0x00007ff815564592 ___CFXRegistrationPost_block_invoke + 49
        6   libdispatch.dylib                   0x00007ff81524f0cc _dispatch_call_block_and_release + 12
        7   libdispatch.dylib                   0x00007ff815250317 _dispatch_client_callout + 8
        8   libdispatch.dylib                   0x00007ff81525cc78 _dispatch_main_queue_drain + 943
        9   libdispatch.dylib                   0x00007ff81525c8bb _dispatch_main_queue_callback_4CF + 31
        10  CoreFoundation                      0x00007ff81550f9c7 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 9
        11  CoreFoundation                      0x00007ff8154d093f __CFRunLoopRun + 2771
        12  CoreFoundation                      0x00007ff8154cf7ac CFRunLoopRunSpecific + 562
        13  HIToolbox                           0x00007ff81e156ce6 RunCurrentEventLoopInMode + 292
        14  HIToolbox                           0x00007ff81e156a4a ReceiveNextEventCommon + 594
        15  HIToolbox                           0x00007ff81e1567e5 _BlockUntilNextEventMatchingListInModeWithFilter + 70
        16  AppKit                              0x00007ff817ef653d _DPSNextEvent + 927
        17  AppKit                              0x00007ff817ef4bfa -[NSApplication(NSEvent) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 1394
        18  AppKit                              0x00007ff817ee72a9 -[NSApplication run] + 586
        19  AppKit                              0x00007ff817ebb227 NSApplicationMain + 817
        20  dyld                                0x000000010f17b51e start + 462

        Thread 0 Crashed::  Dispatch queue: com.apple.main-thread
        0   libsystem_kernel.dylib            0x7ff8153d500e __pthread_kill + 10
        1   libsystem_pthread.dylib            0x7ff81540b1ff pthread_kill + 263
        2   libsystem_c.dylib                  0x7ff815356d24 abort + 123
        3   libc++abi.dylib                    0x7ff8153c7082 abort_message + 241
        4   libc++abi.dylib                    0x7ff8153b81bd demangling_terminate_handler() + 266
        5   libobjc.A.dylib                    0x7ff8152b4e01 _objc_terminate() + 96
        6   libc++abi.dylib                    0x7ff8153c64a7 std::__terminate(void (*)()) + 8
        7   libc++abi.dylib                    0x7ff8153c6458 std::terminate() + 56
        8   libdispatch.dylib                  0x7ff81525032b _dispatch_client_callout + 28
        9   libdispatch.dylib                  0x7ff81525cc78 _dispatch_main_queue_drain + 943
        10  libdispatch.dylib                  0x7ff81525c8bb _dispatch_main_queue_callback_4CF + 31
        11  CoreFoundation                    0x7ff81550f9c7 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 9
        12  CoreFoundation                    0x7ff8154d093f __CFRunLoopRun + 2771
        13  CoreFoundation                    0x7ff8154cf7ac CFRunLoopRunSpecific + 562
        14  HIToolbox                          0x7ff81e156ce6 RunCurrentEventLoopInMode + 292
        15  HIToolbox                          0x7ff81e156a4a ReceiveNextEventCommon + 594
        16  HIToolbox                          0x7ff81e1567e5 _BlockUntilNextEventMatchingListInModeWithFilter + 70
        17  AppKit                            0x7ff817ef653d _DPSNextEvent + 927
        18  AppKit                            0x7ff817ef4bfa -[NSApplication(NSEvent) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 1394
        19  AppKit                            0x7ff817ee72a9 -[NSApplication run] + 586
        20  AppKit                            0x7ff817ebb227 NSApplicationMain + 817
        21  dyld                                 0x10f17b51e start + 462

  9. Redgrittybrick says:
    1

    I don't use jwzlyrics, but I enjoy these tales of heroic sisyphean struggles to maintain order against the onslaught of darkly chaotic corporate forces.

  10. mattl says:

    1.21 works great! Thanks for this...

Leave a Reply

Your email address will not be published. But if you provide a fake email address, I will likely assume that you are a troll, and not publish your comment.

Starting a new top-level thread.

  • Previously