Live data from Hacker News

Show HN: Interactively select the quality and format for youtube-dl

github.com

11–20 of 95 posts

Re: Show HN: Interactively select the quality and format for youtube-dl

#12
People gotta realize that Node.js is actually excellent for this sort of task. It hits quite a few sweet spots as an all-round Unix scripting language:

* Familiar syntax and semantics (Bash/Zsh/Fish/Csh/Ksh/Ash/Wtfsh are all way weirder than JS - and they are _only_ scripting languages, while JS is already everywhere)

* Standard library (https://nodejs.org/dist/latest-v12.x/docs/api/fs.html) gives you access to POSIX APIs ("batteries included" - but not bloated)

* Sane packaging, package management, and ecosystem (overreliance on third-party module is a thing exactly because NPM works with much less friction than e.g. the Python situation)

* Asynchronous event model lets you safely do multiple things in parallel without worrying about low-level memory management, or which concurrency boilerplate library to use, etc.

All in all, it's the perfect Unix glue. All it misses is a mature S-expression-based syntax.

For example, take the problem of locking your encrypted partitions before suspending your Linux machine. Since distro developers are too "busy" to provide what one might say is basic functionality, power users took matters in their own hands and wrote this 100-ish line Bash script (https://github.com/vianney/arch-luks-suspend), which evolved into this 1500-ish line Go monstrosity (https://github.com/guns/go-luks-suspend)... as well as these ~75 lines of Node.js (https://github.com/egasimus/node-luks-suspend).

But yeah, sure, hurr durr JaavaaScriipt baad, 0.1+0.2!==0.3, 'true'==true, etc... The horror!

Re: Show HN: Interactively select the quality and format for youtube-dl

#13
post #2

PS: I coded this in an evening. This proves for me that nodejs makes it so easy to make beautiful CLI apps. It is simple and makes may life easier. See more node cli tools at: https://github.com/sindresorhus/awesome-nodejs#command-line-...

Thanks for making this. I'd say that Node does not make good CLI apps though. It means I have to install it on my machine in order to use your program. The best CLI apps are made with compiled languages so you can distributed them without a runtime, third party libs...

Re: Show HN: Interactively select the quality and format for youtube-dl

#15
post #2

PS: I coded this in an evening. This proves for me that nodejs makes it so easy to make beautiful CLI apps. It is simple and makes may life easier. See more node cli tools at: https://github.com/sindresorhus/awesome-nodejs#command-line-...

Thanks for making this. I'd say that Node does not make good CLI apps though. It means I have to install it on my machine in order to use your program. The best CLI apps are made with compiled languages so you can distributed them without a runtime, third party libs...

Statically link ALL the things!

Re: Show HN: Interactively select the quality and format for youtube-dl

#17
post #14

Remembering flags is hard? Are shell scripts no longer a thing?

Remembering flags is hard, yes. If you use a lot of different apps remembering the flags for something you use infrequently is a pain. I don't think I've ever used ffmpeg without looking at the docs first.

As for shell scripts, they are a thing, and this thing is one (just written in node rather than bash.)

Re: Show HN: Interactively select the quality and format for youtube-dl

#18
post #6

This is too trivial to share, IMO. Anyway, shell is more suitable for this kind of programs: you could write a bash script that ties together youtube-dl and dmenu or fzf or whatever within an hour.

This is too trivial to share, IMO.

How do you define complexity threshold for something being worth sharing?

More to the point, why do you define that threshold? What benefit is there to saying someone's work that they're sharing has to be sufficiently complicated? Simple things can be immensely useful and well worth sharing.

Re: Show HN: Interactively select the quality and format for youtube-dl

#19
post #6

This is too trivial to share, IMO. Anyway, shell is more suitable for this kind of programs: you could write a bash script that ties together youtube-dl and dmenu or fzf or whatever within an hour.

Why would there be a link between trivial and worth sharing?

On the contrary, I find that a lot of tools I'm happy to have are the trivials one.

Who have never used whoami for example ? It's two chained system calls, but I'm still glad it's baked in and I don't have to rewrite it everywhere I use it.

Post reply on HN