Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FileNotFoundError: [Errno 2] No such file or directory #46

Closed
ghost opened this issue Aug 9, 2019 · 2 comments
Closed

FileNotFoundError: [Errno 2] No such file or directory #46

ghost opened this issue Aug 9, 2019 · 2 comments

Comments

@ghost
Copy link

ghost commented Aug 9, 2019

Given this Album url: https://tidal.com/browse/album/17172679

When downloading

The following error is encountered:

Traceback (most recent call last):
  File "C:\dev\redsea\redsea.py", line 225, in <module>
    main()
  File "C:\dev\redsea\redsea.py", line 169, in main
    md.download_media(track, preset['quality'], media_info)
  File "C:\dev\redsea\redsea\mediadownloader.py", line 177, in download_media
    temp_file = self._dl_url(stream_data['url'], track_path)
  File "C:\dev\redsea\redsea\mediadownloader.py", line 38, in _dl_url
    with open(where, 'wb') as f:
FileNotFoundError: [Errno 2] No such file or directory: './music/deadmau5 -  Album Title Goes Here \\01 - Superliminal.flac'

I am using the changes from #43 (to support the new URLs)

I have made the following changes in the _sanitise_name method:

   def _sanitise_name(self, value):
        value = str(value)
        value = unicodedata.normalize('NFKD', value).encode('ascii', 'ignore').decode('ascii')
        value = re.sub(r'[^\w\s-]', '', value).strip()
        return re.sub(r'[-\s]+', ' ', value)

My the changes are based on the "slugify" method located in https://github.com/django/django/blob/master/django/utils/text.py

After my changes

<<< Downloading single track... >>>
=== Downloading track ID 17172680 ===
        Track: 01
        Title: Superliminal
        Artist: deadmau5
        Album: > Album Title Goes Here <
        ----
        Grabbing album info...
        Grabbing stream URL...
        Download progress: 100%
        Looks like file is encrypted. Decrypting...
        Downloading album art...
        Download progress: 101%
        Tagging media file...
=== 1/1 complete (100% done) ===

> Download queue: 1/1 items complete (100% done) <

> All downloads completed. <
redsudo added a commit that referenced this issue Sep 3, 2019
@redsudo
Copy link
Owner

redsudo commented Sep 3, 2019

Fixed in 2.2

@redsudo redsudo closed this as completed Sep 3, 2019
@firebfm
Copy link

firebfm commented Oct 14, 2019

This "fix" made it worse. Now I cannot download any track with asian filenames. My old version of redsea back in May is still working fine. Please revert the change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants