public void ripPgc(Pgc pgc) { try { var process = new Process() { StartInfo = new ProcessStartInfo() { FileName = _dvdDecrypterPath, CreateNoWindow = true, UseShellExecute = false, Arguments = string.Format( "/MODE IFO /SRC {0} /DEST {1} /VTS {2} /PGC {3} /SPLIT NONE /CHAPTERS ALL{4} /START /CLOSE", _dvdDrive.Name, _workingDirectory, pgc.Vts, pgc.Id, pgc.StreamDemuxArgs ) } }; process.Start(); process.WaitForExit(); } catch (Exception e) { File.WriteAllText(string.Format(@"{0}\{1}_{2}_ripPgc_{3}", _workingDirectory, pgc.Vts, pgc.Id, ".fail"), e.Message); } }
public List<Pgc> processIfo() { var pgcs = new List<Pgc>(); var pgc = new Pgc(); try { foreach (var scan in new DirectoryInfo(_workingDirectory).GetFiles("*.scan")) { var vts = Convert.ToInt32(Pgc.VtsMatch.Match(scan.Name).Groups[1].Value); foreach (var line in File.ReadAllLines(scan.FullName)) { if (Pgc.PgcAndLengthMatch.Match(line).Success) { if (pgc.Id != null) pgcs.Add(pgc); pgc = new Pgc() { Vts = vts, Id = Convert.ToInt32(Pgc.PgcAndLengthMatch.Match(line).Groups[1].Value), Length = TimeSpan.Parse(string.Format("{0}.{1}", Pgc.PgcAndLengthMatch.Match(line).Groups[2].Value, Pgc.PgcAndLengthMatch.Match(line).Groups[3].Value)) }; } if (Pgc.AudioMatch.Match(line).Success) { var audioLine = Pgc.AudioMatch.Match(line); pgc.Audio.Add(new AudioStream() { Id = Convert.ToInt32(audioLine.Groups[1].Value), Name = audioLine.Groups[2].Value, Code = audioLine.Groups[3].Value }); } if (Pgc.SubtitleMatch.Match(line).Success) { var subtitleLine = Pgc.SubtitleMatch.Match(line); pgc.Subtitle.Add(new SubtitleStream() { Id = Convert.ToInt32(subtitleLine.Groups[1].Value), Name = subtitleLine.Groups[2].Value, Code = subtitleLine.Groups[3].Value }); } } } if (pgc.Id != null) pgcs.Add(pgc); } catch (Exception e) { File.WriteAllText(string.Format(@"{0}\{1}", _workingDirectory, "processIfo.fail"), e.Message); } return pgcs; }