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

TypeError: expected string or bytes-like object #51

Closed
TiCaillou opened this issue Nov 29, 2017 · 6 comments
Closed

TypeError: expected string or bytes-like object #51

TiCaillou opened this issue Nov 29, 2017 · 6 comments

Comments

@TiCaillou
Copy link

INFO: 2017-11-29 10:16:00,231 - spotify_dl - Starting spotify_dl

        User authentication requires interaction with your
        web browser. Once you enter your credentials and
        give authorization, you will be redirected to
        a url.  Paste that url you were directed to to
        complete the authorization.

Impossible d'obtenir le descripteur de fichier faisant référence à la console
Opening https://accounts.spotify.com/authorize?response_type=code&scope=user-library-read&redirect_uri=http%3A%2F%2Fwww.myname.fr%2Fcallback%2F&client_id=3d574e236247478aba6cbe7b1c43e43c in your browser

Enter the URL you were redirected to: https://www.myname.fr/callback/?code=AQDqEdipPvD_bsN7Ci_P4hoRhcVr-Z5jfmThAPNXqc3zk096LY4xNhztr4bWaJJsQtm-jupl6tYvdNwfDLPE7Q5HF8KZTCnarnQiqAYhwpicVIKqs8UvrE5OA9QsoqGzPn15G56MnhevEc3Xs2J7pOPbGfJO-bjGn7Co_k2-6ZkgW4br8rFxD8-PMK7RtEEk_9VdUgqZb_BheW5GMALESw6Ykzw84N1LDA

INFO: 2017-11-29 10:16:55,255 - _new_conn - Starting new HTTPS connection (1): accounts.spotify.com
Traceback (most recent call last):
File "/usr/local/bin/spotify_dl", line 11, in
sys.exit(spotify_dl())
File "/usr/local/lib/python3.5/dist-packages/spotify_dl/spotify_dl.py", line 78, in spotify_dl
url_match = playlist_url_pattern.match(args.url)
TypeError: expected string or bytes-like object

@SathyaBhat
Copy link
Owner

Sorry for the delayed response, will take a look at this soon,

@SathyaBhat
Copy link
Owner

SathyaBhat commented Feb 15, 2018

I had another report from @olivejun about this

spotify_dl -V -d -p 3Emr6jGUqy6dPKP8JSewMr -u mixmagofficial -o ~/Music/Spotify
    16:55:31
INFO: 2018-02-14 17:04:48,400 - spotify_dl - Starting spotify_dl
DEBUG: 2018-02-14 17:04:48,400 - spotify_dl - Setting debug mode on spotify_dl
DEBUG: 2018-02-14 17:04:48,400 - check_for_tokens - Checking for tokens
DEBUG: 2018-02-14 17:04:48,400 - check_for_tokens - Tokens fetched:  {redact} 
http://www.google.com
DEBUG: 2018-02-14 17:04:48,400 - check_for_tokens - YouTube dev key: {redact}
DEBUG: 2018-02-14 17:04:48,401 - spotify_dl - Arguments: Namespace(download=True, format_str='bestaudio/best', output='/Users/Olive/Music/Spotify', playlist='3Emr6jGUqy6dPKP8JSewMr', skip_mp3=False, uri=None, url=None, user_id='mixmagofficial', verbose=True, version=False)
Traceback (most recent call last):
  File "/usr/local/bin/spotify_dl", line 11, in <module>
    sys.exit(spotify_dl())
  File "/usr/local/lib/python3.6/site-packages/spotify_dl/spotify_dl.py", line 78, in spotify_dl
    url_match = playlist_url_pattern.match(args.url)
TypeError: expected string or bytes-like object 

And I see the problem now:

spotify_dl -V -d -p 3Emr6jGUqy6dPKP8JSewMr -u mixmagofficial -o ~/Music/Spotify

I think I had removed the older style feature of entering the playlist id and username. Now, if you just provide the playlist URL, it should work

@olivejun Is this the playlist you wanted to fetch?

can you please try this:

spotify_dl -l https://open.spotify.com/user/mixmagofficial/playlist/3Emr6jGUqy6dPKP8JSewMr -o ~/Music/Spotify

@TiCaillou can you please try just like ^^ by providing the URL?

@olivejun
Copy link

@SathyaBhat your solution worked! currently downloading the playlist now :) i'll test it with other playlists to see how it works. will let you know how it goes. thanks!

@phiresky
Copy link

This error occurs for me when not specifying a playlist url at all (which should download my music according to the readme)

@SathyaBhat
Copy link
Owner

@phiresky yep, need to fix that bug

@SathyaBhat
Copy link
Owner

this is fixed now in #64

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

4 participants