From 039091a90c45c571d2933492b49ce36b8823b75a Mon Sep 17 00:00:00 2001 From: Arthur Joppart Date: Sun, 5 May 2024 21:52:51 +0200 Subject: [PATCH] fix: [dl-downer] try fix 'OSError: [Errno 18] Invalid cross-device link' on linux --- dl-downer/src/downloaders/GOPLAY.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/dl-downer/src/downloaders/GOPLAY.py b/dl-downer/src/downloaders/GOPLAY.py index ba02918..e506223 100644 --- a/dl-downer/src/downloaders/GOPLAY.py +++ b/dl-downer/src/downloaders/GOPLAY.py @@ -171,6 +171,8 @@ def GOPLAY_DL(dl_request: DLRequest): final_file = mpd.download('./tmp', download_options) # move the final file to the downloads folder final_file_move_to = dl_request.get_full_filename_path(title) - os.makedirs(os.path.dirname(final_file_move_to), exist_ok=True) - os.rename(final_file, final_file_move_to) + # We can't use shutil.move or os.rename because the destination + # might be on a different filesystem depending on the configuration + shutil.copy(final_file, final_file_move_to) + os.remove(final_file) logger.debug(f'Downloaded {title} to {final_file_move_to}')