Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/perl
- #Designed by Dalton Stacey Dick
- #Version 0.1
- #requires Cygwin to be installed
- #requires Cygwin programs to be in PATH
- #handbrake is also installed in PATH
- @input = `ls "/cygdrive/l/Handbrake/Input"`;
- @fileFormats = qw/ .mpg .mkv .avi .wmv .mp4 .flv /;
- print @input;
- foreach $file (@input){
- foreach $format (@fileFormats){
- if($file =~ m/.$format/i){
- chomp($file);
- $number = length($file);
- $number = $number - 5;
- $checkFile = substr($file, 0, -4);
- $finishedFile = $checkFile.".m4v";
- system("ls "."\"L:\\Handbrake\\Output\\");
- $string = "L:\\Handbrake\\Output\\".$finishedFile;
- unless (-e $string){
- system("handbrakeCLI -i \"L:\\Handbrake\\Input\\$checkFile$format\" -o \"L:\\Handbrake\\Output\\".$checkFile.".m4v\" --preset iPod");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment