[GH-ISSUE #192] simple way to download mp3 from spotify preview URL? #94

Closed
opened 2026-02-27 23:20:48 +03:00 by kerem · 4 comments
Owner

Originally created by @gmaijoe on GitHub (May 16, 2017).
Original GitHub issue: https://github.com/spotipy-dev/spotipy/issues/192

Hi all, I have the previewURL currently and I want a simple way to download the mp3 from the url.

Anyone have a good idea? thanks in advance

Originally created by @gmaijoe on GitHub (May 16, 2017). Original GitHub issue: https://github.com/spotipy-dev/spotipy/issues/192 Hi all, I have the previewURL currently and I want a simple way to download the mp3 from the url. Anyone have a good idea? thanks in advance
kerem closed this issue 2026-02-27 23:20:48 +03:00
Author
Owner

@ritiek commented on GitHub (Feb 12, 2018):

One could just use any of the available HTTP libraries to download stuff.
https://stackoverflow.com/questions/16694907/how-to-download-large-file-in-python-with-requests-py

<!-- gh-comment-id:364953810 --> @ritiek commented on GitHub (Feb 12, 2018): One could just use any of the available HTTP libraries to download stuff. https://stackoverflow.com/questions/16694907/how-to-download-large-file-in-python-with-requests-py
Author
Owner

@stephanebruckert commented on GitHub (Jan 11, 2020):

@ritiek's answer is useful but closing as unrelated to spotipy.

<!-- gh-comment-id:573346312 --> @stephanebruckert commented on GitHub (Jan 11, 2020): @ritiek's answer is useful but closing as unrelated to spotipy.
Author
Owner

@prakashclt commented on GitHub (Sep 27, 2021):

Use the wget module in python.
It is easy to use.

import wget
file = wget.download(url)

<!-- gh-comment-id:927511711 --> @prakashclt commented on GitHub (Sep 27, 2021): Use the wget module in python. It is easy to use. import wget file = wget.download(url)
Author
Owner

@Rsalganik1123 commented on GitHub (Sep 14, 2023):

hi! for posterity, tried the ones above and they didn't really work for me. So, I found an easier way.

Just use :

import urllib.request
example_url = 'https://p.scdn.co/mp3preview/c1d518645f20aecb3c6d2b5b93af4a96af57c35fcid=157d02760f23471aa57b6a700a78c863'
urllib.request.urlretrieve(example_url, 'test.mp3')

that will create a file called test.mp3 with the audio contained in that url

<!-- gh-comment-id:1719065355 --> @Rsalganik1123 commented on GitHub (Sep 14, 2023): hi! for posterity, tried the ones above and they didn't really work for me. So, I found an easier way. Just use : ``` import urllib.request example_url = 'https://p.scdn.co/mp3preview/c1d518645f20aecb3c6d2b5b93af4a96af57c35fcid=157d02760f23471aa57b6a700a78c863' urllib.request.urlretrieve(example_url, 'test.mp3') ``` that will create a file called test.mp3 with the audio contained in that url
Sign in to join this conversation.
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
starred/spotipy#94
No description provided.