Giter Club home page Giter Club logo

spotify-dl's Introduction

Spotify Downloader



Download audio files from spotify links(Based on: youtube-dl)

 

Required

Get FFMPEG

Node.js 14

Note: if you run into issues related to puppeteer chromium download please try PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true npm install -g spotify-dl

spotifydl

A simple commandline utility that allows you to download Spotify Songs, Shows, Episodes, Playlists and Albums from Youtube.

PLEASE NOTE:

  • The ability to find a video is dependent on the fact it is hosted on youtube, and even then there is a chance it is still incorrectly matched
  • Some items may only be available to spotify premium users, please be sure to provide a username and password when this is the case

Installation

NPM

Install from npm registry

npm install -g spotify-dl

or You can do manually

git clone https://github.com/SwapnilSoni1999/spotify-dl
cd spotify-dl
npm install
npm link

Android (Termux)

PS: You may need to type termux-setup-storage first and allow storage permission

sh -c "$(curl -fsSL https://raw.githubusercontent.com/SwapnilSoni1999/spotify-dl/master/tools/termux.sh)"

Docker

Build docker image:

git clone https://github.com/SwapnilSoni1999/spotify-dl
cd spotify-dl
docker build -t spotify-dl .

Usage

To download highest quality audio file

spotifydl <spotify track/album/playlist link> ...

 

Example

spotifydl https://open.spotify.com/track/xyz

Options

Flag Long Flag Usage
--o --output takes valid output path argument
--es --extra-search takes extra search string/term to be used for youtube search
--oo --output-only enforces all downloaded songs in the output dir
--sf --search-format provide template for youtube api, supports albumName, artistName,itemName
"something {itemName} - {albumName} anyrandomextrastring"
--of --output-format provide template for output of filenames, supports albumName, artistName,itemName
3 x _ are used to signify directories
"something___{artistName}{albumName}{itemName}"
--ef --exclusion-filters comma separated string of exclusion filters
each filter will be checked against the description and title if found the link will be ignored
--st --saved-tracks download spotify saved tracks
--ss --saved-songs download spotify saved shows
--sp --saved-playlists download spotify saved playlists
--sa --saved-albums download spotify saved albums
--l --login Requests a login in an external window (non tty should use --u and --p) (Docker without -it is non tty)
--u --username spotify username for headless long (Note: you must use --login once to grant access)
--p --password spotify password
--cf --cache-file takes valid output file name path argument
--dr --download-report output a download report of what files failed
--cof --cookie-file takes valid file name path argument to a txt file for youtube cookies
--v --version returns current version
--h --help outputs help text
--dl --download-lyrics enables downloading of lyrics
--oft --output-file-type choose which type of file to be output as

Notes

To use --u and --p (headless login) you must do a --l once first to grant required permissions (playlists, saved songs ect.)

if you receive 'Got a spotify api error WebapiRegularError: An error occurred while communicating with Spotify's Web API Details: non existing id' you may need to provide auth either use --l for manual login prompt or --u username --p password for headless login

If you receive a 429 error please provide a cookies file given the --cof flag, to generate a cookies file please refer to Chrome or Firefox

Docker

docker run -it --user=$(id -u):$(id -g) -v $(pwd):/download --rm spotify-dl <options-to-spotify-dl defaults to --help>
docker run -it --user=$(id -u):$(id -g) -v $(pwd):/download --rm spotify-dl "https://open.spotify.com/...."

Acknowledgements

thanks to icons8 for icons in hero image and all the contributors for PR, suggestions and testing :love:

 

License

MIT © Swapnil Soni

spotify-dl's People

Contributors

alaendle avatar benthieu avatar dependabot[bot] avatar gnujoow avatar gringineer avatar hidimpu avatar javalsai avatar josefwells avatar mid0aria avatar nij4t avatar otep avatar pavanjadhaw avatar pedrorault avatar phyzical avatar raprocks avatar swapnilsoni1999 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

spotify-dl's Issues

Getting error while downloading a playlist with "/" character.

