diff --git a/skyscraper8/Program.cs b/skyscraper8/Program.cs index fbe57a9..8ff1613 100644 --- a/skyscraper8/Program.cs +++ b/skyscraper8/Program.cs @@ -41,7 +41,7 @@ namespace skyscraper5 class Program { private static readonly ILog logger = LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.Name); - private const int PUBLIC_RELEASE = 10; + private const int PUBLIC_RELEASE = 11; private static void IntegrationTest() { /*List ssdpDevices = SsdpClient.GetSsdpDevices(1000).ToList(); @@ -297,17 +297,29 @@ namespace skyscraper5 return; } - if (args[0].ToLowerInvariant().Equals("pcapon")) + if (args[0].ToLowerInvariant().Equals("pcap-on")) { TogglePcapConfiguration(1); return; } - if (args[0].ToLowerInvariant().Equals("pcapoff")) + if (args[0].ToLowerInvariant().Equals("pcap-off")) { TogglePcapConfiguration(2); return; } + if (args[0].ToLowerInvariant().Equals("subts-on")) + { + ToggleSubTsDumpConfiguration(true); + return; + } + + if (args[0].ToLowerInvariant().Equals("subts-off")) + { + ToggleSubTsDumpConfiguration(false); + return; + } + if (args[0].ToLowerInvariant().Equals("pts2bbf")) { if (args[1].ToLowerInvariant().Equals("bbfudpdecap")) @@ -345,10 +357,12 @@ namespace skyscraper5 Console.WriteLine(" or: .\\skyscraper8.exe \"C:\\path\\to\\file.ts\\"); Console.WriteLine(" or: .\\skyscraper8.exe \"C:\\path\\to\\my\\folder\\with\\ts\\files\\\" (for batch extraction)"); Console.WriteLine(" or: .\\skyscraper8.exe satip IP_ADDRESS DISEQC POLARITY FREQUENCY SYSTEM SYMBOL_RATE (see README file)"); - Console.WriteLine(" or: .\\skyscraper8.exe pcapon - to write a configuration file that allows PCAP writing during scraping."); - Console.WriteLine(" or: .\\skyscraper8.exe pcapoff - to write a configuration file that turns off PCAP writing during scraping."); - Console.WriteLine(); - Console.WriteLine("default behaviour is pcap writing on."); + Console.WriteLine(" or: .\\skyscraper8.exe pcap-on - to write a configuration file that allows PCAP writing during scraping."); + Console.WriteLine(" or: .\\skyscraper8.exe pcap-off - to write a configuration file that turns off PCAP writing during scraping."); + Console.WriteLine(" or: .\\skyscraper8.exe subts-on - to write a configuration file that allows extraction of nested TS."); + Console.WriteLine(" or: .\\skyscraper8.exe subts-off - to write a configuration file that turns off extraction of nested TS."); + Console.WriteLine(); + Console.WriteLine("default behaviour is pcap writing and nested TS writing on."); Console.WriteLine(); Console.WriteLine("Bonus features:"); Console.WriteLine(".\\skyscraper8.exe hlsproxy \"C:\\path\\to\\hls\\files\\\" - to pipe a HLS stream from a local directory into VLC."); @@ -356,6 +370,18 @@ namespace skyscraper5 Console.WriteLine(".\\skyscraper8.exe shannon \"C:\\some\\file.bmp\" - calculates the Shannon entropy value for any given file."); } + private static void ToggleSubTsDumpConfiguration(bool enabled) + { + PluginManager pluginManager = PluginManager.GetInstance(); + if (!pluginManager.Ini.ContainsKey("subts")) + pluginManager.Ini.Add("subts", new IniSection()); + + pluginManager.Ini["subts"]["dump"] = enabled ? "1" : "0"; + pluginManager.SaveConfiguration(); + + Console.WriteLine("Wrote skyscraper5.ini."); + } + private static void TogglePcapConfiguration(int value) { PluginManager pluginManager = PluginManager.GetInstance(); diff --git a/skyscraper8/Properties/launchSettings.json b/skyscraper8/Properties/launchSettings.json index 56a94ca..251e8d8 100644 --- a/skyscraper8/Properties/launchSettings.json +++ b/skyscraper8/Properties/launchSettings.json @@ -2,7 +2,7 @@ "profiles": { "skyscraper8": { "commandName": "Project", - "commandLineArgs": "\"C:\\devel\\skyscraper8\\skyscraper8\\bin\\Debug\\net8.0\\11049v.ts\"", + "commandLineArgs": "subts-on", "remoteDebugEnabled": false }, "Container (Dockerfile)": {