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] The system cannot find the file specified #1018

Closed
hopto-dot opened this issue Dec 6, 2020 · 12 comments
Closed

Comments

@hopto-dot
Copy link

Am I doing something wrong?
spotdl https://open.spotify.com/track/08mG3Y1vljYA6bvDt4Wqkj?si=SxezdxmlTx-CaVoucHmrUA

Fetching Song...
0%| |ETA: ?, ~min/songTraceback (most recent call last):
File "c:\users\NAME\appdata\local\programs\python\python39\lib\site-packages\spotdl\download\downloader.py", line 114, in download_song
downloadedFilePath = trackAudioStream.download(
AttributeError: 'NoneType' object has no attribute 'download'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "c:\users\NAME\appdata\local\programs\python\python39\lib\runpy.py", line 197, in _run_module_as_main
return run_code(code, main_globals, None,
File "c:\users\NAME\appdata\local\programs\python\python39\lib\runpy.py", line 87, in run_code
exec(code, run_globals)
File "C:\Users\NAME\AppData\Local\Programs\Python\Python39\Scripts\spotdl.exe_main
.py", line 7, in
File "c:\users\NAME\appdata\local\programs\python\python39\lib\site-packages\spotdl_main
.py", line 100, in console_entry_point
downloader.download_single_song(song)
File "c:\users\NAME\appdata\local\programs\python\python39\lib\site-packages\spotdl\download\downloader.py", line 274, in download_single_song
download_song(songObj, self.displayManager, self.downloadTracker)
File "c:\users\NAME\appdata\local\programs\python\python39\lib\site-packages\spotdl\download\downloader.py", line 124, in download_song
remove(join(tempFolder, convertedFileName) + '.mp4')
FileNotFoundError: [WinError 2] The system cannot find the file specified: '.\Temp\ACDC - Back In Black.mp4'
0%| |ETA: ?, ~min/song

@Silverarmor
Copy link
Member

Possible Duplicate of #1004
Try running:
pip install -U pytube then pip install -U spotdl

(Force updating pytube and spotDL)

@hopto-dot
Copy link
Author

Nope, still returns an exception:

pip install -U pytube

Requirement already satisfied: pytube in c:\users\NAME\appdata\local\programs\python\python39\lib\site-packages (10.0.0)
Requirement already satisfied: typing-extensions in c:\users\NAME\appdata\local\programs\python\python39\lib\site-packages (from pytube) (3.7.4.3)

pip install -U spotdl

Requirement already satisfied: spotdl in c:\users\NAME\appdata\local\programs\python\python39\lib\site-packages (3.1.4)
Requirement already satisfied: rapidfuzz in c:\users\NAME\appdata\local\programs\python\python39\lib\site-packages (from spotdl) (0.13.3)
Requirement already satisfied: a-pytube-fork-for-spotdl-users in c:\users\NAME\appdata\local\programs\python\python39\lib\site-packages (from spotdl) (9.6.4)
Requirement already satisfied: requests in c:\users\NAME\appdata\local\programs\python\python39\lib\site-packages (from spotdl) (2.23.0)
Requirement already satisfied: mutagen in c:\users\NAME\appdata\local\programs\python\python39\lib\site-packages (from spotdl) (1.45.1)
Requirement already satisfied: tqdm in c:\users\NAME\appdata\local\programs\python\python39\lib\site-packages (from spotdl) (4.54.0)
Requirement already satisfied: spotipy in c:\users\NAME\appdata\local\programs\python\python39\lib\site-packages (from spotdl) (2.16.1)
Requirement already satisfied: typing-extensions in c:\users\NAME\appdata\local\programs\python\python39\lib\site-packages (from a-pytube-fork-for-spotdl-users->spotdl) (3.7.4.3)
Requirement already satisfied: urllib3!=1.25.0,!=1.25.1,<1.26,>=1.21.1 in c:\users\NAME\appdata\local\programs\python\python39\lib\site-packages (from requests->spotdl) (1.25.11)
Requirement already satisfied: idna<3,>=2.5 in c:\users\NAME\appdata\local\programs\python\python39\lib\site-packages (from requests->spotdl) (2.10)
Requirement already satisfied: chardet<4,>=3.0.2 in c:\users\NAME\appdata\local\programs\python\python39\lib\site-packages (from requests->spotdl) (3.0.4)
Requirement already satisfied: certifi>=2017.4.17 in c:\users\NAME\appdata\local\programs\python\python39\lib\site-packages (from requests->spotdl) (2020.11.8)
Requirement already satisfied: six>=1.10.0 in c:\users\NAME\appdata\local\programs\python\python39\lib\site-packages (from spotipy->spotdl) (1.15.0)
Requirement already satisfied: requests in c:\users\NAME\appdata\local\programs\python\python39\lib\site-packages (from spotdl) (2.23.0)

spotdl https://open.spotify.com/playlist/1p1EhkP522y6R1xJEkYYKQ

Fetching Playlist...
67%|███████████████████████████████████████████████████████████▎ |ETA: 04:27, 1.12min/songmultiprocessing.pool.RemoteTraceback:
"""
Traceback (most recent call last):
File "c:\users\NAME\appdata\local\programs\python\python39\lib\site-packages\spotdl\download\downloader.py", line 114, in download_song
downloadedFilePath = trackAudioStream.download(
AttributeError: 'NoneType' object has no attribute 'download'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "c:\users\NAME\appdata\local\programs\python\python39\lib\multiprocessing\pool.py", line 125, in worker
result = (True, func(*args, **kwds))
File "c:\users\NAME\appdata\local\programs\python\python39\lib\multiprocessing\pool.py", line 51, in starmapstar
return list(itertools.starmap(args[0], args[1]))
File "c:\users\NAME\appdata\local\programs\python\python39\lib\site-packages\spotdl\download\downloader.py", line 124, in download_song
remove(join(tempFolder, convertedFileName) + '.mp4')
FileNotFoundError: [WinError 2] The system cannot find the file specified: '.\Temp\グッナイ小形 - I LOVE YOU MORE.mp4'"""

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "c:\users\NAME\appdata\local\programs\python\python39\lib\runpy.py", line 197, in _run_module_as_main
return run_code(code, main_globals, None,
File "c:\users\NAME\appdata\local\programs\python\python39\lib\runpy.py", line 87, in run_code
exec(code, run_globals)
File "C:\Users\NAME\AppData\Local\Programs\Python\Python39\Scripts\spotdl.exe_main
.py", line 7, in
File "c:\users\NAME\appdata\local\programs\python\python39\lib\site-packages\spotdl_main
.py", line 116, in console_entry_point
downloader.download_multiple_songs(songObjList)
File "c:\users\NAME\appdata\local\programs\python\python39\lib\site-packages\spotdl\download\downloader.py", line 293, in download_multiple_songs
self.workerPool.starmap(
File "c:\users\NAME\appdata\local\programs\python\python39\lib\multiprocessing\pool.py", line 372, in starmap
return self._map_async(func, iterable, starmapstar, chunksize).get()
File "c:\users\NAME\appdata\local\programs\python\python39\lib\multiprocessing\pool.py", line 771, in get
raise self._value
FileNotFoundError: [Errno 2] The system cannot find the file specified: '.\Temp\グッナイ小形 - I LOVE YOU MORE.mp4'

@madebypixel02
Copy link

I have this exact issue in arch linux

@Silverarmor
Copy link
Member

@hopto-dot The error in the second message you sent has changed from the first. I now see the words multiprocessing, whereas the original error was a pytube issue.

@madebypixel02 "exact issue" being the first or second? If it's the first issue, see fix #1018 (comment)

@madebypixel02
Copy link

madebypixel02 commented Dec 7, 2020

Exact meaning like the second issue: (EDIT: checking the original error and mine they seem similar yet not "exactly" the same)

Fetching Song...                                                                                                                                                                                                   
  0%|                                                                                                                                                                                            |ETA: ?, ~min/songTraceback (most recent call last):
  File "/usr/lib/python3.9/site-packages/spotdl/download/downloader.py", line 114, in download_song
    downloadedFilePath = trackAudioStream.download(
AttributeError: 'NoneType' object has no attribute 'download'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/bin/spotdl", line 8, in <module>
    sys.exit(console_entry_point())
  File "/usr/lib/python3.9/site-packages/spotdl/__main__.py", line 100, in console_entry_point
    downloader.download_single_song(song)
  File "/usr/lib/python3.9/site-packages/spotdl/download/downloader.py", line 274, in download_single_song
    download_song(songObj, self.displayManager, self.downloadTracker)
  File "/usr/lib/python3.9/site-packages/spotdl/download/downloader.py", line 124, in download_song
    remove(join(tempFolder, convertedFileName) + '.mp4')
FileNotFoundError: [Errno 2] No such file or directory: './Temp/Michelle - Kling, Glöckchen, klingelingeling.mp4'

Hope this helps!

@kennethmanuel
Copy link

Similar error for me

Fetching Playlist...
6%|████████▌ |ETA: 09:15, 0.62min/songmultiprocessing.pool.RemoteTraceback:
"""
Traceback (most recent call last):
File "c:\users\kenne\appdata\local\programs\python\python39\lib\site-packages\spotdl\download\downloader.py", line 114, in download_song
downloadedFilePath = trackAudioStream.download(
AttributeError: 'NoneType' object has no attribute 'download'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "c:\users\kenne\appdata\local\programs\python\python39\lib\multiprocessing\pool.py", line 125, in worker
result = (True, func(*args, **kwds))
File "c:\users\kenne\appdata\local\programs\python\python39\lib\multiprocessing\pool.py", line 51, in starmapstar
return list(itertools.starmap(args[0], args[1]))
File "c:\users\kenne\appdata\local\programs\python\python39\lib\site-packages\spotdl\download\downloader.py", line 124, in download_song
remove(join(tempFolder, convertedFileName) + '.mp4')
FileNotFoundError: [WinError 2] The system cannot find the file specified: '.\Temp\Duckwrth, Shaboozey - Start a Riot.mp4'
"""

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "c:\users\kenne\appdata\local\programs\python\python39\lib\runpy.py", line 197, in _run_module_as_main
return run_code(code, main_globals, None,
File "c:\users\kenne\appdata\local\programs\python\python39\lib\runpy.py", line 87, in run_code
exec(code, run_globals)
File "C:\Users\kenne\AppData\Local\Programs\Python\Python39\Scripts\spotdl.exe_main
.py", line 7, in
File "c:\users\kenne\appdata\local\programs\python\python39\lib\site-packages\spotdl_main
.py", line 116, in console_entry_point
downloader.download_multiple_songs(songObjList)
File "c:\users\kenne\appdata\local\programs\python\python39\lib\site-packages\spotdl\download\downloader.py", line 293, in download_multiple_songs
self.workerPool.starmap(
File "c:\users\kenne\appdata\local\programs\python\python39\lib\multiprocessing\pool.py", line 372, in starmap
return self._map_async(func, iterable, starmapstar, chunksize).get()
File "c:\users\kenne\appdata\local\programs\python\python39\lib\multiprocessing\pool.py", line 771, in get
raise self._value
FileNotFoundError: [Errno 2] The system cannot find the file specified: '.\Temp\Duckwrth, Shaboozey - Start a Riot.mp4'

@dheerain
Copy link
Contributor

dheerain commented Dec 8, 2020

Exact meaning like the second issue: (EDIT: checking the original error and mine they seem similar yet not "exactly" the same)

Fetching Song...                                                                                                                                                                                                   
  0%|                                                                                                                                                                                            |ETA: ?, ~min/songTraceback (most recent call last):
  File "/usr/lib/python3.9/site-packages/spotdl/download/downloader.py", line 114, in download_song
    downloadedFilePath = trackAudioStream.download(
AttributeError: 'NoneType' object has no attribute 'download'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/bin/spotdl", line 8, in <module>
    sys.exit(console_entry_point())
  File "/usr/lib/python3.9/site-packages/spotdl/__main__.py", line 100, in console_entry_point
    downloader.download_single_song(song)
  File "/usr/lib/python3.9/site-packages/spotdl/download/downloader.py", line 274, in download_single_song
    download_song(songObj, self.displayManager, self.downloadTracker)
  File "/usr/lib/python3.9/site-packages/spotdl/download/downloader.py", line 124, in download_song
    remove(join(tempFolder, convertedFileName) + '.mp4')
FileNotFoundError: [Errno 2] No such file or directory: './Temp/Michelle - Kling, Glöckchen, klingelingeling.mp4'

Hope this helps!

I was also facing the same issue . Upon investigation I found out that out of the full playlist there are only a few songs that got downloaded. and rest failed . The issue seems to be with the Copyright items. Few links can not be downloaded directly. Updated the code to get first 10 best match links from youtube and start parsing till one runs, Upon doing this the success rate increased to around 90%.

@ghost
Copy link

ghost commented Dec 8, 2020

Ok. How do you get the first 10 best matches?

@dheerain
Copy link
Contributor

dheerain commented Dec 8, 2020

Ok. How do you get the first 10 best matches?

Forked the repository and pushed the fix in the below commit.
https://github.com/dheerain/spotify-downloader/commit/1285b946571dd097a46cca3ba1e01bd0f8a1dfb7

@madebypixel02
Copy link

Exact meaning like the second issue: (EDIT: checking the original error and mine they seem similar yet not "exactly" the same)

Fetching Song...                                                                                                                                                                                                   
  0%|                                                                                                                                                                                            |ETA: ?, ~min/songTraceback (most recent call last):
  File "/usr/lib/python3.9/site-packages/spotdl/download/downloader.py", line 114, in download_song
    downloadedFilePath = trackAudioStream.download(
AttributeError: 'NoneType' object has no attribute 'download'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/bin/spotdl", line 8, in <module>
    sys.exit(console_entry_point())
  File "/usr/lib/python3.9/site-packages/spotdl/__main__.py", line 100, in console_entry_point
    downloader.download_single_song(song)
  File "/usr/lib/python3.9/site-packages/spotdl/download/downloader.py", line 274, in download_single_song
    download_song(songObj, self.displayManager, self.downloadTracker)
  File "/usr/lib/python3.9/site-packages/spotdl/download/downloader.py", line 124, in download_song
    remove(join(tempFolder, convertedFileName) + '.mp4')
FileNotFoundError: [Errno 2] No such file or directory: './Temp/Michelle - Kling, Glöckchen, klingelingeling.mp4'

Hope this helps!

I was also facing the same issue . Upon investigation I found out that out of the full playlist there are only a few songs that got downloaded. and rest failed . The issue seems to be with the Copyright items. Few links can not be downloaded directly. Updated the code to get first 10 best match links from youtube and start parsing till one runs, Upon doing this the success rate increased to around 90%.

Glad to see it's not just me that is facing the issue, and am very happy to see you found a solution that'll make it more reliable.

@ghost
Copy link

ghost commented Dec 9, 2020

Ok. How do you get the first 10 best matches?

Forked the repository and pushed the fix in the below commit.
https://github.com/dheerain/spotify-downloader/commit/1285b946571dd097a46cca3ba1e01bd0f8a1dfb7

Nice idea. Well add it to the next release.

@dheerain
Copy link
Contributor

dheerain commented Dec 9, 2020

Upon Upgrading pytube to 10.0.1 changes which was pushed yesterday I was able to download full playlist without any issue.

@Silverarmor Silverarmor changed the title Download error FileNotFoundError: [Errno 2] The system cannot find the file specified Dec 16, 2020
Silverarmor added a commit that referenced this issue Dec 23, 2020
Revert "Fix For #1018. Download error coz of Copyright issue"
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

5 participants