Earlier 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.
Show HN: Interactively select the quality and format for youtube-dl
81–90 of 95 posts
Re: Show HN: Interactively select the quality and format for youtube-dl
#82Re: Show HN: Interactively select the quality and format for youtube-dl
#83Jesus .. the package.json alone is probably longer then a shellscript would be that implements the same functionality.
I would love to see the shellscript equivalent! :))
f=/tmp/youtube-urls;sed 's/^/url=/'|exec curl -K-|exec grep -o "https%3A%2F%2Fr[0-9][a-zA-Z0-9.%_-]*"|exec sed -n 's/%26/\&/g;s/%3D/=/g;s/%3A/:/g;s/%2F/\//g;s/%3F/?/g;s/%25/%/g;w'"$f"'';case $1 in --help|-help|-h|-?)exec echo usage: echo youtube-url\|$0 \[fmt\] \[saveas\];;*) a=$(exec grep "itag=$1"\& $f 2>/dev/null);case ${#a} in 0) echo "the fmt (itag number \""$1"\") is not available. here are the available formats:";exec grep -o "itag=[0-9]*" $f;;*)exec curl -4o ${1-$c} $a;esac;esac
The idea of interactively selecting the format seems like it would become cumbersome after the user learns the formats, i.e., itag numbers, that she can play on her computer.Once she has that knowledge, she will just be looking for the same itag numbers every time, e.g., 18 or 22 are popular for mp4.
Re: Show HN: Interactively select the quality and format for youtube-dl
#84Cool, here's my simple script to select format called vdl, and can be extended: #!/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 kn…
"${OPTS[@]}"
This is what shellcheck reports.Re: Show HN: Interactively select the quality and format for youtube-dl
#85Earlier quoted context omitted.
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.
I’m guessing from the fact that you’ve literally just created this account to post these ridiculous statements that you’re nothing more than a troll account.
Nevertheless, it is you who choose to engage with my comments on such a dismissive note. I am prepared that my statements will initially be called ridiculous, but speaking one's mind is a great way to learn faster and there's always plenty to catch up with.
Re: Show HN: Interactively select the quality and format for youtube-dl
#86Earlier quoted context omitted.
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.
So you'd like to use APL, then? He didn't say symbols. Verbose code can be much easier, though stupidly verbose is stupid. Compromise is, as usual, the best solution.
As for APL, in fact I would try it, it's one of the more interesting relics that sometimes surface on HN. What could I achieve with it though? Many nice things have been lost to ecosystem fatigue even if a spec stays the same.
Compromise is best of course. "Halfway happy."
Re: Show HN: Interactively select the quality and format for youtube-dl
#87Earlier quoted context omitted.
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.
Rolling release or every six months?
You could argue this is bad because it bypasses the distro release system, but then, Youtube also updates itself without the distro's approval, so the software that interfaces with it must as well.
Re: Show HN: Interactively select the quality and format for youtube-dl
#88Earlier quoted context omitted.
For videos, this should work... added to your .bashrc file, which then needs to be reloaded (only once) by typing source .bashrc in your home directory from the command line: alias yt='youtube-dl --recode-video mp4' On my system I have a funky python setup so I need to use this instead: alias yt='unset PYTHONPATH; youtube-dl --recode-video mp4' I don't see the need for interactivity because the only format I ever wan…
> I don't see the need for interactivity because the only format I ever want is mp4. Then this tool isn't for you. If you're gonna skip the whole point of the tool, you can't claim your code suggestions are equivalent.
Re: Show HN: Interactively select the quality and format for youtube-dl
#89Earlier quoted context omitted.
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…
On a side-note, can you recommend any good TUI libraries for Python? 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
#90Cool, here's my simple script to select format called vdl, and can be extended: #!/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 kn…
- Quote "$2" and "$1" - Use "$@" instead of $* - Use: OPTS=(-o "%(title)s.%(ext)s" --console-title --restrict-filenames) "${OPTS[@]}" This is what shellcheck reports.
However, the youtube (and other sites id) and the format number will never contain spaces, so quoting isn't really needed here. If it gives peace of mind, sure.