Code Monkey home page Code Monkey logo

itunes-api's Introduction

iTunes API!!

iTunes API is a simple REST server allowing you to query/control a local running iTunes instance. Once you have a way to make RESTful API calls to control iTunes, you can integrate its control into any of your own software.

This is especially convenient for integrating into any sort of Home Automation you might have.

Last confirmed working version of iTunes: 12.2.1.

Features

  • play/stop/pause/playpause/next/previous control over what's playing.
  • query to return what's currently playing.
  • fetch the art of the currently playing song.
  • set a specific playlist to play, by name.
  • query to return a list of available AirPlay endpoints.
  • set an AirPlay endpoint to be active. (This can be multiple, since iTunes supports it).

Setup

script/bootstrap

Running It

Get up and running immediatly with script/server.

iTunes API will run on port 8181 by default. Use the PORT environment variable to use your own port.

Forever

iTunes API has support for Forever. It uses launchd on OS X to kick it off so that it starts on boot. There is no init.d other Linux support of this type. Pull requests would be welcome for this though.

Development

You can simply run it by calling script/server. This will run it in development mode with logging to standard out.

Install as Service on OS X

script/install

Logging

iTunes API logs all of its requests. In production, it logs to a file at log/logs.log. In development mode, it just logs to stdout.

Development

Launch the app via script/server to run it in the development environment.

Docs

This is a quick overview of the service. Read app.js if you need more info.

Resources

Here's a list of resources that may be returned in a response.

NowPlaying Resource

The NowPlaying resource returns all the information about if iTunes is playing and what is playing.

{
  "player_state": "playing",
  "volume": 60,
  "muted": false,
  "id": "AC4FFD2271422B47",
  "name": "Forever",
  "artist": "HAIM",
  "album": "Days Are Gone (2013)",
  "playlist": "Summer Jams",
  "shuffle": "songs",
  "repeat": "all"
}

Playlist Resource

The Playlist resource returns all the information about a playlist in your library.

{
  "id": "outkast-the-90s",
  "name": "Outkast: The '90s",
  "loved": true,
  "duration_in_seconds": 4544,
  "time": "1:15:44"
},

AirPlayDevice Resource

The AirPlayDevice resource returns all the information about an available AirPlay device on your network.

{
  "id": "63-22-fa-1f-f5-d4",
  "name": "Living Room",
  "kind": "Apple TV",
  "active": true,
  "selected": true,
  "volume": 60,
  "supports_video": true,
  "supports_audio": true,
  "network_address": "63:22:fa:1f:f5:d4"
}

Methods

These are the endpoints you can hit to do things.

Info

Use these endpoints to query the current state of iTunes.

GET /now_playing => NowPlayingResource
GET /artwork => JPEG Data (image/jpeg)

Player Control

Use these endpoints to control what's currently playing.

PUT /playpause => NowPlayingResource
PUT /stop => NowPlayingResource
PUT /previous => NowPlayingResource
PUT /next => NowPlayingResource
PUT /play => NowPlayingResource
PUT /pause => NowPlayingResource
PUT /volume [level=20] => NowPlayingResource
PUT /volume [muted=true] => NowPlayingResource
PUT /shuffle [mode=songs] => NowPlayingResource
PUT /shuffle [mode=off] => NowPlayingResource
PUT /repeat [mode=all] => NowPlayingResource
PUT /repeat [mode=off] => NowPlayingResource

Playlists

Use this endpoint to start a specific playlist.

GET /playlists => {"playlists": [PlaylistResource, PlaylistResource, ...]}
PUT /playlists/:id/play => NowPlayingResource

AirPlay Control

Use these endpoints to query and set AirPlay devices. You can set multiple AirPlay devices to be used at the same time.

GET /airplay_devices => {"airplay_devices": [AirPlayDevice, AirPlayDevice, ...]}
GET /airplay_devices/:id => AirPlayDevice
PUT /airplay_devices/:id/on => AirPlayDevice
PUT /airplay_devices/:id/off => AirPlayDevice
PUT /volume [level=20] => AirPlayDevice

Contributions

  • fork
  • create a feature branch
  • open a Pull Request

