var Downloader=require('../Downloader').Downloader;
var download=new Downloader();


var options = {
    directory: require('app-root-path').path,
    filename: "music.mp3",
    speed: 0,
    useproxy: 0,
    proxyuser: 'smg',
    proxypass: 'smg',
    proxyport: 3128,
    proxyhost: '127.0.0.1'
}

download.downloadFile('http://cdn.smg.com.tr/000772c4-efab-4e7f-8a02-ffe08653d2e1.mp3',true,options,
    (pageStatus,pageMessage,filename)=>{
    //download finished event
        console.log('download finished, status:',pageStatus,',msg:',pageMessage,',file:',filename)
    },
    (filename, percentage, current, total, speed, currentbytes, totalbytes)=>{
        //download progress
        //console.log('progress:',filename, percentage,"%", current, total," @", speed, currentbytes, totalbytes)
    },
    (message,filename)=>{
        //error msg
        console.log('error:',message,filename)
    });