maddox/itunes-api

Error: ENOENT: no such file or directory - /artwork

loretoparisi opened this issue · 5 comments

This error comes out with the /artwork api: http://localhost:8181/artwork

Error: ENOENT: no such file or directory, stat '/tmp/currently-playing.jpg'
   at Error (native)

This is happens when there's no album art for the current track.

@maddox I can see the artwork, but the track is from AppleMusic (is a class type URL Track in AppleScript), could be this the issue?

Yeah, you can't get metadata from songs played within apple music. They have to be in your library and being played from there or a playlist.

@maddox ok thank you this explain why. By the way there is some new info in the song meta data coming out of apple music if you dump the whole object from osa script:

{
    class: URLtrack,
    id: 56631,
    index: 8,
    name: "Wishing Well",
    persistentID: "E6E02549FD0F95E1",
    databaseID: 56627,
    dateadded: date"martedì 17 maggio 2016 12:09:59",
    time: "4:04",
    duration: 244.839996337891,
    artist: "Black Sabbath",
    albumartist: "",
    composer: "Terrence Geezer Butler, Ronnie James Dio, Tony Iommi, William Thomas Ward",
    album: "Heaven and Hell (Deluxe Edition)",
    genre: "Metal",
    bitrate: 256,
    samplerate: 44100,
    trackcount: 5,
    tracknumber: 0,
    disccount: 0,
    discnumber: 1,
    volumeadjustment: 0,
    year: 2010,
    comment: "",
    EQ: "",
    kind: "",
    mediakind: music,
    videokind: none,
    enabled: true,
    start: 0.0,
    finish: 244.839996337891,
    playedcount: 0,
    skippedcount: 0,
    compilation: false,
    rating: 0,
    bpm: 0,
    grouping: "",
    bookmarkable: false,
    bookmark: 0.0,
    shufflable: true,
    lyrics: "",
    category: "",
    description: "",
    show: "",
    seasonnumber: 0,
    episodeID: "",
    episodenumber: 0,
    unplayed: false,
    sortname: "",
    sortalbum: "",
    sortartist: "",
    sortcomposer: "",
    sortalbumartist: "",
    sortshow: "",
    releasedate: date"venerdì 1 gennaio 2010 13:00:00",
    loved: false,
    albumloved: false
}

You can this via

tell application "iTunes" to properties of current track

my wonder is if that persistentID could be used that to lookup the track from the public iTunes search api, that is the

@property (copy, readonly) NSString *persistentID;  // the id of the item as a hexadecimal string. This id does not change over time.

Note. The class of type URL track tell us that this is a streaming track (Radio | AppleMusic | iTunesMatch)

Closing sine artwork endpoint works.