Skip to content

Commit

Permalink
fix: [dl-downer] try fix 'OSError: [Errno 18] Invalid cross-device li…
Browse files Browse the repository at this point in the history
…nk' on linux
  • Loading branch information
BelgianNoise committed May 5, 2024
1 parent 74bf60d commit 039091a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions dl-downer/src/downloaders/GOPLAY.py
Original file line number Diff line number Diff line change
Expand Up @@ -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}')

0 comments on commit 039091a

Please sign in to comment.