itunes-api's People

Contributors

adamvduke avatar jinksi avatar lichtteil avatar maddox avatar pavoni avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

itunes-api's Issues

AppleMusic not Supportet

Apples Streaming Service "Apple Music" is not Supported.

(When a song from Apple Music is playing the API Delivers "Internal Server Error")

cant get the install to work

Hi,

cant get it to work :(

Last login: Mon Nov 20 00:56:21 on ttys000
xxxxxxx:itunes-api-master xxxxxxx$ sudo npm install forever -g
/usr/local/bin/forever -> /usr/local/lib/node_modules/forever/bin/forever

[email protected] install /usr/local/lib/node_modules/forever/node_modules/fsevents
node install

node-pre-gyp ERR! Tried to download(undefined): https://fsevents-binaries.s3-us-west-2.amazonaws.com/v1.1.3/fse-v1.1.3-node-v59-darwin-x64.tar.gz
node-pre-gyp ERR! Pre-built binaries not found for [email protected] and [email protected] (node-v59 ABI, unknown) (falling back to source compile with node-gyp)
gyp ERR! clean error
gyp ERR! stack Error: EACCES: permission denied, rmdir 'build'
gyp ERR! System Darwin 14.5.0
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "clean"
gyp ERR! cwd /usr/local/lib/node_modules/forever/node_modules/fsevents
gyp ERR! node -v v9.2.0
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok
node-pre-gyp ERR! build error
node-pre-gyp ERR! stack Error: Failed to execute '/usr/local/bin/node /usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js clean' (1)
node-pre-gyp ERR! stack at ChildProcess. (/usr/local/lib/node_modules/forever/node_modules/fsevents/node_modules/node-pre-gyp/lib/util/compile.js:83:29)
node-pre-gyp ERR! stack at ChildProcess.emit (events.js:159:13)
node-pre-gyp ERR! stack at maybeClose (internal/child_process.js:943:16)
node-pre-gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:220:5)
node-pre-gyp ERR! System Darwin 14.5.0
node-pre-gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/forever/node_modules/fsevents/node_modules/node-pre-gyp/bin/node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd /usr/local/lib/node_modules/forever/node_modules/fsevents
node-pre-gyp ERR! node -v v9.2.0
node-pre-gyp ERR! node-pre-gyp -v v0.6.39
node-pre-gyp ERR! not ok
Failed to execute '/usr/local/bin/node /usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js clean' (1)
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/forever/node_modules/fsevents):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] install: node install
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Exit status 1

  • [email protected]
    added 116 packages and updated 1 package in 4.894s
    xxxxxxx:itunes-api-master xxxxxxx$

=========

xxxxxxx:itunes-api-master xxxxxxx$ cat /Users/xxxxxxx/Library/LaunchAgents/org.itunes-api.plist

Label org.itunes-api
<key>EnvironmentVariables</key>
<dict>
  <key>PATH</key>
  <string>/usr/local/bin/:/usr/bin:$PATH</string>
  <key>NODE_ENV</key>
  <string>production</string>
</dict>

<key>Program</key>
<string>/Users/xxxxxxx/Downloads/itunes-api-master/script/server</string>

<key>AbandonProcessGroup</key>
<false/>

<key>RunAtLoad</key>
<true/>

<key>KeepAlive</key>
<dict>
  <key>SuccessfulExit</key>
  <false/>
</dict>

<key>WorkingDirectory</key>
<string>/Users/xxxxxxx/Downloads/itunes-api-master</string>

<key>StandardErrorPath</key>
<string>/Users/xxxxxxx/Library/Logs/itunes-api.log</string>

<key>StandardOutPath</key>
<string>/Users/xxxxxxx/Library/Logs/itunes-api.log</string>

please help

Failed Install - Could not find domain for

Is this still supported? All kinds of trouble; had to get homebrew installed, so I could install npm and node. Then got to the iTunes API portion, and when I run the following commands I get:

$ script/server
warn:    --minUptime not set. Defaulting to: 1000ms
warn:    --spinSleepTime not set. Your script will exit if it does not stay up for at least 1000ms

AND/OR:

