BKSalman / ytdlp-gui

a very simple GUI for ytdlp written in Rust
GNU General Public License v3.0
277 stars 16 forks source link

url in command line #37

Closed coding-moding closed 1 month ago

coding-moding commented 1 month ago

I would like to add --url command line argument to be filled in download link text box. It's convinient to use to automatially open youtube links from browser. I would do PR if I know how to set download_link from fn main().

BKSalman commented 1 month ago

No problem, go ahead.

If you have any questions feel free to ask here :)

BKSalman commented 1 month ago

Here is how you could add a cli flag (even tho I might change it to use clap later, to make it more scalable): https://github.com/BKSalman/ytdlp-gui/blob/main/src/main.rs#L12-L29

This is where flags are passed to the application on startup: https://github.com/BKSalman/ytdlp-gui/blob/main/src/main.rs#L80

And then you can use it from here: https://github.com/BKSalman/ytdlp-gui/blob/main/src/lib.rs#L310

So the steps would be like this:

Hope this helps :)

coding-moding commented 1 month ago

Thanks for detailed explanation. Added the corresponding PR: https://github.com/BKSalman/ytdlp-gui/pull/38

BKSalman commented 1 month ago

Thanks for detailed explanation. Added the corresponding PR:

https://github.com/BKSalman/ytdlp-gui/pull/38

Thank you for contributing, will check it when I'm free 👍

BKSalman commented 1 month ago

merged #38 :) :+1: