[GH-ISSUE #449] [help] Don't know how to use proxy #264

Closed
opened 2026-02-27 23:21:41 +03:00 by kerem · 2 comments
Owner

Originally created by @matze19999 on GitHub (Mar 7, 2020).
Original GitHub issue: https://github.com/spotipy-dev/spotipy/issues/449

Hey guys,

I read the documentation, but I haven't found a tutorial on how to use a proxy... Can someone please help me or write some short lines on how to get spotipy to use a proxy?

Thank you!!

Originally created by @matze19999 on GitHub (Mar 7, 2020). Original GitHub issue: https://github.com/spotipy-dev/spotipy/issues/449 Hey guys, I read the documentation, but I haven't found a tutorial on how to use a proxy... Can someone please help me or write some short lines on how to get spotipy to use a proxy? Thank you!!
kerem 2026-02-27 23:21:41 +03:00
Author
Owner

@stephanebruckert commented on GitHub (Mar 7, 2020):

Hey,

proxies that you pass to spotipy will be passed directly to request.Session(), see here:

github.com/plamere/spotipy@13109c1613/spotipy/client.py (L150)

See if structuring your proxies as showed in the following references helps:

It is likely going to look like:

proxies = {
    “http”: “http://10.10.10.10:8000”,
    “https”: “http://10.10.10.10:8000”
}
spotipy.Spotify(auth_manager=spotipy.SpotifyOAuth(),
                proxies=proxies)

Please let us know how it goes and we can then improve the docs

<!-- gh-comment-id:596077896 --> @stephanebruckert commented on GitHub (Mar 7, 2020): Hey, `proxies` that you pass to spotipy will be passed directly to `request.Session()`, see here: https://github.com/plamere/spotipy/blob/13109c1613594e098f5ecddc64edbf465306052b/spotipy/client.py#L150 See if structuring your `proxies` as showed in the following references helps: - https://2.python-requests.org/en/master/user/advanced/#id1 - https://stackoverflow.com/questions/30837839/how-can-i-set-a-single-proxy-for-a-requests-session-object - https://blog.scrapinghub.com/python-requests-proxy It is likely going to look like: proxies = { “http”: “http://10.10.10.10:8000”, “https”: “http://10.10.10.10:8000” } spotipy.Spotify(auth_manager=spotipy.SpotifyOAuth(), proxies=proxies) Please let us know how it goes and we can then improve the docs
Author
Owner

@matze19999 commented on GitHub (Mar 7, 2020):

Thanks, this worked like a charm!

Maybe you can add this code example to the folder examples on GitHub or add a code snipped on the readthedocs page :)

<!-- gh-comment-id:596099681 --> @matze19999 commented on GitHub (Mar 7, 2020): Thanks, this worked like a charm! Maybe you can add this code example to the folder examples on GitHub or add a code snipped on the readthedocs page :)
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#264
No description provided.