youwee icon indicating copy to clipboard operation
youwee copied to clipboard

[Feature Request] Command line option to receive a URL (Linux)

Open marciof opened this issue 6 months ago • 13 comments

Hi,

Currently it's possible to pass a URL to Youwee via the command line, but it's convoluted. A specific command line option/flag for that would make scripting much easier.

Right now, it requires registering the Youwee app to handle the youwee:// protocol.

  1. Create file ~/.local/share/applications/Youwee.desktop with:
[Desktop Entry]
Exec=/path/to/Youwee %u
MimeType=x-scheme-handler/youwee
Name=Youwee
Type=Application
  1. Update cache database of MIME types: $ update-desktop-database ~/.local/share/applications

  2. Register protocol handler: $ xdg-mime default Youwee.desktop x-scheme-handler/youwee 3.1. Which may need beforehand: $ apt install qttools5-dev-tools

And only then can Youwee be passed a URL via the command line, with something like this (naive buggy example):

$ url='https://www.youtube.com/watch?v=3TE5aR7EHus'
$ youwee_url="$(curl --silent --resolve '*:80:127.0.0.1' --resolve '*:443:127.0.0.1' --get --data-urlencode "url=$url" --write-out 'youwee://download?v=1&action=download_now&quality=720&%{url.query}\n' -- _)"
$ xdg-open "$youwee_url"

PS: Cool app though! Thanks!

marciof avatar Jun 04 '26 03:06 marciof

Regarding this, I'm also planning to add the ability to pass URLs via the command line, but in a plugin-style way using the youwee-sdk in Settings -> Plugins

Or if you have any other suggestions, please let me know.

vanloctech avatar Jun 06 '26 03:06 vanloctech

I might not be the target audience for Youwee plugins. I'd still prefer to use command line options, or even expanded query string parameters for the download endpoint.

Just to give you an example. The other day I wanted to have Youwee skip livestreams (scheduled, live, or VODs), and for me the added complexity of writing an Youwee plugin and the whole SDK just wasn't worth it.

I ended up writing just one line of code (and then call/skip Youwee accordingly):

yt-dlp --print live_status --output-na-placeholder not_live "$url"

Cheers,

marciof avatar Jun 06 '26 04:06 marciof

Ah, I understand now. It seems your request is similar to this pull request, right? https://github.com/vanloctech/youwee/pull/72

vanloctech avatar Jun 06 '26 06:06 vanloctech

If you're so keen on using the CLI, I don't understand why you're using Youwee instead of yt-dlp. Essentially, Youwee is just a GUI for yt-dlp with some added features to simplify things for users unfamiliar with command-line interfaces.

Thank you very much for your feedback.

vanloctech avatar Jun 06 '26 06:06 vanloctech

Ah, I understand now. It seems your request is similar to this pull request, right? #72

Yes, very similar.

marciof avatar Jun 06 '26 12:06 marciof

If you're so keen on using the CLI, I don't understand why you're using Youwee instead of yt-dlp. Essentially, Youwee is just a GUI for yt-dlp with some added features to simplify things for users unfamiliar with command-line interfaces.

Thank you very much for your feedback.

I was using yt-dlp directly before. However my workflow has both an automated part, as well as occasionally manual, for which I do like having a GUI. Either way, even if it was only automated it's nice to have a GUI for downloads as cool as Youwee, Parabolic, etc. (And even then, as a matter of personal preference, I'd probably resort to single line scripts over writing a more complex Youwee plugin, if I had to for some reason.)

marciof avatar Jun 06 '26 12:06 marciof

Okay, I understand your problem. However, while parameters are easy and flexible with yt-dlp, Youwee's parameters pose security/escaping/behavior risks that are difficult to control (I want to keep Youwee as secure as possible). So, I might start with allowlist parameters. I'll look at which yt-dlp parameters are most frequently used and add a CLI for Youwee. Please wait for the next update.

vanloctech avatar Jun 06 '26 14:06 vanloctech

Super reasonable. I'd say that for me, an "expert mode" setting like #72 to add custom default options to the various tools/dependencies would be more than enough, since that way I could still just use the download endpoint as-is. Thanks!

marciof avatar Jun 06 '26 14:06 marciof

Image

vanloctech avatar Jun 07 '26 13:06 vanloctech

That's amazing. Thanks again!

marciof avatar Jun 07 '26 14:06 marciof

I will release in v0.17.0, please wait.

vanloctech avatar Jun 07 '26 15:06 vanloctech

Ok, I updated mine to v0.17.0 and I'll be testing it out more.

By the way, I noticed that if I pass a scheduled livestream, eg. 4h in the future, the video download entry shows "An unexpected error occured.", but nothing shows in the logs. FYI, it could be related to this that I also ran into: https://github.com/jmbannon/ytdl-sub/issues/1323#issuecomment-4641059951

Other than that, I can confirm livestreams are being skipped if its setting is enabled.

marciof avatar Jun 08 '26 01:06 marciof

I will check it, please close this issue, and new issue for that problem. Thanks

vanloctech avatar Jun 08 '26 02:06 vanloctech