Open darrenshu opened 11 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?
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 '?').
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