[Feature Request] Command line option to receive a URL (Linux)
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.
- Create file
~/.local/share/applications/Youwee.desktopwith:
[Desktop Entry]
Exec=/path/to/Youwee %u
MimeType=x-scheme-handler/youwee
Name=Youwee
Type=Application
-
Update cache database of MIME types:
$ update-desktop-database ~/.local/share/applications -
Register protocol handler:
$ xdg-mime default Youwee.desktop x-scheme-handler/youwee3.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!
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.
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,
Ah, I understand now. It seems your request is similar to this pull request, right? https://github.com/vanloctech/youwee/pull/72
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.
Ah, I understand now. It seems your request is similar to this pull request, right? #72
Yes, very similar.
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.)
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.
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!
That's amazing. Thanks again!
I will release in v0.17.0, please wait.
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.
I will check it, please close this issue, and new issue for that problem. Thanks