⠋ Searching…⠙ Searching…⠹ Searching…ℹ Total Songs: 78
ℹ Saving Playlist: /content/drive/My Drive/anime-songs/Peace and Sorrows (Anime/Misc) - Jadd Lee
✖ Something went wrong!
{ Error: ENOENT: no such file or directory, mkdir '/content/drive/My Drive/anime-songs/Peace and Sorrows (Anime/Misc) - Jadd Lee'
    at Object.fs.mkdirSync (fs.js:885:18)
    at Object.read (/usr/local/lib/node_modules/spotify-dl/lib/cache.js:19:16)
    at /usr/local/lib/node_modules/spotify-dl/cli.js:109:38
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:188:7)
  errno: -2,
  code: 'ENOENT',
  syscall: 'mkdir',
  path: '/content/drive/My Drive/anime-songs/Peace and Sorrows (Anime/Misc) - Jadd Lee' }

getting error , evrytime downloading a playlist with ''/"
please fix.

m4a audio instead of mp3

Is it possible to let the audio format in m4a?
m4a is the youtube native audio data, so there is no need to do a lossy converstion to mp3 (unless user can only play mp3 format).

Specifying where to download doesnt work after new update.

So there was the new update. I downloaded it and tried to download a song. I go to the folder i specified. Nothing. I check the folder where the npm module is installed and they are there. They also got a rather wierd name. I specified D:\Music, the song name would have DMusic infront of the file. Please ik that if I go to the D:\Music folder it will install there but im too lazy. Also sending a screen. Here is the screenshot!

[enhancement] Use "lyric" in the search query for Youtube

Searching Youtube for music will always land the official video as the top result
Official videos have blank audio for music videos which is not a part of the song itself
Searching for a lyric video instead will find a result which is not the official video

Example:
Billie Ellish - Therefore I Am lyrics

[request] publish package to npm registry?

Publishing spotifydl to npm registry will make it easier for users to install spotifydl seemlessly without hassle using single command

npm install -g spotifydl

You can also publish it as scoped package if spotifydl name is already taken

npm install -g @swapnilsoni/spotifydl

Tried to download a long album, it failed.

Here is the error screenshot.

× Something went wrong! TypeError: Cannot read property 'forEach' of undefined at C:\Users\Samuel Škula\AppData\Roaming\npm\node_modules\spotify-dl\lib\api.js:94:44 at processTicksAndRejections (internal/process/task_queues.js:97:5) at async Spotifye.extrAlbum (C:\Users\Samuel Škula\AppData\Roaming\npm\node_modules\spotify-dl\util\get-songdata.js:43:23) at async C:\Users\Samuel Škula\AppData\Roaming\npm\node_modules\spotify-dl\cli.js:141:22

Bug : Command failed: where ffmpeg

Windows: 10 x64

child_process.js:677
    throw err;
    ^

Error: Command failed: where ffmpeg
INFORMA��ES: n�o foi poss�vel localizar arquivos para o(s) padr�o(�es) especificado(s).

    at checkExecSyncError (child_process.js:637:11)
    at execSync (child_process.js:674:13)
    at Object.ffmpeg (C:\Users\DEV-01-PC\AppData\Roaming\npm\node_modules\spotify-dl\lib\setup.js:8:38)
    at Object.<anonymous> (C:\Users\DEV-01-PC\AppData\Roaming\npm\node_modules\spotify-dl\cli.js:16:7)
    at Module._compile (internal/modules/cjs/loader.js:805:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:816:10)
    at Module.load (internal/modules/cjs/loader.js:672:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:612:12)
    at Function.Module._load (internal/modules/cjs/loader.js:604:3)
    at Function.Module.runMain (internal/modules/cjs/loader.js:868:12)
