public static string getTitle(string url) { string opts = "--get-title " + url; var p = CLI.runYouTubeCommand(binPath, opts); p.Start(); return(p.StandardOutput.ReadToEnd().Trim()); }
public static string getVersion() { string opts = "--version"; var p = CLI.runYouTubeCommand(binPath, opts); p.Start(); return(p.StandardOutput.ReadToEnd().Trim()); }
public static string getExtractors() { string opts = "--list-extractors"; var p = CLI.runYouTubeCommand(binPath, opts); p.Start(); return(p.StandardOutput.ReadToEnd().Trim()); }
public static MediaInfoData getMediaData(string url) { string opts = "-s --no-warnings --no-cache-dir --print-json " + url; var p = CLI.runYouTubeCommand(binPath, opts); string json = p.StandardOutput.ReadToEnd().Trim(); return(JsonConvert.DeserializeObject <MediaInfoData>(json)); }
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."; } }
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)); }
public static Process run(string opts) { return(CLI.runYouTubeCommand(binPath, opts)); }