mirror of
https://github.com/nathom/streamrip.git
synced 2025-05-23 03:27:14 -04:00
Fix FileNotFoundError with Music.app auto folder
This commit is contained in:
parent
0dbbba8f67
commit
8d11a8402f
1 changed files with 9 additions and 2 deletions
|
@ -343,8 +343,15 @@ class Track(Media):
|
|||
:type path: str
|
||||
"""
|
||||
os.makedirs(os.path.dirname(path), exist_ok=True)
|
||||
shutil.copy(self.path, path)
|
||||
os.remove(self.path)
|
||||
|
||||
try:
|
||||
shutil.move(self.path, path)
|
||||
except FileNotFoundError as e:
|
||||
# This sometimes happens when using Music.app's Auto folder
|
||||
logger.debug("%s during shutil.move", e)
|
||||
os.makedirs(os.path.dirname(path), exist_ok=True)
|
||||
shutil.move(self.path, path)
|
||||
|
||||
self.path = path
|
||||
|
||||
def _soundcloud_download(self, dl_info: dict):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue