diff --git a/Apewer.Run/Batch.cs b/Apewer.Run/Batch.cs
new file mode 100644
index 0000000..db2dd87
--- /dev/null
+++ b/Apewer.Run/Batch.cs
@@ -0,0 +1,51 @@
+using Apewer;
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Text;
+
+namespace Apewer.Run
+{
+
+ public class Batch
+ {
+
+ public Batch() => ConvertBreakingBad();
+
+ public void ConvertBreakingBad()
+ {
+ var paths = StorageUtility.GetSubFiles(@"E:\Breaking Bad");
+ var outdir = @"D:\temp\bb";
+ foreach (var path in paths)
+ {
+ var name = Path.GetFileName(path);
+ Console.Title = name;
+ Console.Clear();
+
+ if (name.EndsWith(".mkv"))
+ {
+ var mp4path = Path.Combine(outdir, name.Replace(".mkv", ".mp4"));
+ if (StorageUtility.FileExists(mp4path)) continue;
+
+ var cmd = "ffmpeg.exe";
+ var arg = $"-i \"{path}\" -vcodec copy -acodec copy \"{mp4path}\"";
+ WindowsUtility.RunConsole(cmd, arg, (s) => Console.WriteLine(s));
+ continue;
+ }
+
+ if (name.EndsWith(".srt"))
+ {
+ continue;
+ var srtpath = Path.Combine(outdir, name);
+ var vttpath = Path.Combine(outdir, name.Replace(".srt", ".vtt"));
+ var text = StorageUtility.ReadFile(path).ToText(Encoding.Default);
+ StorageUtility.WriteFile(srtpath, text.ToBinary());
+ WindowsUtility.RunConsole("ffmpeg.exe", $"-i \"{srtpath}\" \"{vttpath}\"", (s) => Console.WriteLine(s));
+ continue;
+ }
+ }
+ }
+
+ }
+
+}
diff --git a/Apewer.Run/FileRenamer.cs b/Apewer.Run/FileRenamer.cs
index af87ce6..6bce94c 100644
--- a/Apewer.Run/FileRenamer.cs
+++ b/Apewer.Run/FileRenamer.cs
@@ -15,22 +15,20 @@ namespace Apewer.Run
{
// RenameZQSV();
- var paths = StorageUtility.GetSubFiles(@"Y:\telecast\芸汐传", true);
+ var dir = @"E:\Breaking Bad";
+
+ var paths = StorageUtility.GetSubFiles(dir, true);
+ var array = Json.NewArray();
foreach (var path in paths)
{
var name = Path.GetFileName(path);
- // name = name.Replace(" ", "");
- name = name.Replace(".qsv.flv.mp4", ".mp4");
- name = name.Replace(".qsv.flv.mp4", "");
- name = name.Replace("【4K】", "");
-
- var split = name.Split(' ');
- split[1] = split[1].Replace("第", "").Replace("集", "");
- if (split[1].Length == 1) split[1] = "0" + split[1];
- split[1] = "第 " + split[1] + " 集";
+ if (name.EndsWith(".mkv")) continue;
+ if (name.EndsWith(".json")) continue;
- name = string.Join(" - ", split) + ".mp4";
+ name = name.Replace("Breaking Bad - ", "");
+ array.AddItem(name);
+ name = name + ".srt";
var newPath = Path.Combine(Path.GetDirectoryName(path), name);
if (newPath != path)
@@ -40,6 +38,7 @@ namespace Apewer.Run
}
// else Console.WriteLine(path);
}
+ StorageUtility.WriteFile(Path.Combine(dir, "info.json"), array.ToString(true).ToBinary());
}
void RenameZQSV()
diff --git a/Apewer.Run/_Program.cs b/Apewer.Run/_Program.cs
index d7f348a..d01c14d 100644
--- a/Apewer.Run/_Program.cs
+++ b/Apewer.Run/_Program.cs
@@ -18,6 +18,7 @@ namespace Apewer.Run
// RunPublicClass(args);
+ // new Batch();
// new FileRenamer();
// new HashComputer();
diff --git a/Apewer/Apewer.csproj b/Apewer/Apewer.csproj
index c62c723..17df3fb 100644
--- a/Apewer/Apewer.csproj
+++ b/Apewer/Apewer.csproj
@@ -7,7 +7,7 @@