yask123 / Instant-Music-Downloader

🎷 Downloads Music From The Web
http://iyask.me/Instant-Music-Downloader/
1.41k stars 161 forks source link

'str' does not support the buffer interface #69

Open hut8 opened 9 years ago

hut8 commented 9 years ago

I installed this with pip3. Anytime I download a song I get:

'str' does not support the buffer interface

I'll fix this tonight if I get a chance.

hut8 commented 9 years ago
       list_name = title.split('-')  

That line causes that because title is bytes and '-' is of course a string. So this is actually related to my other issue, #70 -- I think one PR can fix both easily.

hut8 commented 9 years ago

Oh there's another issue here:

In this line:

    return [(x.text.encode('utf-8'), x.get('href')) for x in found]  

x.text.encode('utf-8') takes a string (x.text) and turns it into a series of bytes which are the UTF-8 representation of that string. In Python 3, since those are different types, this is causing all kinds of problems. In Python 2 it's much more subtle because .encode() will still return a string instance, as bytes aren't a distinct type there.