💡 add comments and text

This commit is contained in:
oskvr37
2024-07-27 18:04:52 +02:00
parent 9bdbad75cd
commit 570def79dc
3 changed files with 14 additions and 3 deletions
+2 -2
View File
@@ -58,7 +58,7 @@ def main():
# qualities below master dont have `bitDepth` and `sampleRate`
# TODO: add special types for master quality 🏷️
MASTER_QUALITIES: list[TrackQuality] = ["HI_RES_LOSSLESS", "LOSSLESS"]
if track["audioQuality"] in MASTER_QUALITIES:
print(
@@ -69,7 +69,7 @@ def main():
)
)
else:
print(f"▶️ {TRACK_QUALITY[track['audioQuality']]['name']}")
print(f"▶️ {TRACK_QUALITY[track['audioQuality']]['name']} quality")
track_path = downloadTrack(
config["settings"]["download_path"],
+2
View File
@@ -3,6 +3,8 @@ from .types import SessionResponse, PlaylistResponse, TrackResponse, TrackQualit
API_URL = "https://api.tidal.com/v1"
# TODO: endpoints error handling ✨
class TidalApi:
def __init__(self, token: str, user_id: str, country_code: str) -> None:
+10 -1
View File
@@ -71,7 +71,7 @@ def threadDownload(urls: list[str]) -> bytes:
for index, url in enumerate(urls):
req = requests.get(url)
data += req.content
print(f"{round(index / len(urls) * 100)}%")
print(f"{round((index + 1) / len(urls) * 100)}%")
return data
@@ -92,6 +92,15 @@ def downloadTrack(
track_data = threadDownload(track_urls)
print("codecs:", codecs)
"""
known codecs
flac (master)
mp4a.40.2 (high)
mp4a.40.5 (low)
"""
makedirs(path, exist_ok=True)
# TODO: use proper file extension ✨