mirror of
https://github.com/oskvr37/tiddl.git
synced 2026-06-13 12:15:13 +03:00
♻️ refactor downloadTrack
This commit is contained in:
+3
-3
@@ -55,10 +55,10 @@ def main():
|
||||
playlists = api.getPlaylists()
|
||||
print(f"You have got {playlists['totalNumberOfItems']} playlists.")
|
||||
|
||||
track_id = int(input("Enter track id to download: "))
|
||||
track_id = input("Enter track id to download: ")
|
||||
|
||||
track = api.getTrack(track_id, config["settings"]["track_quality"])
|
||||
track_path = downloadTrack(track_id, track["manifest"], config["settings"]["download_path"])
|
||||
track = api.getTrack(int(track_id), config["settings"]["track_quality"])
|
||||
track_path = downloadTrack(config["settings"]["download_path"], track_id, track["manifest"])
|
||||
print(f"✨ Track saved in {track_path}")
|
||||
|
||||
|
||||
|
||||
+1
-1
@@ -26,7 +26,7 @@ DEFAULT_CONFIG: ConfigData = {
|
||||
"token": "",
|
||||
"refresh_token": "",
|
||||
"token_expires_at": 0,
|
||||
"settings": {"download_path": "tiddl", "track_quality": "HIGH"},
|
||||
"settings": {"download_path": "tidal_download", "track_quality": "HIGH"},
|
||||
"user": {"user_id": "", "country_code": ""},
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -61,7 +61,7 @@ def threadDownload(urls: list[str]) -> bytes:
|
||||
return data
|
||||
|
||||
|
||||
def downloadTrack(file_name: int, manifest: str, path: str):
|
||||
def downloadTrack(path: str, file_name: str, manifest: str):
|
||||
decoded_manifest = decodeManifest(manifest)
|
||||
track_urls, codecs = parseTrackManifest(decoded_manifest)
|
||||
track_data = threadDownload(track_urls)
|
||||
|
||||
Reference in New Issue
Block a user