From 09d9204ea591d6e6f727d54ca96dddac12c4a152 Mon Sep 17 00:00:00 2001 From: Max Bradbury Date: Wed, 11 Nov 2020 12:48:47 +0000 Subject: [PATCH] name change; use youtube-dlc fork --- Cargo.toml | 6 +++--- README.md | 19 +++++++++++++++---- src/main.rs | 6 +++--- 3 files changed, 21 insertions(+), 10 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 548c0d8..b00ab36 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,7 +1,7 @@ [package] -name = "youtube-dl-gtk" -description = "a simple frontend for youtube-dl" -version = "0.1.3" +name = "media-downloader-gtk" +description = "a simple frontend for youtube-dlc" +version = "0.1.4" authors = ["Max Bradbury "] repository = "https://tinybird.dev/max/youtube-dl-gtk" license = "MIT" diff --git a/README.md b/README.md index f25d931..a9c1165 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,7 @@ -# youtube-dl-gtk +# media-downloader -a simple graphical frontend for the `youtube-dl` media downloader. +a simple graphical frontend for the `youtube-dlc` media downloader. +`youtube-dlc` must be installed and in your PATH. really just an experiment in creating my first desktop program, so don't expect too much. @@ -8,11 +9,21 @@ uses `gtk-rs`. released under the MIT license. ## features -download from any media source that `youtube-dl` supports (e.g. soundcloud, mixcloud, etc.) +download from any media source that `youtube-dlc` supports (e.g. soundcloud, mixcloud, etc.) extract audio and convert to mp3 ## known problems -will hang after clicking "go!" due to `youtube-dl` being executed in the same thread. +no validation for URL bar + +no user feedback + +will hang after clicking "go!" due to `youtube-dlc` being executed in the same thread. there is no user feedback so this basically looks like the program crashing. + +TODO: investigate using https://crates.io/crates/gtk-future-executor + +would it be possible to add progress bars for in-progress downloads somehow? + +notifications for when downloads finish? diff --git a/src/main.rs b/src/main.rs index c372e87..322c530 100644 --- a/src/main.rs +++ b/src/main.rs @@ -11,7 +11,7 @@ const SPACING: i32 = 16; fn build_ui(application: >k::Application) { let window = gtk::ApplicationWindow::new(application); - window.set_title("youtube-dl"); + window.set_title("media downloader"); window.set_border_width(SPACING as u32); window.set_position(gtk::WindowPosition::Center); window.set_default_size(400, 100); @@ -24,7 +24,7 @@ fn build_ui(application: >k::Application) { input_url.set_placeholder_text(Some("Enter URL here")); input_url.set_input_purpose(InputPurpose::Url); - + horizontal.set_homogeneous(true); window.add(&vertical); @@ -40,7 +40,7 @@ fn build_ui(application: >k::Application) { button.connect_clicked(move |_| { let url = input_url.get_buffer().get_text(); println!("url: {}", url); - let mut youtube_dl = Command::new("youtube-dl"); + let mut youtube_dl = Command::new("youtube-dlc"); if convert_to_mp3.get_active() { println!("convert to mp3: true");