You are browsing as a guest. Sign up (or log in) to start making projects!

Open comments for this post

3h 18m 41s logged

Devlog 02
This took a while, but I was able to make the program that strips the input down to only the Spotify link. This ensures that (for the most part) that only the Spotify link gets used, and not any other whitespace/extra characters that might have appeared. It took a while because I was researching and learning how to use the ‘re’ library in Python, and it took some trial and error/debugging to get the logic to work.

How this works;

  1. The user inputs into the text field
  2. First the type of track gets identified (single track, playlist, album)
  3. Then it uses the ‘re’ library to detect the pattern of Spotify URLs and URIs. This ensures that the Spotify track is actually valid.
  4. It then uses the ‘.group()’ function to capture the matching section out of the input
  5. Finally the functions are checked to ensure everything is valid, then the type of track and song url are returned.
0
1

Comments 0

No comments yet. Be the first!