Esempio n. 1
0
        private void FrameAbout_Load(object sender, EventArgs e)
        {
            labelVersion.Text = Common.getAppVersion();

            try
            {
                var p     = CLI.runYouTubeCommand(YouTubeDL.binPath, "--list-extractors");
                var lines = "* " + p.StandardOutput.ReadToEnd().Trim().Replace("\n", "\r\n* ");
                textExtractors.Text = lines;
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex);
                textExtractors.Text = "ERROR: Can't get list of supported services.";
            }
        }
Esempio n. 2
0
        public static List <PlaylistInfoItem> getPlaylistMetadata(string url)
        {
            string opts = "-i --no-warnings --no-cache-dir --dump-json --flat-playlist --skip-download --yes-playlist " + url;
            var    p    = CLI.runYouTubeCommand(binPath, opts);

            p.Start();

            string json = p.StandardOutput.ReadToEnd().Trim();

            // youtube-dl returns an individual json object per line
            json = "[" + json;
            int i = json.IndexOf('\n');

            while (i > -1)
            {
                json = json.Insert(i, ",");
                i    = json.IndexOf('\n', i + 2);
            }
            json += "]";
            return(JsonConvert.DeserializeObject <List <PlaylistInfoItem> >(json));
        }
Esempio n. 3
0
 public static Process run(string opts)
 {
     return(CLI.runYouTubeCommand(binPath, opts));
 }