guo-yu / player

a command line player, supports play mp3 both from uri and local stream.
261 stars 66 forks source link

Support for http/https redirects #40

Closed mrkev closed 8 years ago

mrkev commented 9 years ago

I'm trying to access an audio stream past a redirect, but I've come to notice 302's aren't supported by this library. I hacked a quick fix by editing the dist/player directly replacing require(https) with require('follow-redirects').https. follow-redirects is a drop-in replacement for http/https with support for redirects.

I'm not too familiar with the ES6 syntax for imports, so I didn't fork/PR, but I'd suggest using follow-redirects. In theory, it's a 3 liner! (one line to add the dependency in package-json, two lines for http/https).

guo-yu commented 9 years ago

Sure, Im going to add this to to-do list