Git Product home page Git Product logo

itunes-nowplaying-mac's Introduction

itunes-nowplaying-mac

isForked:

For TheDesk or other cross-platform app, it should be installable on any platform. I know I can use optionalDependencies in package.json, but it is poor at managing packaging with a lock file.

Tested:

  • macOS Catalina 10.15.6 (19G2021) + Music.app (1.0.6.10)
  • macOS Mojave 10.14.6 (18G103) + iTunes.app (12.9.5.5)

install

npm install itunes-nowplaying-mac

how to use

TypeScript:

import nowplaying from "itunes-nowplyaing-mac"
nowplaying().then(console.log)

import {getRawData as nowplaying} from "itunes-nowplaying-mac"
nowplaying().then(console.log) // return iTunes raw data

JavaScript:

const nowplaying = require("itunes-nowplaying-mac")
nowplaying().then(console.log)

nowplaying.getRawData().then(console.log) // return iTunes raw data

example return data

Local File

{
    "databaseID": 999999,
    "name": "AnemoneStar",
    "duration": 211.29299926757812,
    "artist": "渋谷凛 (福原綾香)",
    "composer": "Yasushi",
    "album": {
        "name": "THE IDOLM@STER CINDERELLA GIRLS STARLIGHT MASTER 01",
        "artist": "",
        "loved": false,
        "disliked": false
    },
    "genre": "Soundtrack",
    "track": {
        "length": 7,
        "number": 3
    },
    "disc": {
        "length": 1,
        "number": 1
    },
    "sampleRate": 44100,
    "comment": "",
    "loved": true,
    "disliked": false,
    "state": "playing",
    "location": "/path/to/music/file/THE IDOLM@STER CINDERELLA GIRLS STARLIGHT MASTER 01/03 AnemoneStar.m4a"
}

Streaming from iTunes Store

location will be gone because it doesn't exist on file system.

{
    "databaseID": 9999999,
    "name": "ガールズ・イン・ザ・フロンティア (M@STER VERSION)",
    "duration": 254.9010009765625,
    "artist": "渋谷凛 (CV: 福原綾香), 早坂美玲 (CV: 朝井彩加), 木村夏樹 (CV: 安野希世乃), 小日向美穂 (CV: 津田美波) & 塩見周子 (CV: ルゥ ティン)",
    "composer": "Tetsuya Shitara & Cygames",
    "album": {
        "name": "ガールズ・イン・ザ・フロンティア (M@STER VERSION) - Single",
        "artist": "渋谷凛 (CV: 福原綾香), 早坂美玲 (CV: 朝井彩加), 木村夏樹 (CV: 安野希世乃), 小日向美穂 (CV: 津田美波) & 塩見周子 (CV: ルゥ ティン)",
        "loved": false,
        "disliked": false
    },
    "genre": "アニメ",
    "track": {
        "length": 1,
        "number": 1
    },
    "disc": {
        "length": 1,
        "number": 1
    },
    "sampleRate": 44100,
    "comment": "",
    "loved": false,
    "disliked": false,
    "state": "playing"
}

itunes-nowplaying-mac's People

Contributors

kphrx avatar rinsuki avatar

Watchers

 avatar

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.