SwapnilSoni1999 / spotify-dl

Spotify Downloader and alternative of Spotdl(python) tool made in NodeJS based on youtube-dl

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add flag for youtube search link.

wallysaurus opened this issue · comments

The are certain songs on Spotify (in my case, a song called "????" by EDEN) that have characters which the youtube search bar ignores. Supplying the youtube link as the Spotify link allows for the correct song to be looked up, however all the related metadata doesn't come with it.

Make something like
spotifydl "https://open.spotify.whatever" --youtube-link="https://youtube.com/watch?"
This way, lyrics/artist/album/album-cover information can be correctly gathered from spotify, along with the correct mp3 from youtube.

I realized that the docs are indirectly suggesting --search-format is what gets pasted into the youtube search bar, however I was running into a runtime error while attempting to do this.

My command: spotifydl "https://open.spotify.com/track/3xsqVzOwQIF3cx1BUOXfwr?si=0a507d54711b4872" --search-format="https://www.youtube.com/watch?v=OPXf73Wiakc"

commented

that could work, only reason id suggest we shouldnt is it would just be very tedious to make the feature useful in a large scale use imo,

before we add such a flag, lets see if we can workout exactly whats going wrong.

The issue with search format you have used is it's in an incorrect format just allows you to adjust the search, i.e "something {itemName} - {albumName} anyrandomextrastring" , granted it was designed very quickly.

Looking at the code we just assume when supplying the search-format string we assume there is atleast 1 match i.e itemName or albumname ect. https://github.com/SwapnilSoni1999/spotify-dl/blob/master/util/format-generators.js#L17

We could instead change it to if no matches just assume its a hardcoded string for a search, so instead you would just manually supply whatever you would type into youtube to the "search-format"

But before we do that, do you have an example song item as i find it weird it ditches ? characters. its possible its something in the downstream package yt-search

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

This issue has been automatically closed as stale due to lack of activity, Please reopen if you think this needs to be