$ script/install
Installing itunes-api...
Could not find domain for

Running the latest MacOS [10.14.3 (18D109)] and iTunes [12.9.2.5], and attempting to get this working with Hass.io 0.91.1. Man, this would be so awesome to get up and running.

no such file or directory

can you help?

Last login: Sun Mar 28 09:03:06 on ttys000
/Users/kylevalentine/Desktop/itunes-api-master/script/install ; exit;
Kyles-iMac:~ kylevalentine$ /Users/kylevalentine/Desktop/itunes-api-master/script/install ; exit;
Installing itunes-api...
cp: config/org.itunes-api.plist: No such file or directory
logout
Saving session...
...copying shared history...
...saving history...truncating history files...
...completed.

[Process completed]

Install on OSX with OSX Server running?

Hi,
I've just installed CodeJS and itunes-api and it doesn't seem t be working.
When I hit localhost:8181 from a browser (to check it's working) I get nothing... Should I be getting anything.

I'm running Mavericks & OSX Server with Web sites enabled in the server console.

Also, where might I find the logs?

Thx
JP

Also having trouble running this...

I couldn.t install previously - so looking better but now get an error on running.

script/BOOTSTRAP
Finished setting up itunes-api! run it with script/server or install it with script/install.
$ script/server
warn:    --minUptime not set. Defaulting to: 1000ms
warn:    --spinSleepTime not set. Your script will exit if it does not stay up for at least 1000ms
module.js:328
    throw err;
    ^
Error: Cannot find module '/Users/.../itunes-api/node_modules/local-itunes/node_modules/osascript'
    at Function.Module._resolveFilename (module.js:326:15)
    at Function.Module._load (module.js:277:25)
    at Module.require (module.js:354:17)
    at require (internal/module.js:12:17)
    at Object.<anonymous> (/Users/gregdowling/itunes-api/app.js:9:17)
    at Module._compile (module.js:398:26)
    at Object.Module._extensions..js (module.js:405:10)
    at Module.load (module.js:344:32)
    at Function.Module._load (module.js:301:12)
    at Function.Module.runMain (module.js:430:10)
error: Forever detected script exited with code: 1

Avoid iTunes to auto start

Is there a way to avoid iTunes to autostart every time? If the api is running iTunes is always running. If I close it, iTunes-api opens it again! Can it only open iTunes if you actually want to play something?

Thanks!

[Feature request] Apple Music Subscription playlist

With iTunes 12.4 Apple has introduced new playlists from Apple Music subscription playlist - more details here:

subscription playlist n [inh. playlist > item] : a subscription playlist from Apple Music
elements
contains file tracks, URL tracks.

Is possible to add support for it?

script/server works but script/install doesn't (org.itunes-api.plist: Path had bad ownership/permissions)

Hi all,

I am able to run itunes-api using script/server, but then I haven't found a way to put it into the background so that I can exit my terminal. I tried with CTRL-Z, bg, exit, and also with nohup, but neither worked. And I'd really rather have it run as a service anyway. But script/install isn't working for me. I have forever installed, and itunes API works, but it's giving me a permissions error as shown below.. Any ideas what's causing this? Forever is installed, I'm not sure if I need to upgrade to a certain version or something?

Here are a few of the many things I've tried.

$ script/install
Installing itunes-api...
/Volumes/Users/scstraus/Library/LaunchAgents/org.itunes-api.plist: Path had bad ownership/permissions

$ ls -la /Volumes/Users/scstraus/Library/LaunchAgents/org.itunes-api.plist
-rwxr-x--- 1 scstraus staff 1022 Nov 15 22:19 /Volumes/Users/scstraus/Library/LaunchAgents/org.itunes-api.plist

$ npm install
audited 169 packages in 8.576s
found 0 vulnerabilities

$ script/install
Installing itunes-api...
/Volumes/Users/scstraus/Library/LaunchAgents/org.itunes-api.plist: Path had bad ownership/permissions

$ chmod 777 /Volumes/Users/scstraus/Library/LaunchAgents/org.itunes-api.plist

$ ls -la /Volumes/Users/scstraus/Library/LaunchAgents/org.itunes-api.plist
-rwxrwxrwx 1 scstraus staff 1022 Nov 15 22:26 /Volumes/Users/scstraus/Library/LaunchAgents/org.itunes-api.plist

$ script/install
Installing itunes-api...
/Volumes/Users/scstraus/Library/LaunchAgents/org.itunes-api.plist: Path had bad ownership/permissions

Has anyone tried this with Catalina's new Apple Music app?

Would love to hear from anyone who's tried this with Catalina's new Apple Music app. I'm not upgrading until I hear some experiences as I don't want to lose control of my music library. Hard to tell if it supports the DAAP protocol needed.

execution error: Error: Error: Can't get object. (-1728)

I've gotten iTunes-api partially working (AirPlay endpoints appearing, Media Player appearing but not fully functional). Getting various errors including: execution error: Error: Error: Can't get object. (-1728) and Error: Command failed: osascript -l JavaScript -e 'var old = console.log.

Also the get this when first running script/server:
warn: --minUptime not set. Defaulting to: 1000ms
warn: --spinSleepTime not set. Your script will exit if it does not stay up for at least 1000ms
(node:13019) Warning: Accessing non-existent property 'padLevels' of module exports inside circular dependency
(Use node --trace-warnings ... to show where the warning was created)
(node:13019) Warning: Accessing non-existent property 'padLevels' of module exports inside circular dependency

And finally: Failed to call service media_player/media_play_pause. Expecting value: line 1 column 1 (char 0) - if I try to play from the Media Player.

Any suggestions for resolving? Running Big Sur/Apple Music/HASS core-2021.4.6. iTunes API page shows correction at port 8181.

Thanks!

Album Art Work

Hi I have an issue where the album art work is not changing, if i restart HASS then it updates but not when changing tracks albums etc.

500 internal server error - since iTunes updated für iPhone update

i run iMac 10.12.6 (sierra) and iTunes 12.8.2.3 since years for iTunes only and used itunes-api for remote controll everything.
since i updated my old iPhone to ios 15.0.2 from ios 14 over iTunes, the update told me to install a update for iTunes, the API doesn't work anymore.
i use postman for testing and get always a 500 internal error.
tried to uninstall iTunes and restore the iTunes over timemachine from the day before the iPhone update.
reinstalled the API but always the same error.
someone knows an answer?

Copy Paste Error in README

Wrong:
PUT /volume [muted=true] => NowPlayingResource
Right:
PUT /mute [muted=true] => NowPlayingResource

Errors on non standard node installs like nvm

script/server: line 9: /usr/local/bin/forever: No such file or directory after a bootstrap because not everyone's node install and binaries live at /usr/local/bin/.

The simplest fix for this is to call forever in the shell scripts with $(which forever). I changed it locally, and output works with this fix.

image

[Feature Request] Add WebRadio to API

This is my AppelScript to Add Streams to iTunes.

Perhaps you can Add this to your API.

I controll iTunes by a PHP Script at this Time ... but your API is much easier to handle in Openhab :-)

