diff --git a/ffmpeg.jl b/ffmpeg.jl new file mode 100644 index 0000000..3646755 --- /dev/null +++ b/ffmpeg.jl @@ -0,0 +1,22 @@ +currentdir = pwd() +#videosinfolder = readdir(currentdir) + +reextension = r"(\.[^.]+)$" + +for (_,_,filesinfolders) in walkdir(currentdir) + for files in filesinfolders + extension = match(reextension,files) + if extension == nothing + println("Not a valid extension") + else + if extension.match == ".mkv" || extension.match == ".avi" + newfiles = replace(files, reextension => s".mp4") + run(`ffmpeg -i $files $newfiles`) + sleep(3) + run(`rm $files`) + else + println("No processing done file of type: $(extension.match)") + end + end + end +end diff --git a/remconf.jl b/remconf.jl new file mode 100644 index 0000000..a7f892b --- /dev/null +++ b/remconf.jl @@ -0,0 +1,24 @@ +currentdir = pwd() + +renotvalid = r"(^\._).+(\.[^.]+)$" +reextension = r"(\.[^.]+)$" + +for (root,_,filesinfolders) in walkdir(currentdir) + for files in filesinfolders + notvalid = match(renotvalid,files) + if notvalid != nothing + maybenotvalid = notvalid.captures + if any(x -> x=="._",maybenotvalid) && (any(x -> x==".mkv",maybenotvalid) || any(x -> x==".avi",maybenotvalid)) + println("File: $root/$files is not valid, removing") + sleep(2) + run(`rm $root/$files`) + end + end + extension = match(reextension,files) + if extension.match == ".rar" + println("this is a $files file removing") + sleep(2) + run(`rm $root/$files`) + end + end +end diff --git a/testing_ffmpeg.jl b/testing_ffmpeg.jl new file mode 100644 index 0000000..eb62f0b --- /dev/null +++ b/testing_ffmpeg.jl @@ -0,0 +1,18 @@ +currentdir = pwd() +#videosinfolder = readdir(currentdir) + +reextension = r"(\.[^.]+)$" + +for (root,foldersinfolders,filesinfolders) in walkdir(currentdir) + if !isempty(foldersinfolders) + for folder in foldersinfolders + println(root * "/" * folder * "/") + println(foldersinfolders) + println(filesinfolders) + #for file in filesinfolders + # pathtofiles = root * "/" * folder * "/" * file + # println(pathtofiles) + #end + end + end +end