Skip to content

Commit 1e083d8

Browse files
pbxSathyaBhat
andauthored
Help users know what's wrong if they make the natural mistake of using a Spotiify URI instead of a Spotify link (#138)
* check user-provided URL; log error and exit if it's a Spotify URI * update contribs * bump up spotipy Co-authored-by: SathyaBhat <[email protected]>
1 parent 44cf2d3 commit 1e083d8

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

CONTRIBUTORS.md

+3-2
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,6 @@ spotify_dl wouldn't be what it is without the help and contributions of followin
1111
- [Gowtham](https://github.com/HackToHell) for [create playlist in download](https://github.com/SathyaBhat/spotify-dl/pull/23) directory
1212
- [alvierahman90](https://github.com/alvierahman90) for [config file support](https://github.com/SathyaBhat/spotify-dl/pull/42) and [Spotify playlist URL support](https://github.com/SathyaBhat/spotify-dl/pull/41)
1313
- [Bibhas](https://github.com/iambibhas) for fixing [can only concatenate list (not "str") to list error](https://github.com/SathyaBhat/spotify-dl/issues/44)
14-
- [Nikhil Nagaraju](https://github.com/nikhilnagaraju) for fixing support for playlist url with or without userid #58
15-
- [Luca]https://github.com/lucanello) for adding [YouTube scraping support](https://github.com/SathyaBhat/spotify-dl/pull/75)
14+
- [Nikhil Nagaraju](https://github.com/nikhilnagaraju) for fixing support for [playlist url with or without userid](https://github.com/SathyaBhat/spotify-dl/pull/58)
15+
- [Luca](https://github.com/lucanello) for adding [YouTube scraping support](https://github.com/SathyaBhat/spotify-dl/pull/75)
16+
- [Paul Bissex](https://github.com/pbx) for [better error description](https://github.com/SathyaBhat/spotify-dl/pull/138)

requirements.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
spotipy==2.16
1+
spotipy== 2.16.1
22
youtube-dl>=2020.11.29
33
sentry-sdk==0.19.4
44
wheel==0.34.2

spotify_dl/spotify.py

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import sys
12
from spotify_dl.scaffold import log
23
from spotify_dl.utils import sanitize
34

@@ -59,6 +60,9 @@ def parse_spotify_url(url):
5960
:param format_string: format string for the file conversion
6061
:return tuple indicating the type and id of the item
6162
"""
63+
if url.startswith("spotify:"):
64+
log.error("Spotify URI was provided instead of a playlist/album/track URL.")
65+
sys.exit(1)
6266
parsed_url = url.replace("https://open.spotify.com/", "")
6367
item_type = parsed_url.split("/")[0]
6468
item_id = parsed_url.split("/")[1]

0 commit comments

Comments
 (0)