Пример #1
0
        static void Main(string[] args)
        {
            string path = "/var/media/My Book";
            string url  = "https://prg1.bitport.io/246wccyvtud1pznnwr6dp8y32ujbkb4x";
            string name = "The.Exorcist.S01E06.HDTV.x264-FUM[ettv].mp4";

            string deviceHostName = "libreelec";
            string deviceUserName = "******";
            string devicePassword = "******";


            var setup = new DeviceSetup(deviceHostName, deviceUserName, devicePassword, path);


            using (var manager = new DownloadManager(setup))
            {
                var download = new DownloadInfo(url, name);

                manager.StartDownloadingFile(download);


                foreach (var status in manager.Downloads)
                {
                    Console.WriteLine(status);
                }
            }
        }
Пример #2
0
        public DownloadManager(DeviceSetup setup)
        {
            Setup = setup;

            sshClient = new SshClient(setup.DeviceHostName, setup.DeviceUserName, setup.DevicePassword);
            sshClient.ConnectionInfo.Timeout = new TimeSpan(0, 0, 10);

            try
            {
                sshClient.Connect();
            }
            catch (Exception)
            {
            }
        }