question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ERROR: Error: Error parsing config: Unexpected token ; in JSON at position <position-number>

See original GitHub issue

I tried running the example music-dl http://gaana.com/album/aashiqui and I got the following error:

ERROR: Error: Error parsing config: Unexpected token ; in JSON at position <position-number>

for each of the .mp3 file. I tried to debug this by injecting several console.log() into the code. I found out with:

search.findLink().then((link) => console.log("1",link))

that the YouTubeSearch returned the correct URL. However when I tried to inject:

new YouTubeDownloader(link, outputPath, outputFilename).download()
.then((mp3OutputPath) => {
      console.log("HERE",mp3OutputPath)
      const tagger = new Id3Tagger(mp3OutputPath, trackInfo);
      tagger.tag();
      resolve(mp3OutputPath);
      }).catch(reject);

in youtube/client the above console.log() never outputed. Instead i got the above ERROR message. So I suspect this narrows down where the error is caused.

I am not good with java-script. Could you please debug and fix this?

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:3
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
GeekyPeascommented, Jul 26, 2020

Great! This works. However music-dl -v or music-dl -h don’t work any more. I think.

0reactions
vishaltelangrecommented, Jul 26, 2020

@GeekyPeas You’ve got an eagle’s eye! Thanks for sharing the details about the regression. I fixed it in the latest version v0.0.10.

After all, looks like this package needs some basic unit tests.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error parsing config: Unexpected token ; in JSON at ...
Was looking around the internet and it seems old youtube videos dont have an opus-stream, so you have to open it another way....
Read more >
What Is JSON and How to Handle an “Unexpected Token” ...
Learn what JSON is and how you can deal with errors occurring when parsing JSON data, such as "Unexpected Token < in JSON...
Read more >
Unexpected token in JSON at position 0 error
In very simple language, "Unexpected token < in JSON at position 0" indicates that you are parsing something else that is not JSON...
Read more >
Errors of Unexpected token in JSON at position XXX while ...
I do not configure proxy though as my machine is not on any corporate proxy. Anyway, I attach the npm log content and...
Read more >
Error syntaxerror unexpected token m in json at position 1
I get this error: SyntaxError: Unexpected token  in JSON at position 0. ... If a JSON string is already parsed in a...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found