PS F:\xampp\htdocs\lucas>```

Throws error

| Downloading...events.js:187
throw er; // Unhandled 'error' event
^

Error: Input stream error: This video is unavailable
at PassThrough. (D:\Downloads\Song\spotify-dl\node_modules\fluent-ffmpeg\lib\processor.js:452:34)
at PassThrough.emit (events.js:210:5)
at D:\Downloads\Song\spotify-dl\node_modules\ytdl-core\lib\index.js:19:14
at D:\Downloads\Song\spotify-dl\node_modules\ytdl-core\lib\info.js:370:25
at D:\Downloads\Song\spotify-dl\node_modules\ytdl-core\lib\info.js:255:7
at D:\Downloads\Song\spotify-dl\node_modules\ytdl-core\lib\info.js:373:9
at D:\Downloads\Song\spotify-dl\node_modules\ytdl-core\lib\info.js:198:5
at PassThrough. (D:\Downloads\Song\spotify-dl\node_modules\miniget\dist\index.js:196:32)
at PassThrough.emit (events.js:210:5)
at endReadableNT (_stream_readable.js:1183:12)
Emitted 'error' event on FfmpegCommand instance at:
at emitEnd (D:\Downloads\Song\spotify-dl\node_modules\fluent-ffmpeg\lib\processor.js:424:16)
at PassThrough. (D:\Downloads\Song\spotify-dl\node_modules\fluent-ffmpeg\lib\processor.js:454:15)
at PassThrough.emit (events.js:210:5)
[... lines matching original stack trace ...]
at PassThrough.emit (events.js:210:5) {
inputStreamError: Error: This video is unavailable
at D:\Downloads\Song\spotify-dl\node_modules\ytdl-core\lib\info.js:255:16
at D:\Downloads\Song\spotify-dl\node_modules\ytdl-core\lib\info.js:373:9
at D:\Downloads\Song\spotify-dl\node_modules\ytdl-core\lib\info.js:198:5
at PassThrough. (D:\Downloads\Song\spotify-dl\node_modules\miniget\dist\index.js:196:32)
at PassThrough.emit (events.js:210:5)
at endReadableNT (_stream_readable.js:1183:12)
at processTicksAndRejections (internal/process/task_queues.js:80:21)
}

Feature request

can this script be accessible on a website once installed on a LAMP server?

another question:

how can I configure the output so I get:

ARTIST - TRACK.mp3 (instead of the opposite)

best regards

Downloads super slow

hi, i really love this and it's working great mostly, but the downloads are super slow.
is this a limitation on youtube's side?
EDIT: also what i've noticed, the download text flickers constantly.

erorr

module.js:549
throw err;
^

Error: Cannot find module 'm3u8stream/lib/parse-time'
at Function.Module._resolveFilename (module.js:547:15)
at Function.Module._load (module.js:474:25)
at Module.require (module.js:596:17)
at require (internal/module.js:11:18)
at Object. (/home/elanoos/spotify-dl/node_modules/ytdl-core/lib/info-extras.js:5:21)
at Module._compile (module.js:652:30)
at Object.Module._extensions..js (module.js:663:10)
at Module.load (module.js:565:32)
at tryModuleLoad (module.js:505:12)
at Function.Module._load (module.js:497:3)

Eternal loading

Снимок экрана от 2020-05-02 17-52-11
Not loading, eternal loading
Some songs do not want to download

Tag for v0.4.7 in the wrong place

I just did a pull and a fresh pull just to make sure. The tags v0.4.6 and v0.4.7 both point to the same commit. The commit after that bumps the version to v0.4.7, so the v0.4.7 should probably be set there too.

FFMPEG Invalid Argument

Trying to download: https://open.spotify.com/album/4GGazqHvuKwxBjWLFaJkDL

Probably a issue on parsing spaces. Should be replaced with "\ ".

Log:

ℹ Total Songs: 12
ℹ Saving Album: Justice/Justice - Ed Banger Records
ℹ 1. Song: Genesis - Justice
⠋ Downloading 1.13MB of 3.77MB
events.js:174
      throw er; // Unhandled 'error' event
      ^

Error: ffmpeg exited with code 1: /home/<home>/Music/Justice/Justice - Ed Banger Records: Invalid argument

    at ChildProcess.<anonymous> (<path-to-sptifydl>/spotify-dl/node_modules/fluent-ffmpeg/lib/processor.js:182:22)
    at ChildProcess.emit (events.js:198:13)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:248:12)
Emitted 'error' event at:
    at emitEnd (<path-to-sptifydl>/spotify-dl/node_modules/fluent-ffmpeg/lib/processor.js:424:16)
    at endCB (<path-to-sptifydl>spotify-dl/node_modules/fluent-ffmpeg/lib/processor.js:544:13)
    at handleExit (<path-to-sptifydl>/spotify-dl/node_modules/fluent-ffmpeg/lib/processor.js:170:11)
    at Socket.<anonymous> (<path-to-sptifydl>/spotify-dl/node_modules/fluent-ffmpeg/lib/processor.js:197:11)
    at Socket.emit (events.js:203:15)
    at Pipe._handle.close (net.js:607:12)

Note: Replace <path-to-sptifydl> with the location were spotify-dl is cloned.

The tool fails to create a dir with the playlist's name

Expected behavior: Create a directory to save songs into.
Current behavior: Fails to create the directory.
Platform: Win64
Reason: The playlist's name contains illegal chars (like :) witch cannot be set in a directory's name.
Fix: Implement a check or a regular expression to find and replace illegal chars
i would be happy to adjust it and open a pr if you allow me to :)

Typerror while downloading

Sometimes when I start downloading, it downloads like 5 songs, then I get this error
Downloading...Error: Input stream error: The "url" argument must be of type string. Received an instance of TypeError at PassThrough.<anonymous> (/usr/lib/node_modules/spotify-dl/node_modules/fluent-ffmpeg/lib/processor.js:452:34) at PassThrough.emit (events.js:315:20) at /usr/lib/node_modules/spotify-dl/node_modules/ytdl-core/lib/index.js:19:14 at runMicrotasks (<anonymous>) at processTicksAndRejections (internal/process/task_queues.js:97:5)
For no apparent reason, I then start downloading again and the issue is "fixed", as in it downloads like 3 more songs and then throws the error again

Error while Downloading

While trying to download a playlist, this is popping up consistently. OS- Windows 10.

Downloading...Error: Input stream error: Error parsing info: Unable to retrieve video metadata
at PassThrough. (C:\Users\prizrak\AppData\Roaming\npm\node_modules\spotify-dl\node_modules\fluent-ffmpeg\lib\processor.js:452:34)
at PassThrough.emit (events.js:315:20)
at runMicrotasks ()
at processTicksAndRejections (internal/process/task_queues.js:93:5)
Error: Input stream error: Too many redirects
at PassThrough. (C:\Users\prizrak\AppData\Roaming\npm\node_modules\spotify-dl\node_modules\fluent-ffmpeg\lib\processor.js:452:34)
at PassThrough.emit (events.js:327:22)
at PassThrough.emit (events.js:327:22)
at onError (C:\Users\prizrak\AppData\Roaming\npm\node_modules\spotify-dl\node_modules\m3u8stream\dist\index.js:67:16)
at onQueuedEnd (C:\Users\prizrak\AppData\Roaming\npm\node_modules\spotify-dl\node_modules\m3u8stream\dist\index.js:82:13)
at PassThrough. (C:\Users\prizrak\AppData\Roaming\npm\node_modules\spotify-dl\node_modules\m3u8stream\dist\queue.js:39:17)
at PassThrough.emit (events.js:315:20)
at ClientRequest. (C:\Users\prizrak\AppData\Roaming\npm\node_modules\spotify-dl\node_modules\m3u8stream\node_modules\miniget\dist\index.js:129:28)
at Object.onceWrapper (events.js:422:26)
at ClientRequest.emit (events.js:315:20)
Emitted 'error' event on FfmpegCommand instance at:
at emitEnd (C:\Users\prizrak\AppData\Roaming\npm\node_modules\spotify-dl\node_modules\fluent-ffmpeg\lib\processor.js:424:16)
at PassThrough. (C:\Users\prizrak\AppData\Roaming\npm\node_modules\spotify-dl\node_modules\fluent-ffmpeg\lib\processor.js:454:15)
at PassThrough.emit (events.js:327:22)
[... lines matching original stack trace ...]
at Object.onceWrapper (events.js:422:26) {
inputStreamError: Error: Too many redirects
at ClientRequest. (C:\Users\prizrak\AppData\Roaming\npm\node_modules\spotify-dl\node_modules\m3u8stream\node_modules\miniget\dist\index.js:129:42)
at Object.onceWrapper (events.js:422:26)
at ClientRequest.emit (events.js:315:20)
at HTTPParser.parserOnIncomingClient [as onIncoming] (_http_client.js:641:27)
at HTTPParser.parserOnHeadersComplete (_http_common.js:126:17)
at TLSSocket.socketOnData (_http_client.js:509:22)
at TLSSocket.emit (events.js:315:20)
at addChunk (_stream_readable.js:309:12)
at readableAddChunk (_stream_readable.js:284:9)
at TLSSocket.Readable.push (_stream_readable.js:223:10)

Error in playlist link

Hello,
I am having a problem with your library, the application is blocking 30 th music in a playlist, here is the error. But I don't understand the error ?

✔ Metadata Merged!
ℹ 30. Song: Cellophané - Rim'K
- Downloading...
TypeError [ERR_INVALID_ARG_TYPE]: The "url" argument must be of type string. Received type object
    at Url.parse (url.js:154:11)
    at Object.urlParse [as parse] (url.js:148:13)
    at Object.exports.getURLVideoID (/usr/lib/node_modules/spotify-dl/node_modules/ytdl-core/lib/util.js:265:22)
    at Object.exports.getVideoID (/usr/lib/node_modules/spotify-dl/node_modules/ytdl-core/lib/util.js:298:20)
    at Function.exports.(anonymous function) [as getInfo] (/usr/lib/node_modules/spotify-dl/node_modules/ytdl-core/li
b/info.js:335:17)
    at ytdl (/usr/lib/node_modules/spotify-dl/node_modules/ytdl-core/lib/index.js:17:8)
    at downloader (/usr/lib/node_modules/spotify-dl/lib/downloader.js:14:20)
    at downloadLoop (/usr/lib/node_modules/spotify-dl/cli.js:156:13)
    at process._tickCallback (internal/process/next_tick.js:68:7)

Voici le lien de la playlist : https://open.spotify.com/playlist/4tYmq6H1dowHunEZ8lQJTO?si=hY1IgOrGQJK7nXoU7Y8vYw

thank you so much

Tried to download a song, the song is not on youtube and it downloaded the first result, which is a 4.5 hour compilation

Tried to download https://open.spotify.com/track/5FAm2NCjU38DdARBhdwEzT
What was downloaded: https://www.youtube.com/watch?v=fbDwaUej4aE
I tried searching for the song on youtube, but I couldn't find it, so I guess that's why, but still, there should be a limit/confirmation for song length, maybe error if it's not found, since it was stuck at 0MB out of 0MB until it finished, and the result file is over 500MB.

error while downloading on android

java.io.FileNotFoundException: /data/data/
com.termux/files/home/downloads: open failed:
EISDIR (1s a directory)

I get this error when the file is being saved/ when it's asking me to select the folder.

I'm using a onePlus6t running Android 10
Installed using termux

I get this error when i share the link to termux

Download issue

Hey , i cant download anything with this.Can you help ?

INFO: Could not find files for the given pattern(s).
child_process.js:669
    throw err;
    ^

> Error: Command failed: where ffmpeg
> INFO: Could not find files for the given pattern(s).
> 
>     at checkExecSyncError (child_process.js:629:11)
>     at execSync (child_process.js:666:13)
>     at Object.ffmpeg (C:\Users\EXCALIBUR\AppData\Roaming\npm\node_modules\spotify-dl\lib\setup.js:8:38)
>     at Object.<anonymous> (C:\Users\EXCALIBUR\AppData\Roaming\npm\node_modules\spotify-dl\cli.js:16:7)
>     at Module._compile (internal/modules/cjs/loader.js:778:30)
>     at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
>     at Module.load (internal/modules/cjs/loader.js:653:32)
>     at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
>     at Function.Module._load (internal/modules/cjs/loader.js:585:3)
>     at Function.Module.runMain (internal/modules/cjs/loader.js:831:12)

feat: Add support for parallel downloads

When downloading albums/playlists the app can handle only one track at a time. Once it finishes downloading that track it switches to another one in the queue.
Using nodejs workers that was introduced in v10 can be used to delegate downloading of tracks to a dedicated thread. Another way of implementing that feature is to use process forks to support older versions of nodejs.

Module not found

Running on Android 10.0 termux shows this error.

internal/modules/cjs/loader.js:798
    throw err;
    ^

Error: Cannot find module 'm3u8stream/lib/parse-time'
Require stack:
- /data/data/com.termux/files/usr/lib/node_modules/spotify-dl/node_modules/ytdl-core/lib/info-extras.js
- /data/data/com.termux/files/usr/lib/node_modules/spotify-dl/node_modules/ytdl-core/lib/info.js
- /data/data/com.termux/files/usr/lib/node_modules/spotify-dl/node_modules/ytdl-core/lib/index.js
- /data/data/com.termux/files/usr/lib/node_modules/spotify-dl/lib/downloader.js
- /data/data/com.termux/files/usr/lib/node_modules/spotify-dl/cli.js
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:795:15)
    at Function.Module._load (internal/modules/cjs/loader.js:688:27)
    at Module.require (internal/modules/cjs/loader.js:850:19)
    at require (internal/modules/cjs/helpers.js:74:18)
    at Object.<anonymous> (/data/data/com.termux/files/usr/lib/node_modules/spotify-dl/node_modules/ytdl-core/lib/info-extras.js:5:21)
    at Module._compile (internal/modules/cjs/loader.js:958:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:994:10)
    at Module.load (internal/modules/cjs/loader.js:813:32)
    at Function.Module._load (internal/modules/cjs/loader.js:725:14)
    at Module.require (internal/modules/cjs/loader.js:850:19) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '/data/data/com.termux/files/usr/lib/node_modules/spotify-dl/node_modules/ytdl-core/lib/info-extras.js',
    '/data/data/com.termux/files/usr/lib/node_modules/spotify-dl/node_modules/ytdl-core/lib/info.js',
    '/data/data/com.termux/files/usr/lib/node_modules/spotify-dl/node_modules/ytdl-core/lib/index.js',
    '/data/data/com.termux/files/usr/lib/node_modules/spotify-dl/lib/downloader.js',
    '/data/data/com.termux/files/usr/lib/node_modules/spotify-dl/cli.js'
  ]
}

PS: ffmpeg installed and running

Get rid of FFMG

Hi, @SwapnilSoni1999 I have created scripts for saavn, pluralsight, hotstar etc I don't know why need ffmg tools in the first place. will you get rid of it?

Error: Not a YouTube domain

Hi
I seem to be getting the following error on some songs,

spotifydl https://open.spotify.com/track/3Y7Gf7COnnFqrZZ7voGy22?si=-qYWxjvUQxiF9ivL2Wh3ww
ℹ Saving Song to: /home/avremy/Ben Fayga - Lipa.mp3



✔ Song: Ben Fayga - Lipa
⠋ Downloading...Something went wrong!
Error: Not a YouTube domain
    at Object.exports.getURLVideoID (/usr/local/lib/node_modules/spotify-dl/node_modules/ytdl-core/lib/util.js:279:12)
    at Object.exports.getVideoID (/usr/local/lib/node_modules/spotify-dl/node_modules/ytdl-core/lib/util.js:304:20)
    at Function.exports.(anonymous function) [as getInfo] (/usr/local/lib/node_modules/spotify-dl/node_modules/ytdl-core/lib/info.js:362:21)
    at ytdl (/usr/local/lib/node_modules/spotify-dl/node_modules/ytdl-core/lib/index.js:17:8)
    at downloader (/usr/local/lib/node_modules/spotify-dl/lib/downloader.js:14:20)
    at /usr/local/lib/node_modules/spotify-dl/cli.js:98:17
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:188:7)

is this a known bug ?

thanks

Error running

image

Hi guys i had experience this when running even installed the ffmpeg any thoughts?

Invalid Argument error when downloading album

When trying to download an album the application crashes with Invalid Argument

spotifydl https://open.spotify.com/album/xyz                                                                                                                                           
ℹ Total Songs: 4
ℹ Saving Album: /Users/someuser/Music/Album Name
ℹ 1. Song: First song
⠸ Downloading...events.js:187
      throw er; // Unhandled 'error' event
      ^

Error: ffmpeg exited with code 1: /Users/someuser/Music/Album Name: Invalid argument

    at ChildProcess.<anonymous> (/Users/someuser/.nvm/versions/node/v12.13.1/lib/node_modules/spotify-dl/node_modules/fluent-ffmpeg/lib/processor.js:182:22)
    at ChildProcess.emit (events.js:210:5)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:272:12)
Emitted 'error' event on FfmpegCommand instance at:
    at emitEnd (/Users/someuser/.nvm/versions/node/v12.13.1/lib/node_modules/spotify-dl/node_modules/fluent-ffmpeg/lib/processor.js:424:16)
    at endCB (/Users/someuser/.nvm/versions/node/v12.13.1/lib/node_modules/spotify-dl/node_modules/fluent-ffmpeg/lib/processor.js:544:13)
    at handleExit (/Users/someuser/.nvm/versions/node/v12.13.1/lib/node_modules/spotify-dl/node_modules/fluent-ffmpeg/lib/processor.js:170:11)
    at ChildProcess.<anonymous> (/Users/someuser/.nvm/versions/node/v12.13.1/lib/node_modules/spotify-dl/node_modules/fluent-ffmpeg/lib/processor.js:182:11)
    at ChildProcess.emit (events.js:210:5)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:272:12)

The "url" argument must be of type string. Received an instance of TypeError

I was trying to download a playlist, but this song kept throwing this error, even when downloading it separately: https://open.spotify.com/track/4IxwUN8Q34OLznTomcg6LL
Using version 0.4.3 (for some reason it says that an update is available, but package.json in this repo has the same version, already tried reinstalling)

PS C:\Users\X\Desktop\test> spotifydl "https://open.spotify.com/track/4IxwUN8Q34OLznTomcg6LL"                                                         ========Update Available========
Use npm install -g spotify-dl
to update the package.
================================
i Saving Song to: C:\Users\X\Desktop\test\Agunamonita -202- - Saitama Saisyu Heiki.mp3
√ Song: Agunamonita -202- - Saitama Saisyu Heiki
× Something went wrong!
TypeError [ERR_INVALID_ARG_TYPE]: The "url" argument must be of type string. Received an instance of TypeError
    at validateString (internal/validators.js:117:11)
    at Url.parse (url.js:159:3)
    at Object.urlParse [as parse] (url.js:154:13)
    at Object.exports.getURLVideoID (C:\Users\X\AppData\Roaming\npm\node_modules\spotify-dl\node_modules\ytdl-core\lib\util.js:252:22)
    at Object.exports.getVideoID (C:\Users\X\AppData\Roaming\npm\node_modules\spotify-dl\node_modules\ytdl-core\lib\util.js:285:20)
    at Function.exports.<computed> [as getInfo] (C:\Users\Pawii\AppData\Roaming\npm\node_modules\spotify-dl\node_modules\ytdl-core\lib\info.js:320:19)
    at ytdl (C:\Users\X\AppData\Roaming\npm\node_modules\spotify-dl\node_modules\ytdl-core\lib\index.js:17:8)
    at downloader (C:\Users\X\AppData\Roaming\npm\node_modules\spotify-dl\lib\downloader.js:14:20)
    at C:\Users\X\AppData\Roaming\npm\node_modules\spotify-dl\cli.js:96:17
    at processTicksAndRejections (internal/process/task_queues.js:97:5) {
  code: 'ERR_INVALID_ARG_TYPE'
}
PS C:\Users\X\Desktop\test>

(replaced username with X)

Problems with downloads

Tried to download this track: https://open.spotify.com/track/6Ey0OR1AwumO2jgYnNo0MK?si=D4va3fMdRVqmcdl0bOpMrQ
(Don't mind the song lol)

Greeted with this error:

i Saving Song to: C:\Users\khirv\Heitterit - LAZZI.mp3

√ Song: Heitterit - LAZZI
- Downloading...Something went wrong!
TypeError [ERR_INVALID_ARG_TYPE]: The "url" argument must be of type string. Received type object
    at Url.parse (url.js:152:11)
    at Object.urlParse [as parse] (url.js:146:13)
    at Object.exports.getURLVideoID (C:\Users\khirv\AppData\Roaming\npm\node_modules\spotify-dl\node_modules\ytdl-core\lib\util.js:273:22)
    at Object.exports.getVideoID (C:\Users\khirv\AppData\Roaming\npm\node_modules\spotify-dl\node_modules\ytdl-core\lib\util.js:304:20)
    at Function.exports.(anonymous function) [as getInfo] (C:\Users\khirv\AppData\Roaming\npm\node_modules\spotify-dl\node_modules\ytdl-core\lib\info.js:362:21)
    at ytdl (C:\Users\khirv\AppData\Roaming\npm\node_modules\spotify-dl\node_modules\ytdl-core\lib\index.js:17:8)
    at downloader (C:\Users\khirv\AppData\Roaming\npm\node_modules\spotify-dl\lib\downloader.js:14:20)
    at C:\Users\khirv\AppData\Roaming\npm\node_modules\spotify-dl\cli.js:98:17
    at process._tickCallback (internal/process/next_tick.js:68:7)

Also, I tried to download this song: https://open.spotify.com/track/7bqpbw3e3TeJwgYWRYtE1K?si=eyFynJ5eReKff4Qr5HOMyQ

It says the download is 3401.37MB in size, the song in itself is like 1:15 long, here's the output:

i Saving Song to: C:\Users\khirv\Heroes Of Might And Magic III Snowland - buskerflutist.mp3

√ Song: Heroes Of Might And Magic III Snowland - buskerflutist
/ Downloading 21.09MB of 3401.37MB

(Obviously skipped the download)

Error when running downloader

Hi, when downloading any song, I get this error:

TypeError: Cannot read property 'length' of undefined
at PassThrough.download.on (C:\Users[username]\spotify-dl\lib\downloader.js:30:27)
at emitNone (events.js:111:20)
at PassThrough.emit (events.js:208:7)
at endReadableNT (_stream_readable.js:1064:12)
at _combinedTickCallback (internal/process/next_tick.js:138:11)
at process._tickCallback (internal/process/next_tick.js:180:9)

It shows up after the "downloading" has finished.

I've used these songs:
https://open.spotify.com/track/1T5MCAhOH1dtFsYXV627jh?si=jHy4cjfEQ3WNARCPQNTtGw
https://open.spotify.com/track/4mOPVJGfWXH0wPFA6xeRDz?si=mRY7X4tpRZaWcZS7dHfxfQ

Download shows episodes

Is there a way to support downloading shows episodes?
I would like to download some podcast episodes.

Let me know if it's possible and if yes, what does need to change in the code?

No downloading

Saving Song to: /data/data/com.termux/files/home/La Copa de Todos - David Correy.mp3
✔ Song: La Copa de Todos - David Correy
⠋ Downloading...TypeError [ERR_INVALID_ARG_TYPE]: The "url" argument must be of type string. Received an instance of TypeError
at validateString (internal/validators.js:121:11)
at Url.parse (url.js:159:3)
at Object.urlParse [as parse] (url.js:154:13)
at Object.exports.getURLVideoID (/data/data/com.termux/files/usr/lib/node_modules/spotify-dl/node_modules/ytdl-core/lib/util.js:254:22)
at Object.exports.getVideoID (/data/data/com.termux/files/usr/lib/node_modules/spotify-dl/node_modules/ytdl-core/lib/util.js:287:20)
at Object.exports. [as getFullInfo] (/data/data/com.termux/files/usr/lib/node_modules/spotify-dl/node_modules/ytdl-core/lib/info.js:291:19)
at Function.exports. [as getInfo] (/data/data/com.termux/files/usr/lib/node_modules/spotify-dl/node_modules/ytdl-core/lib/info.js:287:29)
at ytdl (/data/data/com.termux/files/usr/lib/node_modules/spotify-dl/node_modules/ytdl-core/lib/index.js:17:8)
at downloader (/data/data/com.termux/files/usr/lib/node_modules/spotify-dl/lib/downloader.js:14:20)
at /data/data/com.termux/files/usr/lib/node_modules/spotify-dl/cli.js:96:17
$
Escribe un mensaje...

Error downloading

ℹ 6. Song: Flexem - Ohmie
⠙ Downloading...events.js:183
throw er; // Unhandled 'error' event
^

Error: Input stream error: Too many redirects
at PassThrough. (/usr/local/lib/node_modules/spotify-dl/node_modules/fluent-ffmpeg/lib/processor.js:452:34)
at emitOne (events.js:121:20)
at PassThrough.emit (events.js:211:7)
at PassThrough.req.prependListener (/usr/local/lib/node_modules/spotify-dl/node_modules/ytdl-core/lib/index.js:131:14)
at emitOne (events.js:121:20)
at PassThrough.emit (events.js:211:7)
at onError (/usr/local/lib/node_modules/spotify-dl/node_modules/m3u8stream/lib/index.js:64:12)
at onQueuedEnd (/usr/local/lib/node_modules/spotify-dl/node_modules/m3u8stream/lib/index.js:81:7)
at PassThrough._worker (/usr/local/lib/node_modules/spotify-dl/node_modules/m3u8stream/lib/queue.js:43:23)
at emitOne (events.js:116:13)

Couldn't find ffmpeg

Hi. I'm using spotifydl URL within another PHP script with shell_exec() and it says couldn't find ffmpeg while it is installed.
thanks for your great program again.

Error: Input stream error: Error parsing info: Unable to retrieve video metadata

Heyy THANKS FOR YOUR PROJECT !!!

But there is an error which i m facing

This is the link for the song i am trying to download https://open.spotify.com/track/1G3u6h9MfeoAZYVbPTptbD?si=-4OCuxBTTVKl0cyK3OUb6A

But i get this error

spotifydl -o /storage/emulated/0/ https://open.spotify.com/track/1G3u6h9MfeoAZYVbPTptbD?si=yuQCmt13R8KRxj6-roKPJQ

ℹ Saving Song to: /storage/emulated/0/Grief and Sorrow - DoctorNoSense.mp3
✔ Song: Grief and Sorrow - DoctorNoSense
⠋ Downloading...Error: Input stream error: Error parsing info: Unable to retrieve video metadata
    at PassThrough.<anonymous> (/data/data/com.termux/files/usr/lib/node_modules/spotify-dl/node_modules/fluent-ffmpeg/lib/processor.js:452:34)
    at PassThrough.emit (events.js:315:20)
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (internal/process/task_queues.js:93:5)

Hope you will look knto the natter as soon as possible 🙂

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.