Jesus .. the package.json alone is probably longer then a shellscript would be that implements the same functionality.
Show HN: Interactively select the quality and format for youtube-dl
71–80 of 95 posts
Re: Show HN: Interactively select the quality and format for youtube-dl
#72People 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 POS…
HN is a community. Users needn't use their real name, but should have some identity for others to relate to. Otherwise we may as well have no usernames and no community, and that would be a different kind of forum. https://hn.algolia.com/?sort=byDate&dateRange=all&type=comme...
Re: Show HN: Interactively select the quality and format for youtube-dl
#73This 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.
Re: Show HN: Interactively select the quality and format for youtube-dl
#74 #!/bin/bash
OPTS="-o %(title)s.%(ext)s --console-title --restrict-filenames"
if [ "$#" -eq 2 ]; then
if [ "$2" -eq "251" ]; then
OPTS="$OPTS -x"
fi
echo youtube-dl $OPTS -f $2 $1
youtube-dl $OPTS -f $2 $1
else
echo youtube-dl -F $*
youtube-dl -F $*
echo
echo -n "Enter number: "
read fmt
youtube-dl $OPTS -f $fmt $*
fi
To explain, if you know the format number off the top of your head you can pass it after the video id, otherwise it will prompt. Might upgrade it one day to use "set -x" instead of echo and exec.Re: Show HN: Interactively select the quality and format for youtube-dl
#75Earlier quoted context omitted.
I suspect the GP is concerned Youtube will take steps to block it. This scares me a bit too, I watch basically all Youtube content via Youtube-dl. I have a script that runs every night on Mac, so that new content automagically appears in my Movies folder.
Yep, exactly. When I fly i like to buffer a few hours worth of videos
Re: Show HN: Interactively select the quality and format for youtube-dl
#76PS: 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-...
Just few questions checking the repo. Why are you using meow? It seems like you are just using it to grab args and print help. Does it do something that is not immediately apparent? It has a lot of dependencies that might be completely useless for you. log-symbols seems also completely useless dependency, you could just add the two symbols you are using by hand. Is it doing something special? As for nodejs making thi…
I've got a mini project that a decent TUI would potentially work very well for.
Re: Show HN: Interactively select the quality and format for youtube-dl
#77Earlier quoted context omitted.
This week yes. Cat and mouse my fellow trucker
I have been a user for many years and it feels like the distro package works at least 51/52 weeks a year, so I'm not sure it's an issue more than with any other package.
Re: Show HN: Interactively select the quality and format for youtube-dl
#78Youtube-dl is one those things I wish could stay under the radar.
I feel the same, but at the same time, it's a similar process as with adblockers; it's an arms race of obfuscation. If you can view a video in your browser, then it principally follows that you can save it to your hard drive. (Similarly, if you're displaying an ad, it follows that you can not display an ad.) youtube-dl being more known isn't that hazardous, as long as there's a community of people ready to confront t…
Unless it’s burnt into the video stream.
Re: Show HN: Interactively select the quality and format for youtube-dl
#79Remembering 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.)
command -h # or --help
For ffmpeg (and other huge cli) I use my shell history, man page, and Super User site. Then edit the params.Re: Show HN: Interactively select the quality and format for youtube-dl
#80Earlier quoted context omitted.
> In absence of more accessible complexity measurements, line counts do matter somewhat. E.g. the briefer a program is, the more readable it is (last time I checked, brainpower and time is much more expensive than computing power and bandwidth.) There are as many exceptions to that rule are there are examples when it’s true. Code golfing, minifified code, shell 1 liners, Perl, etc. Line counts mean jack shit.
I would argue that even an esoteric, densely packed one-liner can still be more readable than the equivalent program spread out over a greater number of lines - simply because you can keep it all in sight at the same time and work through it without losing the bigger picture. But of course, scary symbols is scary.