Downloading fix

This commit is contained in:
7x11x13
2024-06-21 08:54:01 -04:00
parent 5cff160168
commit fad6bdf557
3 changed files with 5 additions and 5 deletions

View File

@@ -1,3 +1,3 @@
# -*- encoding: utf-8 -*-
"""Python Soundcloud Music Downloader."""
__version__ = "v2.8.1"
__version__ = "v2.8.2"

View File

@@ -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)

View File

@@ -28,7 +28,7 @@ setup(
"requests",
"clint",
"pathvalidate",
"soundcloud-v2>=1.3.7",
"soundcloud-v2>=1.3.10",
"filelock>=3.0.0",
],
url="https://github.com/flyingrub/scdl",