couldbejake / spotify2mp3

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

Error at the start of download #12

Open shorax opened 2 years ago

shorax commented 2 years ago

I have tried to download any playlist, but i always get this same error. What should I do?

Traceback (most recent call last): File "C:\Python310\lib\site-packages\pytube__main__.py", line 181, in fmt_streams extract.apply_signature(stream_manifest, self.vid_info, self.js) File "C:\Python310\lib\site-packages\pytube\extract.py", line 409, in apply_signature cipher = Cipher(js=js) File "C:\Python310\lib\site-packages\pytube\cipher.py", line 33, in init raise RegexMatchError( pytube.exceptions.RegexMatchError: init: could not find match for ^\w+\W

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "F:\test\spotify2mp3\run.py", line 276, in main() File "F:\test\spotify2mp3\run.py", line 270, in main download_playlist(spotify_url_link, playlist_name) File "F:\test\spotify2mp3\run.py", line 182, in download_playlist yt_vid_obj = yt_dl_obj.streams.filter(only_audio=True).first() File "C:\Python310\lib\site-packages\pytube__main.py", line 296, in streams return StreamQuery(self.fmt_streams) File "C:\Python310\lib\site-packages\pytube__main__.py", line 188, in fmt_streams extract.apply_signature(stream_manifest, self.vid_info, self.js) File "C:\Python310\lib\site-packages\pytube\extract.py", line 409, in apply_signature cipher = Cipher(js=js) File "C:\Python310\lib\site-packages\pytube\cipher.py", line 33, in init raise RegexMatchError( pytube.exceptions.RegexMatchError: init__: could not find match for ^\w+\W

couldbejake commented 2 years ago

It looks like pytube has been slightly broken by a API change from YouTube.

There's a temporary patch avaliable, to install do the following:

pip3 uninstall pytube

python3 -m pip install git+https://github.com/JazPin/pytube

If you have any other questions feel free to open another ticket.

shorax commented 2 years ago

Thanks!

ZIZNAH commented 11 months ago

Hi, I'm having the same problem, I used your method above and still have the same problem.

[!] Retrieving spotify playlist (large playlists will take time) Traceback (most recent call last): File "spotify2mp3.py", line 210, in main(authtype=authtype, playlist=url, private_playlist=True, quality=quality, min_views=DEFAULT_MIN_VIEWS_FOR_DOWNLOAD, max_length=DEFAULT_MAX_LENGTH_FOR_DOWNLOAD) File "spotify2mp3.py", line 166, in main success = downloader.download_playlist(playlist) File "G:\git\spotify2mp3\downloader.py", line 86, in download_playlist self.prep_folder("downloads/playlists/" + playlist.get_title(True)) File "G:\git\spotify2mp3\apis\spotify.py", line 95, in get_title self.load() File "G:\git\spotify2mp3\apis\spotify.py", line 63, in load playlist = self.base.tekore_spotify.playlist(self.resource_id) File "D:\Program Files\Python38\lib\site-packages\tekore_client\api\playlist\view.py", line 43, in wrapper return post_func(json) File "D:\Program Files\Python38\lib\site-packages\tekore_client\process.py", line 29, in postfunc return type(json) if json is not None else None File "D:\Program Files\Python38\lib\site-packages\tekore_model\serialise.py", line 48, in init super().init(data) File "D:\Program Files\Python38\lib\site-packages\pydantic\main.py", line 164, in init pydantic_self.pydantic_validator.validate_python(data, self_instance=pydantic_self__) File "D:\Program Files\Python38\lib\site-packages\tekore_model\serialise.py", line 48, in init super().init(**data) File "D:\Program Files\Python38\lib\site-packages\pydantic\main.py", line 164, in init pydantic_self.pydantic_validator.validate_python(data, self_instance=pydantic_self) File "D:\Program Files\Python38\lib\site-packages\tekore_model\serialise.py", line 48, in init super().init(**data) File "D:\Program Files\Python38\lib\site-packages\pydantic\main.py", line 164, in init pydantic_self.pydantic_validator.validate_python(data, self_instance=pydantic_self) File "D:\Program Files\Python38\lib\site-packages\tekore_model\serialise.py", line 48, in init super().init(**data) File "D:\Program Files\Python38\lib\site-packages\pydantic\main.py", line 164, in init pydantic_self.pydantic_validator.validate_python(data, self_instance=pydantic_self__) pydantic_core._pydantic_core.ValidationError: 13 validation errors for FullPlaylistEpisode audio_preview_url Field required [type=missing, input_value={'album': {'album_type': ...1YUdN5K8jReExVaEfSRZTK'}, input_type=dict] For further information visit https://errors.pydantic.dev/2.5/v/missing description Field required [type=missing, input_value={'album': {'album_type': ...1YUdN5K8jReExVaEfSRZTK'}, input_type=dict] For further information visit https://errors.pydantic.dev/2.5/v/missing html_description Field required [type=missing, input_value={'album': {'album_type': ...1YUdN5K8jReExVaEfSRZTK'}, input_type=dict] For further information visit https://errors.pydantic.dev/2.5/v/missing images Field required [type=missing, input_value={'album': {'album_type': ...1YUdN5K8jReExVaEfSRZTK'}, input_type=dict] For further information visit https://errors.pydantic.dev/2.5/v/missing is_externally_hosted Field required [type=missing, input_value={'album': {'album_type': ...1YUdN5K8jReExVaEfSRZTK'}, input_type=dict] For further information visit https://errors.pydantic.dev/2.5/v/missing is_playable Field required [type=missing, input_value={'album': {'album_type': ...1YUdN5K8jReExVaEfSRZTK'}, input_type=dict] For further information visit https://errors.pydantic.dev/2.5/v/missing language Field required [type=missing, input_value={'album': {'album_type': ...1YUdN5K8jReExVaEfSRZTK'}, input_type=dict] For further information visit https://errors.pydantic.dev/2.5/v/missing languages Field required [type=missing, input_value={'album': {'album_type': ...1YUdN5K8jReExVaEfSRZTK'}, input_type=dict] For further information visit https://errors.pydantic.dev/2.5/v/missing release_date Field required [type=missing, input_value={'album': {'album_type': ...1YUdN5K8jReExVaEfSRZTK'}, input_type=dict] For further information visit https://errors.pydantic.dev/2.5/v/missing release_date_precision Field required [type=missing, input_value={'album': {'album_type': ...1YUdN5K8jReExVaEfSRZTK'}, input_type=dict] For further information visit https://errors.pydantic.dev/2.5/v/missing show Field required [type=missing, input_value={'album': {'album_type': ...1YUdN5K8jReExVaEfSRZTK'}, input_type=dict] For further information visit https://errors.pydantic.dev/2.5/v/missing episode Input should be True [type=literal_error, input_value=False, input_type=bool] For further information visit https://errors.pydantic.dev/2.5/v/literal_error track Input should be False [type=literal_error, input_value=True, input_type=bool] For further information visit https://errors.pydantic.dev/2.5/v/literal_error

couldbejake commented 11 months ago

The code needs re-writing, as it does from time to time. I'll be fixing your issues, with the others that have built up, asap.

Sorry for the delay.

I hope all is well.

ZIZNAH commented 11 months ago

The code needs re-writing, as it does from time to time. I'll be fixing your issues, with the others that have built up, asap.

Sorry for the delay.

I hope all is well.

Thanks for the reply, I saw your answer again in other issus, hopefully better.

stevenmathers03 commented 11 months ago

Hi, having problem here, can help me? im using macbook

Please provide a Spotify URL (right click, share, copy link) or 'liked':

https://open.spotify.com/track/79R7rJGvh4cIdQJO4IL0J7?si=dcf8794847974a73

Which quality would you like? (Options: low, medium, high, or specify bitrate up to 320): 320

Chosen Settings

Song: https://open.spotify.com/track/79R7rJGvh4cIdQJO4IL0J7?si=dcf8794847974a73 Song quality / bitrate: 320 / 320 bps Accessing Spotify anonymously

Searching for song [1/0] : Sleigh Ride by Leroy Anderson Iain Sutherland Concert Orchestra Iain Sutherland Traceback (most recent call last): File "/Users/stevenmathers/Downloads/Github/spotify2mp3-main/spotify2mp3.py", line 206, in main(authtype=authtype, song=url, quality=quality, min_views=DEFAULT_MIN_VIEWS_FOR_DOWNLOAD, max_length=DEFAULT_MAX_LENGTH_FOR_DOWNLOAD) File "/Users/stevenmathers/Downloads/Github/spotify2mp3-main/spotify2mp3.py", line 164, in main success = downloader.download_track(song) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/stevenmathers/Downloads/Github/spotify2mp3-main/downloader.py", line 185, in download_track youtube_link = self.youtube_client.search( searchable_name, self.max_length, self.min_view_count ) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/stevenmathers/Downloads/Github/spotify2mp3-main/apis/youtube.py", line 32, in search youtube_video_duration_seconds = int(youtube_video_duration[0]) * 60 + int(youtube_video_duration[1]) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ValueError: invalid literal for int() with base 10: '3.20'

ZIZNAH commented 11 months ago

Hi, having problem here, can help me? im using macbook

Please provide a Spotify URL (right click, share, copy link) or 'liked':

https://open.spotify.com/track/79R7rJGvh4cIdQJO4IL0J7?si=dcf8794847974a73

Which quality would you like? (Options: low, medium, high, or specify bitrate up to 320): 320

Chosen Settings

Song: https://open.spotify.com/track/79R7rJGvh4cIdQJO4IL0J7?si=dcf8794847974a73 Song quality / bitrate: 320 / 320 bps Accessing Spotify anonymously

Searching for song [1/0] : Sleigh Ride by Leroy Anderson Iain Sutherland Concert Orchestra Iain Sutherland Traceback (most recent call last): File "/Users/stevenmathers/Downloads/Github/spotify2mp3-main/spotify2mp3.py", line 206, in main(authtype=authtype, song=url, quality=quality, min_views=DEFAULT_MIN_VIEWS_FOR_DOWNLOAD, max_length=DEFAULT_MAX_LENGTH_FOR_DOWNLOAD) File "/Users/stevenmathers/Downloads/Github/spotify2mp3-main/spotify2mp3.py", line 164, in main success = downloader.download_track(song) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/stevenmathers/Downloads/Github/spotify2mp3-main/downloader.py", line 185, in download_track youtube_link = self.youtube_client.search( searchable_name, self.max_length, self.min_view_count ) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/stevenmathers/Downloads/Github/spotify2mp3-main/apis/youtube.py", line 32, in search youtube_video_duration_seconds = int(youtube_video_duration[0]) * 60 + int(youtube_video_duration[1]) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ValueError: invalid literal for int() with base 10: '3.20'

There is a problem with the song list download, the author is rewriting it, please be patient~

stevenmathers03 commented 11 months ago

Hi, having problem here, can help me? im using macbook Please provide a Spotify URL (right click, share, copy link) or 'liked':

https://open.spotify.com/track/79R7rJGvh4cIdQJO4IL0J7?si=dcf8794847974a73

Which quality would you like? (Options: low, medium, high, or specify bitrate up to 320): 320 Chosen Settings Song: https://open.spotify.com/track/79R7rJGvh4cIdQJO4IL0J7?si=dcf8794847974a73 Song quality / bitrate: 320 / 320 bps Accessing Spotify anonymously Searching for song [1/0] : Sleigh Ride by Leroy Anderson Iain Sutherland Concert Orchestra Iain Sutherland Traceback (most recent call last): File "/Users/stevenmathers/Downloads/Github/spotify2mp3-main/spotify2mp3.py", line 206, in main(authtype=authtype, song=url, quality=quality, min_views=DEFAULT_MIN_VIEWS_FOR_DOWNLOAD, max_length=DEFAULT_MAX_LENGTH_FOR_DOWNLOAD) File "/Users/stevenmathers/Downloads/Github/spotify2mp3-main/spotify2mp3.py", line 164, in main success = downloader.download_track(song) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/stevenmathers/Downloads/Github/spotify2mp3-main/downloader.py", line 185, in download_track youtube_link = self.youtube_client.search( searchable_name, self.max_length, self.min_view_count ) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/stevenmathers/Downloads/Github/spotify2mp3-main/apis/youtube.py", line 32, in search youtube_video_duration_seconds = int(youtube_video_duration[0]) * 60 + int(youtube_video_duration[1]) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ValueError: invalid literal for int() with base 10: '3.20'

There is a problem with the song list download, the author is rewriting it, please be patient~

ok thanks