Advertisement
KiberInfinity

vk Grab Audios

Jun 8th, 2013
85
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function vkGrabAudio(oid){
  2.     var params={};
  3.    oid = oid || cur.oid;
  4.    
  5.     params[oid>0?"uid":"gid"]=Math.abs(oid);
  6.    if (cur.album_id && cur.album_id>0) params['album_id']=cur.album_id;
  7.     var box=vkAlertBox('','<div id="vk_grab_process">'+vkBigLdrImg+'</div>');
  8.     dApi.call('audio.get',params,function(r){
  9.         var list=r.response;
  10.       var count=list.shift();
  11.         list.reverse();
  12.       var idx=0;
  13.       function add(){
  14.          if (idx>=list.length){
  15.             alert(IDL('Done'));
  16.             return;    
  17.          }
  18.          ge('vk_grab_process').innerHTML=vkProgressBar(idx,list.length,380,idx+'/'+list.length);
  19.          dApi.call('audio.add',{aid:list[idx].aid,oid:list[idx].owner_id},function(){
  20.             idx++;
  21.             setTimeout(add,500);
  22.          });
  23.       }
  24.       add();
  25.     });
  26. }
  27. vkGrabAudio();
Advertisement
RAW Paste Data Copied
Advertisement