Test files for ffmpeg
This commit is contained in:
parent
8dab247c53
commit
389f3386a8
|
@ -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
|
|
@ -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
|
|
@ -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
|
Loading…
Reference in New Issue