From 04eb63b4cdb1feebd5f19189370ab9e1b9c39663 Mon Sep 17 00:00:00 2001 From: kermit Date: Tue, 29 Sep 2020 19:36:26 +0100 Subject: [PATCH] Set a timeout and use session connection pool for getting file sizes --- deemix/api/deezer.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/deemix/api/deezer.py b/deemix/api/deezer.py index aa322e3..3c31047 100755 --- a/deemix/api/deezer.py +++ b/deemix/api/deezer.py @@ -81,7 +81,9 @@ class Deezer: def get_track_filesizes(self, sng_id): try: - response = requests.post("https://www.deezer.com/", headers=self.http_headers) + response = requests.post("https://www.deezer.com/", + headers=self.http_headers, + timeout=30) guest_sid = response.cookies.get('sid') site = requests.post( "https://api.deezer.com/1.0/gateway.php",