couldbejake / spotify2mp3

Simple free and unlimited Spotify playlist downloads. Spotify2mp3 - Spotify Downloader
MIT License
269 stars 42 forks source link

UnboundLocalError: local variable 'failed_song_names' referenced before assignment & Could not find playlist name please provide a name #30

Closed DurgeshKavate003 closed 1 year ago

DurgeshKavate003 commented 1 year ago

Full Error As Follows

Enter the spotify URL link: https://open.spotify.com/playlist/649OfpVgIVrppB0zRV7kAJ?si=d0437a0d0962449d

Could not find playlist name please provide a name

Please open https://www.google.com/device and input code RPKM-CVMR Press enter when you have completed this step. HTTP Error 428: Precondition Required Traceback (most recent call last): File "D:\Durgesh Files\Programming\TESTS\spotify2mp3\run.py", line 176, in finalize_download yt_vid_obj = yt_dl_obj.streams.filter(only_audio=True) File "C:\Users\Durgesh\AppData\Local\Programs\Python\Python310\lib\site-packages\pytube__main__.py", line 296, in streams return StreamQuery(self.fmt_streams) File "C:\Users\Durgesh\AppData\Local\Programs\Python\Python310\lib\site-packages\pytube__main.py", line 176, in fmt_streams stream_manifest = extract.apply_descrambler(self.streaming_data) File "C:\Users\Durgesh\AppData\Local\Programs\Python\Python310\lib\site-packages\pytube\main.py", line 157, in streaming_data if 'streamingData' in self.vid_info: File "C:\Users\Durgesh\AppData\Local\Programs\Python\Python310\lib\site-packages\pytube\main__.py", line 246, in vid_info innertube_response = innertube.player(self.video_id) File "C:\Users\Durgesh\AppData\Local\Programs\Python\Python310\lib\site-packages\pytube\innertube.py", line 300, in player return self._call_api(endpoint, query, self.base_data) File "C:\Users\Durgesh\AppData\Local\Programs\Python\Python310\lib\site-packages\pytube\innertube.py", line 239, in _call_api self.fetch_bearer_token() File "C:\Users\Durgesh\AppData\Local\Programs\Python\Python310\lib\site-packages\pytube\innertube.py", line 187, in fetch_bearer_token response = request._execute_request( File "C:\Users\Durgesh\AppData\Local\Programs\Python\Python310\lib\site-packages\pytube\request.py", line 37, in _execute_request return urlopen(request, timeout=timeout) # nosec File "C:\Users\Durgesh\AppData\Local\Programs\Python\Python310\lib\urllib\request.py", line 216, in urlopen return opener.open(url, data, timeout) File "C:\Users\Durgesh\AppData\Local\Programs\Python\Python310\lib\urllib\request.py", line 525, in open response = meth(req, response) File "C:\Users\Durgesh\AppData\Local\Programs\Python\Python310\lib\urllib\request.py", line 634, in http_response response = self.parent.error( File "C:\Users\Durgesh\AppData\Local\Programs\Python\Python310\lib\urllib\request.py", line 563, in error return self._call_chain(args) File "C:\Users\Durgesh\AppData\Local\Programs\Python\Python310\lib\urllib\request.py", line 496, in _call_chain result = func(args) File "C:\Users\Durgesh\AppData\Local\Programs\Python\Python310\lib\urllib\request.py", line 643, in http_error_default raise HTTPError(req.full_url, code, msg, hdrs, fp) urllib.error.HTTPError: HTTP Error 428: Precondition Required

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "D:\Durgesh Files\Programming\TESTS\spotify2mp3\run.py", line 562, in main() File "D:\Durgesh Files\Programming\TESTS\spotify2mp3\run.py", line 546, in main download_playlist(spotify_url_link, playlist_name, linkAdd, token) File "D:\Durgesh Files\Programming\TESTS\spotify2mp3\run.py", line 423, in download_playlist finalize_download(song, skipped_songs, failed_downloads, legal_path_characters, folder_name, spotify_playlist_id) File "D:\Durgesh Files\Programming\TESTS\spotify2mp3\run.py", line 238, in finalize_download failed_song_names = failed_song_names + "\t• " + song_name + " - " + artist + f" | Fail reason: {e}" + "\n" UnboundLocalError: local variable 'failed_song_names' referenced before assignment

And Please make sure that this works with my playlist as well because when i entered my spotify playlist link that time it showed the error Could not find playlist name please provide a name

my spotify playlist link https://open.spotify.com/playlist/649OfpVgIVrppB0zRV7kAJ?si=17295df20e494ef7

couldbejake commented 1 year ago

Hi @DurgeshKavate003 I will look into your error, but we are in the process of writing this application from scratch for stability.

couldbejake commented 1 year ago

For now, please use https://github.com/couldbejake/spotify2mp3/tree/97c56424e261d15369bfc0a51de59b31723a135e

DurgeshKavate003 commented 1 year ago

thanks... and good luck...

couldbejake commented 11 months ago

The code has been updated, I hope all is well.