Skip to content

Commit

Permalink
Downloading fix
Browse files Browse the repository at this point in the history
  • Loading branch information
7x11x13 committed Jun 21, 2024
1 parent 5cff160 commit fad6bdf
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion scdl/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# -*- encoding: utf-8 -*-
"""Python Soundcloud Music Downloader."""
__version__ = "v2.8.1"
__version__ = "v2.8.2"
6 changes: 3 additions & 3 deletions scdl/scdl.py
Original file line number Diff line number Diff line change
Expand Up @@ -671,15 +671,15 @@ def get_transcoding_m3u8(client: SoundCloud, transcoding: Transcoding, **kwargs)
url = transcoding.url
bitrate_KBps = 256 / 8 if "aac" in transcoding.preset else 128 / 8
total_bytes = bitrate_KBps * transcoding.duration

min_size = kwargs.get("min_size") or 0
max_size = kwargs.get("max_size") or math.inf # max size of 0 treated as no max size

if not min_size <= total_bytes <= max_size:
raise SoundCloudException("File not within --min-size and --max-size bounds")

if url is not None:
headers = client.get_default_headers()
headers = client._get_default_headers()
if client.auth_token:
headers["Authorization"] = f"OAuth {client.auth_token}"
r = requests.get(url, params={"client_id": client.client_id}, headers=headers)
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"requests",
"clint",
"pathvalidate",
"soundcloud-v2>=1.3.7",
"soundcloud-v2>=1.3.10",
"filelock>=3.0.0",
],
url="https://github.com/flyingrub/scdl",
Expand Down

0 comments on commit fad6bdf

Please sign in to comment.