gsteph / groove-dl

A Grooveshark song downloader in Python
http://gsteph.github.io/groove-dl/
120 stars 30 forks source link

Cannot download a song with an artist with a / in it #22

Open darrenshu opened 11 years ago

darrenshu commented 11 years ago

There is an issue on line 223, specifically https://github.com/jacktheripper51/groove-dl/blob/master/python/groove.py#L223

if s[songid]["ArtistName"] contains a "/", (such as the band AC/DC), then the file cannot be saved since wget will report an error "No such file or directory"

I worked around this issue by first importing re, then changing cmd to cmd = 'wget --post-data=streamKey=%s -O "%s - %s.mp3" "http://%s/stream.php"' % (stream["streamKey"], re.sub(r'+|/+', '', s[songid]["ArtistName"]), re.sub(r'+|/+', '', s[songid]["SongName"]), stream["ip"]) #Run wget to download the song

gsteph commented 10 years ago

Seems like the solution is too complicated for the need. Why can't we just s[songid]["ArtistName"].replace('/','') and likewise for SongName?

darrenshu commented 10 years ago

That's probably a sufficient solution. I was originally thinking there may be some problem on other OS platforms which are more stringent on filenames such as Windows where there may be additional translation for the filename (e.g. filtering things like '?').