hypem-resolver.js
function requestMp3Url(hypemId, hypemKey, callback) {
        var options = {
            method: "GET",
            url: HYPEM_SERVE_URL + hypemId + "/" + hypemKey,
            headers: {"Cookie": COOKIE},
            timeout: FIVE_SECONDS_IN_MILLIS
        };

        request(options, function (error, response) {
            if (!error && response.statusCode === 200) {
                try {
                    // the request got a json from hypem
                    // where the link to the mp3 file is saved
                    var jsonBody = JSON.parse(response.body);
                    var mp3Url = jsonBody.url;
                    callback(null, mp3Url);
                } catch (error) {
                    callback(error, null);
                }
            } else {
                callback(new Error("Nothing found: " + options.url), null);
            }
        });
    }
function requestMp3Url(hypemId, hypemKey, callback) {
        var options = {
            method: "GET",
            url: HYPEM_SERVE_URL + hypemId + "/" + hypemKey,
            headers: {"Cookie": COOKIE},
            timeout: FIVE_SECONDS_IN_MILLIS
        };

        request(options, function (error, response) {
            if (!error && response.statusCode === 200) {
                try {
                    // the request got a json from hypem
                    // where the link to the mp3 file is saved
                    var jsonBody = JSON.parse(response.body);
                    var mp3Url = jsonBody.url;
                    callback(null, mp3Url);
                } catch (error) {
                    callback(error, null);
                }
            } else {
                callback(new Error("Nothing found: " + options.url), null);
            }
        });
    }
function requestMp3Url ( hypemId , hypemKey , callback ) { var options = { method : "GET" , url : HYPEM_SERVE_URL + hypemId + "/" + hypemKey , headers : { "Cookie" : COOKIE } , timeout : FIVE_SECONDS_IN_MILLIS } ; request ( options , function ( error , response ) { if ( ! error && response . statusCode === 200 ) { try { // the request got a json from hypem // where the link to the mp3 file is saved var jsonBody = JSON . parse ( response . body ) ; var mp3Url = jsonBody . url ; callback ( null , mp3Url ) ; } catch ( error ) { callback ( error , null ) ; } } else { callback ( new Error ( "Nothing found: " + options . url ) , null ) ; } } ) ; }
Get the mp3 url of the song's id with a given key.

@private
@param {string} hypemId the id of the song
@param {string} hypemKey the key to make the request succeed
@param {Function}[callback] callback function
@param {Error} callback.err null if no error occurred
@param {string} callback.url the mp3 url
Get the mp3 url of the song s id with a given key .