danguilherme / spotivy

:musical_score: Download music videos from Spotify playlists
https://danguilherme.github.io/blog/spotivy
MIT License
85 stars 11 forks source link

Error parsing info: Unexpected token ) in JSON at position 0 #35

Closed Giovancruz closed 2 years ago

Giovancruz commented 2 years ago

Bug report

[spotivy v0.4.8]
                  [DEBUG] Loaded options:
 {
  "spotifyClientId": "",
  "spotifyClientSecret": "",
  "youtubeKey": "",
  "output": "/home/giovan/Música/media",
  "format": "audio",
  "quality": "highest",
  "flat": false,
  "audio": true,
  "tracks": [
    "5tXyNhNcsnn7HbcABntOSf"
  ]
}
Saving media to '/home/giovan/Música/media'

                  [DEBUG] Spotify login
      [Downloading track] Usher - DJ Got Us Fallin' In Love
                  [DEBUG] Search video: search "Usher - DJ Got Us Fallin' In Love"
                  [DEBUG] Search video: 20 item(s) returned
                  [DEBUG] Search music video:
- 2 of the videos are good results:
- 1. "Usher - DJ Got Us Fallin' In Love (Official Music Video) ft. Pitbull", by UsherVEVO
- 2. "Usher - DJ Got Us Fallin' In Love (Live from iTunes Festival, London, 2012) ft. Pitbull", by UsherVEVO
                  [DEBUG] Search music video: selected "Usher - DJ Got Us Fallin' In Love (Official Music Video) ft. Pitbull", by UsherVEVO
                  [DEBUG] Download from: https://www.youtube.com/watch?v=C-dvTjK_07c
                  [DEBUG] Download to  : /home/giovan/Música/media/Usher - DJ Got Us Fallin' In Love.mp4
(node:8082) UnhandledPromiseRejectionWarning: Error: Error parsing info: Unexpected token ) in JSON at position 0
    at exports.getBasicInfo (/home/giovan/.nvm/versions/node/v10.15.3/lib/node_modules/spotivy/node_modules/ytdl-core/lib/info.js:71:11)
    at process._tickCallback (internal/process/next_tick.js:68:7)
(node:8082) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:8082) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

If the current behavior is a bug, please provide the steps to reproduce. spotivy init spotivy playlist 12147255850 6OfbkGAFPxvSv3fvmSx5x6 --v --audio

What is the expected behavior? Donwload the media on mp3 format.

Is there an error of my node version? What node version are required?

danguilherme commented 2 years ago

Hey, thanks for opening an issue!

First of all, I love this song! Reminds me of the playlist I used to listen all the time back in 2011 😄

This really looks like a bug. We actually need to upgrade ytdl-core to the latest version (together with other dependencies), as it is very outdated. I will try to do it as soon as possible.

Giovancruz commented 2 years ago

Thanks to you for the great tool!! Yeah, looks like Usher stayed at that time too, nothing new from him since this, kkkkk

I don't know how to help unfortunately, I'll have to wait, for update my offline drive device kkkkk

Thankyou!

danguilherme commented 2 years ago

This was solved in PR #32