hypem-resolver.js
function getById(hypemId, callback) {
        var options = {
            method: 'HEAD',
            url: HYPEM_GO_URL + hypemId,
            followRedirect: false,
            timeout: FIVE_SECONDS_IN_MILLIS
        };

        request(options, function (error, response) {
            if (error || response.statusCode !== 302) {
                callback(error, null);
                return;
            }
            var songUrl = response.headers.location;
            if (isSoundcloudUrl(songUrl)) {
                var soundcloudUrl = getNormalizedSoundcloudUrl(songUrl);
                callback(null, soundcloudUrl);
            } else {
                requestHypemKey(hypemId, function (error, hypemKey) {
                    if (error) {
                        callback(error, null);
                        return;
                    }
                    requestMp3Url(hypemId, hypemKey, callback);
                });
            }
        });
    }
function getById(hypemId, callback) {
        var options = {
            method: 'HEAD',
            url: HYPEM_GO_URL + hypemId,
            followRedirect: false,
            timeout: FIVE_SECONDS_IN_MILLIS
        };

        request(options, function (error, response) {
            if (error || response.statusCode !== 302) {
                callback(error, null);
                return;
            }
            var songUrl = response.headers.location;
            if (isSoundcloudUrl(songUrl)) {
                var soundcloudUrl = getNormalizedSoundcloudUrl(songUrl);
                callback(null, soundcloudUrl);
            } else {
                requestHypemKey(hypemId, function (error, hypemKey) {
                    if (error) {
                        callback(error, null);
                        return;
                    }
                    requestMp3Url(hypemId, hypemKey, callback);
                });
            }
        });
    }
function getById ( hypemId , callback ) { var options = { method : 'HEAD' , url : HYPEM_GO_URL + hypemId , followRedirect : false , timeout : FIVE_SECONDS_IN_MILLIS } ; request ( options , function ( error , response ) { if ( error || response . statusCode !== 302 ) { callback ( error , null ) ; return ; } var songUrl = response . headers . location ; if ( isSoundcloudUrl ( songUrl ) ) { var soundcloudUrl = getNormalizedSoundcloudUrl ( songUrl ) ; callback ( null , soundcloudUrl ) ; } else { requestHypemKey ( hypemId , function ( error , hypemKey ) { if ( error ) { callback ( error , null ) ; return ; } requestMp3Url ( hypemId , hypemKey , callback ) ; } ) ; } } ) ; }
Get the soundcloud or mp3 url from a song's id.

@param hypemId {string} the id of the song
@param {Function}[callback] callback function
@param {Error} callback.err null if no error occurred
@param {string} callback.url the soundcloud or mp3 url
Get the soundcloud or mp3 url from a song s id .