From e05d9e444beb6a6e5095aa315b5dcc40c02c8d12 Mon Sep 17 00:00:00 2001 From: marco-sorich Date: Fri, 5 Jul 2024 08:26:31 +0200 Subject: [PATCH] Invaild cross-device link issue resolved (#376) * Update of .gitignore * os.rename exchanged against commands which are safe for cross devide links --------- Co-authored-by: Sathyajith Bhat --- .gitignore | 1 + spotify_dl/youtube.py | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 8f1759ae..b6b59a5e 100644 --- a/.gitignore +++ b/.gitignore @@ -17,6 +17,7 @@ unins .coverage .vscode/** .venv/* +.cache # macOS temporary files .DS_Store diff --git a/spotify_dl/youtube.py b/spotify_dl/youtube.py index de37389c..481bb44e 100644 --- a/spotify_dl/youtube.py +++ b/spotify_dl/youtube.py @@ -1,6 +1,7 @@ import urllib.request from os import path import os +import shutil import multiprocessing import json @@ -334,7 +335,8 @@ def download_songs(**kwargs): log.debug("Downloading to %s", url["save_path"]) reference_file = DOWNLOAD_LIST track_db = write_tracks(reference_file, kwargs["songs"]) - os.rename(reference_file, kwargs["output_dir"] + "/" + reference_file) + shutil.copy(reference_file, kwargs["output_dir"] + "/" + reference_file) + os.remove(reference_file) reference_file = str(kwargs["output_dir"]) + "/" + reference_file kwargs["reference_file"] = reference_file kwargs["track_db"] = track_db