HTTPSConnectionPool SSLError

26 views
Skip to first unread message

davi...@gmail.com

unread,
Feb 5, 2024, 10:39:08 AMFeb 5
to Freesound API
Hello everybody!
I am developing a simple python application that leverages the Freesound API to download audio files based on a simple "search" request.
The script does the following:
Upon receiving the sound list Response, I loop through the list to get the infos of each file.
The function delegated to request the info is the following:

def get_track_info(track_id:str,params:dict[str,str], token:str) -> Response:
     headers: dict[str, str] = {"Authorization": f"Bearer {token}"}
     url:str = f"https://freesound.org/apiv2/sounds/{track_id}/"
     file_type_response: Response = make_get_request(url, header=headers, params=params)
     return file_type_response

track_id is the id of the track
token is the user access token
params is the list of sound file's parameters that I want to retrieve from the database.

a possible request is hence:

The script has been working until 2 days ago, when the loop could not finish because of the following error:
HTTPSConnectionPool(host='freesound.org', port=443): Max retries exceeded with url: /apiv2/sounds/630246/?fields=type%2Cchannels%2Cbitdepth%2Csamplerate%2Cdownload (Caused by SSLError(SSLEOFError(8, '[SSL: UNEXPECTED_EOF_WHILE_READING] EOF occurred in violation of protocol (_ssl.c:1006)')))


I have been trying with different queries, but I don't understand whether the problem comes from a new implementation of the urllib3 library, from the server or from my program. Accessing this link from Firefox does not return any error.

Am I simply making too many requests?
I look forward to hearing your opinion
Have a nice day

ddgg


Frederic Font Corbera

unread,
Feb 6, 2024, 8:07:22 AMFeb 6
to freeso...@googlegroups.com
Hi ddgg,

I don't think the problem is with too many requests as this would trigger a 429 HTTP response. Looks like HTTPS related but our certificate is fine and similar queries form other clients seem to work fine so it should be something on your end. Also as a suggestion, you can use the "fields" parameter for the search request so then you don't need to iterate sounds one by one to "get track info".

I hope this helps,

Cheers,

frederic 

--
Frederic Font - ffont.github.io
Music Technology Group, UPF - mtg.upf.edu
Freesound - freesound.org



--

---
You received this message because you are subscribed to the Google Groups "Freesound API" group.
To unsubscribe from this group and stop receiving emails from it, send an email to freesound-ap...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/freesound-api/ea1194e0-a56f-410a-9ce5-326cd80f3714n%40googlegroups.com.

Davide Gagliardi

unread,
Feb 6, 2024, 9:05:56 AMFeb 6
to freeso...@googlegroups.com
Dear Frederic,

Thank you! Good to know that there could be a 429 Response. I missed that.
I was in fact having some problem connecting to freesound.org anyway (even from a Browser). From this morning on everything works great!

I’ll take a look at the fields parameter to simplify my application.
Thank you!
Best

Ddgg

///////////////////////////////////////////////////////////////////////////

Davide Gagliardi
Composer // Performer // Sound Director
Professor of Multimedia
Conservatorio G. Verdi Milano
+43 676 58 08 410

You received this message because you are subscribed to a topic in the Google Groups "Freesound API" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/freesound-api/DpZ0CH1XT-4/unsubscribe.
To unsubscribe from this group and all its topics, send an email to freesound-ap...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/freesound-api/CABDPa_ybVfVTDwx6dW50pmWAoCMH%2BcyXrnihwHiCRc85bVd25Q%40mail.gmail.com.

Reply all
Reply to author
Forward
0 new messages