Fixed AUTH_REQUIRED issue when downloading multiple tracks

This commit is contained in:
RemixDev 2020-11-19 16:53:25 +01:00
parent f53c991622
commit 8840855a96
No known key found for this signature in database
GPG key ID: B33962B465BDB51C
3 changed files with 6 additions and 5 deletions

View file

@ -1,3 +1,3 @@
#!/usr/bin/env python3
__version__ = "1.5.20"
__version__ = "1.5.21"

View file

@ -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",

View file

@ -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",