Esempio n. 1
0
        private void uploadMovieRobot(string sFileDirectory)
        {
            try
            {
                string        idUpload;
                List <string> sFilePath = new List <string>(System.IO.Directory.GetFiles(sFileDirectory, "*.avi*", System.IO.SearchOption.AllDirectories));

                sFilePath = removeUplodedRobot(sFilePath);

                string   filePath;
                string   Title;
                string   Description;
                string[] Tags = null;

                int i = 0;

                foreach (var item in sFilePath)
                {
                    GoogleYoutubeUploader.YoutubeUploader upload = new GoogleYoutubeUploader.YoutubeUploader();

                    filePath    = item;
                    Title       = Path.GetFileName(item); // //"Otwarta przestrzeń PF+ 8-1";
                    Description = "";
                    Tags        = null;

                    idUpload = upload.YoutubeUpload(filePath, Title, Description, Tags);

                    if (!string.IsNullOrWhiteSpace(idUpload))
                    {
                        setFileUrlRobot(item, idUpload);
                    }

                    i++;

                    System.Console.Out.WriteLine(string.Format("Wysłano już: {0}", i.ToString()));
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message.ToString());
            }
        }
Esempio n. 2
0
        private void butUpload_Click(object sender, EventArgs e)
        {
            string idUpload;

            string[] sFilePath = new string[] { @"C:\git\youtube\Test.mp4" };
            GoogleYoutubeUploader.YoutubeUploader upload = new GoogleYoutubeUploader.YoutubeUploader();

            string filePath;
            string Title;
            string Description;

            string[] Tags = null;

            foreach (var item in sFilePath)
            {
                filePath    = item;
                Title       = "Otwarta przestrzeń PF+ 8-1";
                Description = "";
                Tags        = null;

                idUpload = upload.YoutubeUpload(filePath, Title, Description, Tags);
            }
        }