GuillemCastro / spotify-dl

A command-line utility to download songs and playlists directly from Spotify's servers
MIT License
91 stars 13 forks source link

unwrap() issue #6

Closed wabiloo closed 6 months ago

wabiloo commented 12 months ago

This is my first attempt at running with Rust, so I'm afraid I'm not confident in trying to figure it by myself...

I had an error on my Mac, when trying to run it in the following ways (after a successful cargo build):

cargo run spotify-dl --username MyUserName "https://open.spotify.com/playlist/1lCFgHBNwlqxuki0H9BxGL?si=3fe59aa036f54ef3"
    Finished dev [unoptimized + debuginfo] target(s) in 0.23s
     Running `target/debug/spotify-dl spotify-dl --username MyUserName 'https://open.spotify.com/playlist/1lCFgHBNwlqxuki0H9BxGL?si=3fe59aa036f54ef3'`
Password:
thread 'main' panicked at src/main.rs:149:62:
called `Option::unwrap()` on a `None` value
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Any idea what this might be?

GuillemCastro commented 9 months ago

For anyone else having this issue, there seems to be an issue in the regex parsing the spotify URL. The workaround right now is to remove the parameter si= at the end but keeping the question mark.

cargo run spotify-dl --username MyUserName "https://open.spotify.com/playlist/1lCFgHBNwlqxuki0H9BxGL?"
qw3rtn commented 8 months ago

I have the same issue and removing "si=" does not work. I am using Debian 12 / Rust 1.7.6

RuinedYourLife commented 8 months ago

I have the same issue and removing "si=" does not work. I am using Debian 12 / Rust 1.7.6

how are you trying to run it? chances are you don't really know what you're doing and it's trying to parse something that doesn't fit at all. let's say you tried:

cargo run spotify-dl ...

well it's going to try to parse spotify-dl as a track name.

try to cargo build --release and then try to run the binary from your target/release/ directory.

qw3rtn commented 8 months ago

Yes, I ran spotify-dl via cargo like this:

cargo run spotify-dl --username user "https://open.spotify.com/playlist/1lCFgHBNwlqxuki0H9BxGL?" cargo run spotify-dl --username user "spotify:track:72NikOBusiF2xUToovTmxW"

Executing the binary file directly worked, thanks!