--WebRadio #Sender 1 einschalten if item 1 of argv is equal to "iTunes_WebRadio_01" then tell application "iTunes" open location stream_URL01 set new_stream to (some URL track of library playlist 1 whose address is stream_URL01) if not (user playlist my_playlist exists) then make new playlist with properties {name:my_playlist} else delete tracks of playlist my_playlist end if duplicate new_stream to playlist my_playlist tell playlist my_playlist play track (get name of new_stream) end tell end tell end if

Script/Server ERROR

Is this install still being maintained?

"Script/Install" will NOT install

script/server
warn: --minUptime not set. Defaulting to: 1000ms
warn: --spinSleepTime not set. Your script will exit if it does not stay up for at least 1000ms

And it simply freezes after that. The instructions are also horribly vague, and not beginner friendly. Do I need to install other dependencies to make this work? Can you please specify that in your instructions?

Command failed: osascript

I'm getting the below error when trying to turn speakers on and off on iTunes 12.10. Any idea why?

'[2020-10-22T16:23:57.649Z] - ::ffff:10.10.10.20 - PUT /airplay_devices/40-3c-fc-05-7f-38/off 200 123.164 ms - 207b'
Error: Command failed: osascript -l JavaScript -e 'var old = console.log; console.log = function () { Array.prototype.unshift.call(arguments, "<brandonhorst:node-osa>"); Array.prototype.push.call(arguments, "</brandonhorst:node-osa>"); old.apply(console, arguments); }; JSON.stringify((function (id, selected){    itunes = Application('\''iTunes'\'');    id = id.replace(/-/g, '\'':'\'');    foundAirPlayDevice = null;    deviceData = {};    airPlayDevices = itunes.airplayDevices();    for (i = 0; i < airPlayDevices.length; i++) {      airPlayDevice = airPlayDevices[i];      if (airPlayDevice.networkAddress() == id || airPlayDevice.name() == id) {        foundAirPlayDevice = airPlayDevice;        break;      }    }    if (foundAirPlayDevice) {      foundAirPlayDevice.selected = selected;      if (foundAirPlayDevice.networkAddress()) {        deviceData["id"] = foundAirPlayDevice.networkAddress().replace(/:/g, '\''-'\'');      } else {        deviceData["id"] = foundAirPlayDevice.name();      }      deviceData["name"] = foundAirPlayDevice.name();      deviceData["kind"] = foundAirPlayDevice.kind();      deviceData["active"] = foundAirPlayDevice.active();      deviceData["selected"] = foundAirPlayDevice.selected();      deviceData["sound_volume"] = foundAirPlayDevice.soundVolume();      deviceData["supports_video"] = foundAirPlayDevice.supportsVideo();      deviceData["supports_audio"] = foundAirPlayDevice.supportsAudio();      deviceData["network_address"] = foundAirPlayDevice.networkAddress();    }    return deviceData;  })("Computer",false));'
0:1496: execution error: Error on line 1: Error: Parameter error. (-50)

    at ChildProcess.exithandler (child_process.js:308:12)
    at ChildProcess.emit (events.js:314:20)
    at maybeClose (internal/child_process.js:1051:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:287:5) {
  killed: false,
  code: 1,
  signal: null,
  cmd: `osascript -l JavaScript -e 'var old = console.log; console.log = function () { Array.prototype.unshift.call(arguments, "<brandonhorst:node-osa>"); Array.prototype.push.call(arguments, "</brandonhorst:node-osa>"); old.apply(console, arguments); }; JSON.stringify((function (id, selected){    itunes = Application('\\''iTunes'\\'');    id = id.replace(/-/g, '\\'':'\\'');    foundAirPlayDevice = null;    deviceData = {};    airPlayDevices = itunes.airplayDevices();    for (i = 0; i < airPlayDevices.length; i++) {      airPlayDevice = airPlayDevices[i];      if (airPlayDevice.networkAddress() == id || airPlayDevice.name() == id) {        foundAirPlayDevice = airPlayDevice;        break;      }    }    if (foundAirPlayDevice) {      foundAirPlayDevice.selected = selected;      if (foundAirPlayDevice.networkAddress()) {        deviceData["id"] = foundAirPlayDevice.networkAddress().replace(/:/g, '\\''-'\\'');      } else {        deviceData["id"] = foundAirPlayDevice.name();      }      deviceData["name"] = foundAirPlayDevice.name();      deviceData["kind"] = foundAirPlayDevice.kind();      deviceData["active"] = foundAirPlayDevice.active();      deviceData["selected"] = foundAirPlayDevice.selected();      deviceData["sound_volume"] = foundAirPlayDevice.soundVolume();      deviceData["supports_video"] = foundAirPlayDevice.supportsVideo();      deviceData["supports_audio"] = foundAirPlayDevice.supportsAudio();      deviceData["network_address"] = foundAirPlayDevice.networkAddress();    }    return deviceData;  })("Computer",false));'`

Can run Install script

I open the Install script and get:

/Applications/itunes-api-master/script/install ; exit;
Installing itunes-api...
cp: config/org.itunes-api.plist: No such file or directory
logout

org.itunes-api.plist is in the config folder

Any suggestions?

Keeps asking to install forever when issuing: script/bootstrap

Script/install or restart works but bootstrap keeps prompting install forever but still prompts after forever is installed. I realize this is old and my node may be too new but just thought I would see here if there is a work around. script/server says no file guessing since the bootstrap isn't working. Any help is welcomed, cheers!

Need help installing

Hello, I am a bit of a nube - trying to install this to get iTunes media player working in my Home Assistant.

I have downloaded the files and tried to install using Terminal. script/bootstrap gives me this:

`You don't have forever installed. You need to install it first.

Just install it with this command:
sudo npm install forever -g`

$ sudo npm install forever -g

results in:

sudo: npm: command not found

script/install seems to do something:

Installing itunes-api... but hangs there... restart of HA has no effect.

Please help!

Internal Server Error when running on macOS 10.12 Sierra

I'm able to hit the basic page at 8181 and see the API commands, http://localhost:8181/artwork works, however all other functions such as now_playing and airplay devices give "internal server error"

(I also changed all the ' to " except for the logFormat because the quote escaping in the logs was making my head explode lol)

   :~/source/itunes-api$ script/server
warn:    --minUptime not set. Defaulting to: 1000ms
warn:    --spinSleepTime not set. Your script will exit if it does not stay up for at least 1000ms
'[2016-09-27T11:30:34.384Z] - ::1 - GET /artwork 200 204.778 ms - 34806b'
'[2016-09-27T11:30:47.957Z] - ::1 - GET /airplay_devices 500 145.547 ms - 21b'
{ [Error: Command failed: /bin/sh -c osascript -l JavaScript -e 'var old = console.log; console.log = function () { Array.prototype.unshift.call(arguments, "<brandonhorst:node-osa>"); Array.prototype.push.call(arguments, "</brandonhorst:node-osa>"); old.apply(console, arguments); }; JSON.stringify((function getCurrentState(){  itunes = Application("iTunes");  playerState = itunes.playerState();  currentState = {};  currentState["player_state"] = playerState;  if (playerState != "stopped") {    currentTrack = itunes.currentTrack;    currentPlaylist = itunes.currentPlaylist;    currentState["id"] = currentTrack.persistentID();    currentState["name"] = currentTrack.name();    currentState["artist"] = currentTrack.artist();    currentState["album"] = currentTrack.album();    currentState["playlist"] = currentPlaylist.name();    currentState["volume"] = itunes.soundVolume();    currentState["muted"] = itunes.mute();    if (currentTrack.year()) {      currentState["album"] += " (" + currentTrack.year() + ")";    }  }  return currentState;})());'
0:990: execution error: Error on line 1: Error: Application isn't running. (-600)
]
  killed: false,
  code: 1,
  signal: null,
  cmd: '/bin/sh -c osascript -l JavaScript -e \'var old = console.log; console.log = function () { Array.prototype.unshift.call(arguments, "<brandonhorst:node-osa>"); Array.prototype.push.call(arguments, "</brandonhorst:node-osa>"); old.apply(console, arguments); }; JSON.stringify((function getCurrentState(){  itunes = Application("iTunes");  playerState = itunes.playerState();  currentState = {};  currentState["player_state"] = playerState;  if (playerState != "stopped") {    currentTrack = itunes.currentTrack;    currentPlaylist = itunes.currentPlaylist;    currentState["id"] = currentTrack.persistentID();    currentState["name"] = currentTrack.name();    currentState["artist"] = currentTrack.artist();    currentState["album"] = currentTrack.album();    currentState["playlist"] = currentPlaylist.name();    currentState["volume"] = itunes.soundVolume();    currentState["muted"] = itunes.mute();    if (currentTrack.year()) {      currentState["album"] += " (" + currentTrack.year() + ")";    }  }  return currentState;})());\'' }

Edit: changed title of Issue to reflect actual issue.

script/install Invalid or missing Program/ProgramArguments

:itunes-api kai$ script/install
Installing itunes-api...
/Users/kai/Library/LaunchAgents/org.itunes-api.plist: Invalid or missing Program/ProgramArguments

thats happens when i try to install the script..
it is working fine with script/server

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.