Exemple #1
0
        static int Main(string[] args)
        {
            var client   = NitroClient.FromJson();
            var progress = new ConsoleProgress();

            var key = client.GetKeyInfo();

            if (key is null)
            {
                Console.Error.WriteLine("Can't get key");
                return(1);
            }

            if (!key.IsActive())
            {
                Console.Error.WriteLine("Key is not active");
                return(1);
            }

            Console.WriteLine($"Today traffic left: {(key.TrafficLeft / 1024 / 1024):N0} Mb");

            if (args.Length != 0)
            {
                foreach (var url in args)
                {
                    client.DownloadFile(url, progress);
                }

                Console.WriteLine();
                Console.WriteLine("ALL DONE");
                Console.WriteLine();
            }

            return(0);
        }
Exemple #2
0
        public MainForm()
        {
            InitializeComponent();

            _client = NitroClient.FromJson();
        }