Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

--format works with ">" but it captures not valid data from stdout [Sierra] #11

Open
alundiak opened this issue Feb 20, 2017 · 2 comments
Labels

Comments

@alundiak
Copy link
Contributor

alundiak commented Feb 20, 2017

When I execute any commands using --format and > files created, but they all have at the beginning of file

itunes-data --tracks --format json ~/Music/iTunes/iTunes\ Music\ Library.xml > data/tracks2.json
itunes-data --artists --format tsv ~/Music/iTunes/iTunes\ Music\ Library.xml > data/artists2.tsv
itunes-data --artists --format csv ~/Music/iTunes/iTunes\ Music\ Library.xml > data/artists2.csv

Note: I don't use --library and --playlists due the errors described in issues: #6, #8, #10

NOT valid JSON then.

reading: /Users/alund/Music/iTunes/iTunes Music Library.xml (2195303 bytes)
�[6n[
{"Track ID":1158,"Size":8575284,"Total Time":206376,"Year":2015,
...

NOT valid TSV then.

reading: /Users/alund/Music/iTunes/iTunes Music Library.xml (2195303 bytes)
�[6nName	Track Count	Play Count
16 Bit Lolitas	1	3
4 Strings	1	1

...

NOT valid CSV then.

reading: /Users/alund/Music/iTunes/iTunes Music Library.xml (2195303 bytes)
�[6nName,Track Count,Play Count
16 Bit Lolitas,1,3
4 Strings,1,1

...

PS. I'm on iTunes v12.5.5.5, macOS Sierra v10.12.3, node v7.5.0, npm v4.1.2
itunes-data installed globally (0.1.3)

сс/ @shawnbot

@alundiak
Copy link
Contributor Author

alundiak commented May 9, 2018

@shawnbot up

@shawnbot shawnbot added the bug label May 9, 2018
@alundiak
Copy link
Contributor Author

This time, I have iTunes v12.8, MacOS v10.13.6, node v10.11.0, npm v6.4.1.

I installed [email protected] locally, and I tried with initial version of itunes-data.
Here is is my npm scripts:

  "scripts": {
    "start": "node server.js",
    "csv": "itunes-data --tracks data/tracks.csv ~/Music/iTunes/iTunes\\ Music\\ Library.xml",
    "tsv": "itunes-data --tracks data/tracks.tsv ~/Music/iTunes/iTunes\\ Music\\ Library.xml",
    "json": "itunes-data --tracks data/tracks.json ~/Music/iTunes/iTunes\\ Music\\ Library.xml",
    "jsonFormat": "itunes-data --tracks --format json ~/Music/iTunes/iTunes\\ Music\\ Library.xml >> data/tracks2.json"
  }

TO be sure it's not fast-csv fault, due to #issue #15 I installed [email protected] manually. I tried also with fast-csv@latest:

  "dependencies": {
    "fast-csv": "^2.4.1",
    "itunes-data": "^0.1.4"
  }

I have to remove manually ./node_modules/itunes-data/node_modules/fast-scv

But described issue above is still reproduced.
BTW, I also tried --format==json and using >>. Still the same - all stdout goes to file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants