maddox / itunes-api

🎵 A simple server providing a RESTful service for controlling iTunes
MIT License
200 stars 45 forks source link

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

Closed loretoparisi closed 7 years ago

loretoparisi commented 8 years ago

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)
maddox commented 8 years ago

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

loretoparisi commented 8 years ago

@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?

maddox commented 8 years ago

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.

loretoparisi commented 8 years ago

@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)

maddox commented 7 years ago

Closing sine artwork endpoint works.