From 8840855a966f1cdcdc8571b18e2dc2f8bd38e44e Mon Sep 17 00:00:00 2001 From: RemixDev Date: Thu, 19 Nov 2020 16:53:25 +0100 Subject: [PATCH] Fixed AUTH_REQUIRED issue when downloading multiple tracks --- deemix/__init__.py | 2 +- deemix/api/deezer.py | 7 ++++--- setup.py | 2 +- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/deemix/__init__.py b/deemix/__init__.py index 92b60c9..da1accd 100644 --- a/deemix/__init__.py +++ b/deemix/__init__.py @@ -1,3 +1,3 @@ #!/usr/bin/env python3 -__version__ = "1.5.20" +__version__ = "1.5.21" diff --git a/deemix/api/deezer.py b/deemix/api/deezer.py index 9c8731f..693a763 100755 --- a/deemix/api/deezer.py +++ b/deemix/api/deezer.py @@ -75,6 +75,7 @@ class Deezer: self.checksums = None self.session = requests.Session() + self.mobile_session = requests.Session() self.logged_in = False self.session.mount('http://', requests.adapters.HTTPAdapter(pool_maxsize=100)) @@ -92,11 +93,11 @@ class Deezer: def get_track_filesizes(self, sng_id): try: - response = requests.post("https://www.deezer.com/", + response = self.mobile_session.post("https://www.deezer.com/", headers=self.http_headers, timeout=30) - guest_sid = response.cookies.get('sid') - site = requests.post( + guest_sid = self.mobile_session.cookies.get('sid') + site = self.mobile_session.post( "https://api.deezer.com/1.0/gateway.php", params={ 'api_key': "4VCYIJUCDLOUELGD1V8WBVYBNVDYOXEWSLLZDONGBBDFVXTZJRXPR29JRLQFO6ZE", diff --git a/setup.py b/setup.py index 0bebf64..3ad2523 100644 --- a/setup.py +++ b/setup.py @@ -7,7 +7,7 @@ README = (HERE / "README.md").read_text() setup( name="deemix", - version="1.5.20", + version="1.5.21", description="A barebone deezer downloader library", long_description=README, long_description_content_type="text/markdown",