mirror of
https://github.com/spotipy-dev/spotipy.git
synced 2026-04-27 00:25:54 +03:00
[GH-ISSUE #947] Question about Regex check for URI/URL #568
Labels
No labels
api-bug
bug
dependencies
documentation
duplicate
enhancement
external-ide
headless-mode
implicit-grant-flow
invalid
missing-endpoint
pr-welcome
private-api
pull-request
question
spotipy3
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/spotipy#568
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @Musikfreitag on GitHub (Mar 8, 2023).
Original GitHub issue: https://github.com/spotipy-dev/spotipy/issues/947
I'm using URIs of playlists to retrieve song ids from a set of playlists.
Example: spotify:user:ultramusicofficial:playlist:1uQ4QCJhdIZodiLvE6dXKN
There was a change to include a regex check on these URIs:
github.com/spotipy-dev/spotipy@b1db0b63d9 (comments)After this change, my script was no longer working and returned the following error:
\spotipy\client.py", line 1988, in _get_id raise SpotifyException(400, -1, "Unsupported URL / URI.") spotipy.exceptions.SpotifyException: http status: 400, code:-1 - Unsupported URL / URI., reason: NoneWhy does this happen? Is this error really expected?
The URI seems valid to me and worked in the version before this change was introduced.
@stephanebruckert commented on GitHub (Mar 11, 2023):
Didn't know
spotify:user:ultramusicofficial:playlist:1uQ4QCJhdIZodiLvE6dXKNwas a valid URI. Indeed it needs to be fixed.@HighnessAtharva commented on GitHub (Apr 8, 2023):
Please close this issue. PR is already merged.
@deadlocker8 commented on GitHub (Oct 3, 2023):
I still encounter this problem even with the latest version 2.23.
The file
read_a_playlist.pyfrom the examples folder can be used to reproduce the error: https://github.com/spotipy-dev/spotipy/blob/master/examples/read_a_playlist.pyThe fix introduced by https://github.com/spotipy-dev/spotipy/pull/949 actually causes the
_regex_spotify_uriregex to result in a match, but the result then seems to be discarded in the next if-clause, since there is not match for the regex-grouptype.In addition, my Spotify username contains a hyphen (
-). At the moment the regex does not allow this.I did not found any official documentation to check if other characters are allowed besides A-Z, a-z and 0-9. I can only tell for the hyphen in my username.