mirror of
https://github.com/oskvr37/tiddl.git
synced 2026-06-13 12:15:13 +03:00
💡 add comments and text
This commit is contained in:
+2
-2
@@ -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"],
|
||||
|
||||
@@ -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
@@ -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 ✨
|
||||
|
||||
Reference in New Issue
Block a user