Allow Spotify URL with country code (intl-xx) #127

Open
etn406 wants to merge 2 commits from etn406/main into main
etn406 commented 2024-05-26 19:35:26 -04:00 (Migrated from github.com)

Spotify URLs can have a country code in them, like this: open.spotify.com/intl-fr/album/<id> (instead of open.spotify.com/album/<id>), but Zotify doesn't handle them yet. Both URLs are working and refere to the same content despite the country code /intl-xx. I couldn't find any official documentation from Spotify about it, and I'm guessing it's added to URLs for accounts localized outside USA. I'm from France and I have it on my browser client, on every page (artists, tracks, etc). While searching about this, I found an issue (fixed) about this on the spotDL repo, and also someone from Deutshland referring to this on Reddit.

I guess it's to make content (un)available per country.

Anyway I added a small part to ignore intl-xx in the Spotify URL RegExp, to be able to just paste URLs for Zotify without manually edit them every time.


I tried out Zotify locally with my modifications and it seems to be working as expected, here for an URL with a country code:

$ zotify https://open.spotify.com/intl-fr/album/1j1yxsmJ81ZfPWOzC5AE5l

###   Downloaded "Jwles - Marches" to "Jwles/Le Zin & les Autres/01 - Jwles - Marches.ogg" in 0s (plus 0s converting)   ###

###   Downloaded "Jwles - 2001" to "Jwles/Le Zin & les Autres/02 - Jwles - 2001.ogg" in 1s (plus 0s converting)   ###

[...]

100%|██████████████▉| 12.0/12.0 [00:16<00:00, 1.36s/Song]


The URLs without country code still work properly too:

$ zotify https://open.spotify.com/track/640NtvlQqMJfFItSl9Zxbu 

Jwles - ahhhh: 100%|██████████████▉| 2.36M/2.36M [00:00<00:00, 4.63MB/s]

###   Downloaded "Jwles - ahhhh" to "Jwles/ahhhh/Jwles - ahhhh.ogg" in 0s (plus 0s converting)   ###

Spotify URLs can have a country code in them, like this: `open.spotify.com/intl-fr/album/<id>` (instead of `open.spotify.com/album/<id>`), but Zotify doesn't handle them yet. Both URLs are working and refere to the same content despite the country code `/intl-xx`. I couldn't find any official documentation from Spotify about it, and I'm guessing it's added to URLs for accounts localized outside USA. I'm from France and I have it on my browser client, on every page (artists, tracks, etc). While searching about this, I found [an issue (fixed) about this on the spotDL repo](https://github.com/spotDL/spotify-downloader/issues/1819), and also [someone from Deutshland referring to this on Reddit](https://www.reddit.com/r/rateyourmusic/comments/16jbkac/why_is_every_spotify_url_i_submit_invalid/). I guess it's to make content (un)available per country. Anyway I added a small part to ignore `intl-xx` in the Spotify URL RegExp, to be able to just paste URLs for Zotify without manually edit them every time. ------------------------- I tried out Zotify locally with my modifications and it seems to be working as expected, here for an URL with a country code: ``` $ zotify https://open.spotify.com/intl-fr/album/1j1yxsmJ81ZfPWOzC5AE5l ### Downloaded "Jwles - Marches" to "Jwles/Le Zin & les Autres/01 - Jwles - Marches.ogg" in 0s (plus 0s converting) ### ### Downloaded "Jwles - 2001" to "Jwles/Le Zin & les Autres/02 - Jwles - 2001.ogg" in 1s (plus 0s converting) ### [...] 100%|██████████████▉| 12.0/12.0 [00:16<00:00, 1.36s/Song] ``` The URLs without country code still work properly too: ``` $ zotify https://open.spotify.com/track/640NtvlQqMJfFItSl9Zxbu Jwles - ahhhh: 100%|██████████████▉| 2.36M/2.36M [00:00<00:00, 4.63MB/s] ### Downloaded "Jwles - ahhhh" to "Jwles/ahhhh/Jwles - ahhhh.ogg" in 0s (plus 0s converting) ### ```
This pull request can be merged automatically.
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin etn406/main:etn406/main
git switch etn406/main

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch main
git merge --no-ff etn406/main
git switch etn406/main
git rebase main
git switch main
git merge --ff-only etn406/main
git switch etn406/main
git rebase main
git switch main
git merge --no-ff etn406/main
git switch main
git merge --squash etn406/main
git switch main
git merge --ff-only etn406/main
git switch main
git merge etn406/main
git push origin main
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
zotify-dev/zotify!127
No description provided.