Esempio n. 1
0
 public static void OnLoad()
 {
     if (!Instance)
     {
         Instance = new GameObject("YoutubeDownloader").AddComponent <YouTubeDownloader>();
         DontDestroyOnLoad(Instance);
         Instance.videoQueue  = new Queue <VideoDownload>();
         Instance.quality     = MVPSettings.instance.QualityMode;
         Instance.downloading = false;
         Instance.updated     = false;
         Instance.UpdateYDL();
     }
 }
 public static void OnLoad()
 {
     if (!Instance)
     {
         Instance = new GameObject("YoutubeDownloader").AddComponent <YouTubeDownloader>();
         DontDestroyOnLoad(Instance);
         Instance.videoQueue  = new Queue <VideoDownload>();
         Instance.quality     = (VideoQuality)Plugin.config.GetInt("Settings", "VideoDownloadQuality", (int)VideoQuality.Medium, true);
         Instance.downloading = false;
         Instance.updated     = false;
         Instance.UpdateYDL();
     }
 }
Esempio n. 3
0
        public static void OnLoad()
        {
            if (!Instance)
            {
                Instance = new GameObject("YoutubeDownloader").AddComponent <YouTubeDownloader>();
                Instance.VideosDownloading = 0;
                DontDestroyOnLoad(Instance);
                Instance.videoQueue  = new Queue <VideoDownload>();
                Instance.quality     = Settings.instance.QualityMode;
                Instance.downloading = false;
                Instance.updated     = false;
#if UPDATEWORKING //Currently Not Working due to wrongful GitHub removal
                Instance.UpdateYDL();
#else
                Instance.updated = true;
                Plugin.logger.Info("Youtube-DL update complete");
#endif
                try
                {
                    var ffmpegProcess = new Process
                    {
                        StartInfo =
                        {
                            FileName  = Environment.CurrentDirectory + "/Youtube-dl/ffmpeg.exe",
                            Arguments = "-version",
                            RedirectStandardOutput = true,
                            RedirectStandardError  = true,
                            UseShellExecute        = false,
                            CreateNoWindow         = true
                        }
                    };
                    YouTubeDownloader.externalProcesses.Add(ffmpegProcess);
                    ffmpegProcess.Start();
                    hasFFMPEG = true;
                    Plugin.logger.Info("Has ffmpeg -> Will download and mux audio and video");
                }
                catch
                {
                    hasFFMPEG = false;
                    Plugin.logger.Info("Does not have ffmpeg -> Will only download video");
                }
            }
        }
Esempio n. 4
0
 public static void OnLoad()
 {
     if (!Instance)
     {
         Instance = new GameObject("YoutubeDownloader").AddComponent <YouTubeDownloader>();
         DontDestroyOnLoad(Instance);
         Instance.videoQueue  = new Queue <VideoDownload>();
         Instance.quality     = MVPSettings.instance.QualityMode;
         Instance.downloading = false;
         Instance.updated     = false;
         Instance.UpdateYDL();
         try
         {
             var ffmpegProcess = new Process
             {
                 StartInfo =
                 {
                     FileName  = Environment.CurrentDirectory + "/Youtube-dl/ffmpeg.exe",
                     Arguments = "-version",
                     RedirectStandardOutput = true,
                     RedirectStandardError  = true,
                     UseShellExecute        = false,
                     CreateNoWindow         = true
                 }
             };
             ffmpegProcess.Start();
             hasFFMPEG = true;
             Plugin.logger.Info("Has ffmpeg -> Will download and mux audio and video");
         }
         catch
         {
             hasFFMPEG = false;
             Plugin.logger.Info("Does not have ffmpeg -> Will only download video");
         }
     }
 }