fix duplicate detection
This commit is contained in:
parent
00dbec6be1
commit
0d6de77db1
1 changed files with 6 additions and 6 deletions
|
@ -85,13 +85,7 @@ def download_track(
|
||||||
dl_path = f"{DL_PATH}/{track.track_num}{track_name}.part" # type: ignore[reportOptionalMemberAccess]
|
dl_path = f"{DL_PATH}/{track.track_num}{track_name}.part" # type: ignore[reportOptionalMemberAccess]
|
||||||
dest_path = f"{DEST_PATH}/{artist_name}/{album_name}/{track.track_num} {track_name}" # type: ignore[reportOptionalMemberAccess]
|
dest_path = f"{DEST_PATH}/{artist_name}/{album_name}/{track.track_num} {track_name}" # type: ignore[reportOptionalMemberAccess]
|
||||||
|
|
||||||
if os.path.exists(dest_path) and SKIP_DOWNLOADED:
|
|
||||||
print(dest_path + " exists!")
|
|
||||||
print("Skipping downloaded song")
|
|
||||||
return False, "Skipping downloaded song"
|
|
||||||
|
|
||||||
stream = track.stream()
|
stream = track.stream()
|
||||||
|
|
||||||
stream.manifest = json.loads(base64.b64decode(stream.manifest))
|
stream.manifest = json.loads(base64.b64decode(stream.manifest))
|
||||||
url = stream.manifest["urls"][0]
|
url = stream.manifest["urls"][0]
|
||||||
if '.flac' in url:
|
if '.flac' in url:
|
||||||
|
@ -101,6 +95,12 @@ def download_track(
|
||||||
dest_path += '.mp4'
|
dest_path += '.mp4'
|
||||||
else:
|
else:
|
||||||
dest_path += '.m4a'
|
dest_path += '.m4a'
|
||||||
|
|
||||||
|
if os.path.exists(dest_path) and SKIP_DOWNLOADED:
|
||||||
|
print(dest_path + " exists!")
|
||||||
|
print("Skipping downloaded song")
|
||||||
|
return False, "Skipping downloaded song"
|
||||||
|
|
||||||
try:
|
try:
|
||||||
key = stream.manifest["keyId"]
|
key = stream.manifest["keyId"]
|
||||||
except KeyError:
|
except KeyError:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue