Live data from Hacker News

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

github.com

81–90 of 95 posts

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

#81
post #49

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.

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.

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

#82

Earlier quoted context omitted.

Yep, exactly. When I fly i like to buffer a few hours worth of videos

What content fron youtube do you watch on such trips?

AvE. My favorite Canadian redneck destroying tools, arduinos, household gadgets, and political correctness.

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

#83
post #48

Jesus .. 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

#84

Cool, 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.

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

#85
post #81

Earlier 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.

I've created this account with my very own purpose, what about you? It is to lurk less, and it's the first account that sticks because this time I remembered to whitelist HN in my cookie autodeleter.

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

#86
post #80

Earlier 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.

Any character is a symbol, and an unfamiliar string of characters, ASCII or otherwise, is perceived by the unaccustomed eye as "a string of unfamiliar symbols" simply because at a glance you have no idea what it means.

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

#87

Earlier 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?

youtube-dl has an update command built in that bypasses the distribution's update system. Works even on Debian stable.

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

#88
post #58

Earlier 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.

True! I should have made it more clear my examples weren't providing interactivity, I guess you're saying. OK.

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

#89

Earlier 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.

Sorry, I don't have any ready recommendations up my sleeve. Pretty much only CLI library I use is argparse.

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

#90

Cool, 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.

Cool, love those kind of tools.

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.

Post reply on HN