Skip to content

Instantly share code, notes, and snippets.

@SimonGivre
Created August 30, 2012 09:47
Show Gist options
  • Save SimonGivre/3525006 to your computer and use it in GitHub Desktop.
Save SimonGivre/3525006 to your computer and use it in GitHub Desktop.
put.io JS to convert into MP4 every file of folder
console.log($('.filelist .file-name .ftype:contains(video)').length + ' files to convert');
var cpt=0;
$('.filelist .file-name .ftype:contains(video)').each(function(){
var row = $(this).prev();
var id = row.attr('href').substring(row.attr('href').lastIndexOf('/')+1);
$.post('/v2/files/'+id+'/mp4',function(data){
console.log(data.status);
if(data.status=="OK") cpt++;
});
});
setTimeout("console.log(cpt);",5000);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment