Open l4j3b opened 10 years ago
Ah, it only works with HTTP connections. Try http://soundcloud.com/yellowclaw/major-lazer-jah-no-partial
FYI, I do have plans to do this too.
Thanks for the answer ! :)
I tried using http too, but did not work. I think it may be a problem with http.js...
Plans to do what?
EDIT: Just noticed I said soundscrape in my first post. I tested with it too and had the same issue.
Interesting... I expected it to work with HTTP. I'll investigate.
I think it may be related to node http itself and not your code...
Yeah... I'm starting to think that too, even links that used to work have stopped. I wonder if they've changed the format.
Ok, it seems that all SoundCloud downloaders have stopped working.
I was looking at the http.js file (where http.get is defined).
line 1836:
exports.request = function(options, cb) { if (typeof options === 'string') { options = url.parse(options); } ... }
It probably means the problem is that the URL is not recognized as a string and options considered as an object...
So, basically, it looks like the streamUrl uses a different protocol, RTMP.
The json returned by the call on /streams is like {"rtmp_mp3_128_url":"rtmp://ec-rtmp-med....
instead of {"http_mp3_128_url":"https://ec-media.s...
So basically, some tracks are using the RTMP protocol. It should be easy to fix https://npmjs.org/package/rtmp-download
I will try to monkey patch my copy.
EDIT: the tricky part is now to get the RTMP url, it is not present in the html response from the track URL
How can a string just magically be turned into an object though?
Disregard the comment about that, the problem is just that protocol RTMP...
I ended up finding and using that: https://github.com/rg3/youtube-dl
easier...
Thanks for the answer though, I really appreciate it :)
Does that do SoundCloud? I'll look at integrating RTMP when I get a bit of spare time. Thanks for helping me debug this!
Yes, it does soundcloud. You can probably look at their code to find the solution :)
You are welcome, it was fun !
Hi,
I tried soundscrape with the following file:
https://soundcloud.com/yellowclaw/major-lazer-jah-no-partial
command: soundscrape yellowclaw major-lazer-jah-no-partial
And get the following error:
http.js:1839 if (options.protocol && options.protocol !== 'http:') { ^ TypeError: Cannot read property 'protocol' of undefined at Object.exports.request (http.js:1839:14) at Object.exports.get (http.js:1847:21) at ClientRequest. (/usr/local/lib/node_modules/soundscrape/soundscrape.coffee:77:19) at ClientRequest.g (events.js:175:14) at ClientRequest.EventEmitter.emit (events.js:95:17) at HTTPParser.parserOnIncomingClient as onIncoming at HTTPParser.parserOnHeadersComplete as onHeadersComplete at Socket.socketOnData as ondata at TCP.onread (net.js:525:27)
I tried to investigate but did not find anything... The only issue that could have been relate seems to have been fixed (nodejitsu/node-http-proxy#499).
Any ideas?
Thanks,
Edouard