Live data from Hacker News

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

github.com

71–80 of 95 posts

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

#71

Jesus .. the package.json alone is probably longer then a shellscript would be that implements the same functionality.

This comment breaks the HN guidelines and especially the Show HN guidelines. Would you mind reviewing them and not posting like this here?

https://news.ycombinator.com/newsguidelines.html

https://news.ycombinator.com/showhn.html

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

#72

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 POS…

Could you please stop creating accounts for every few comments you post? We ban accounts that do that. This is in the site guidelines: https://news.ycombinator.com/newsguidelines.html.

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

#73
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.

I struggle to use youtube-dl due to the abundance of parameters, and this gave me the realisation that it is missing interactive mode! So, I'm quite grateful that this person shared their creation.

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

#74
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 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

#75

Earlier 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

What content fron youtube do you watch on such trips?

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

#76
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-...

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

#77

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

Rolling release or every six months?

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

#78

Youtube-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…

>Similarly, if you're displaying an ad, it follows that you can not display an ad.

Unless it’s burnt into the video stream.

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

#79
post #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.)

It's not that bad. Captain Obvious example:

  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

#80
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.

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.
Post reply on HN