HNHacker News
TopNewBestAskShowJobs

marcolucidi

161 karma · joined February 16, 2022

https://marcolucidi01.github.io
submissionscomments
marcolucidi··on Ask HN: What's the Situation with YouTube-Dl?
i installed `yt-dlp` once with:

    $ wget https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp && chmod +x yt-dlp && mv yt-dlp "$HOME/bin/"
(actually this command is in my "install script" that i run when i install a new distro)

when something doesn't work, i run `yt-dlp -U` and 8 times out of 10 it automatically upgrades itself to a new version with the fix, if it still doesn't work i wait a few days and usually the fix arrives :)

note: `$HOME/bin` comes first in my `$PATH` so that programs like `mpv` always uses the newer version of `yt-dlp` and not the obsolete version installed by the package manager.

marcolucidi··on Show HN: ytcast – cast YouTube videos to your smart TV from command-line
oh wow, that's pretty cool and impressive! thanks for sharing.

> ytsearch does not support continuation searches.... Continuation searches occur when a user scrolls to the bottom of a search results page.

true, I never bothered adding "continuation searches" feature to ytsearch because I very rarely scroll down to the second page of results. usually if what I'm looking for is not in the first 4-5 results, I just "refine" the search query.

ytsearch is a quick-and-dirty script that avoids me to open the browser for simple YouTube searches (I stole the idea from the initial version of ytfzf).

> It only retrieves the first 15 results.

that's not true, I always get more than 20-25 results on average and it's usually enough for my use:

    $ ytsearch foo | sort | uniq | wc -l
    37
> 1.sh only uses TLS1.3 so no server certificate is sent in plaintext over the wire. Nor does it send SNI, i.e., plaintext hostnames on the wire.

> 1.sh could be adapted to use curl but how does one disable SNI with curl.

that's pretty cool if you care about this kind of stuff!

> Not to mention curl has a TLS fingerprint that sites may use to try to block requests or treat them with prejudice.

yes I see how this could become a problem.

> ytsearch requires sed, column, awk, jq, fzf, and curl.

> 1.sh requires sed, netcat, stunnel and flex.

what are you implying here? do you think those 6 dependencies are "too much" for ytsearch compared to those of 1.sh?

anyway, it seems that the 2 tools offer a slightly different user experience out-of-the-box:

- 1.sh dumps json and can be used to continue searches without leaking too much data.

- ytsearch allows to quickly select a few urls and it's meant to be used interactively.

> To convert our line-oriented JSON to TSV, we can use line-oriented UNIX utilities. In general, this will be faster than jq and more robust for large files.

faster yes, but how it will be "more robust for large files" than jq? I always thought jq is the right tool for the job when dealing with json.

marcolucidi··on Show HN: ytcast – cast YouTube videos to your smart TV from command-line
sounds great!
marcolucidi··on Show HN: ytcast – cast YouTube videos to your smart TV from command-line
thanks!

as already said, ytcast won't work "directly" with chromecast since they use a different protocol, but there are other projects linked in this thread which work very nice with chromecast!

marcolucidi··on Show HN: ytcast – cast YouTube videos to your smart TV from command-line
sounds great!
marcolucidi··on Show HN: ytcast – cast YouTube videos to your smart TV from command-line
thank you! another handy thing that ytcast does and that chrome / YouTube smartphone app don't do is to wake-on-lan my tv if it's off when i want to play a video.
marcolucidi··on Show HN: ytcast – cast YouTube videos to your smart TV from command-line
thanks, very glad you liked the readme :)
marcolucidi··on Show HN: ytcast – cast YouTube videos to your smart TV from command-line
yes, ytcast should work with any DIAL enabled device that supports the YouTube on TV app, so it doesn't require a specific device, but it's limited to YouTube videos.
marcolucidi··on Show HN: ytcast – cast YouTube videos to your smart TV from command-line
cool! good to know about catt! unfortunately i don't have a chromecast to trying it out.
marcolucidi··on Show HN: ytcast – cast YouTube videos to your smart TV from command-line
thanks! yes, unfortunately the algo is still influenced because ytcast "tells" the YouTube on TV app to play the videos.
marcolucidi··on Show HN: ytcast – cast YouTube videos to your smart TV from command-line
thank you! the search video functionality is not builtin into ytcast, but is actually a separate script (ytsearch[0]) so you can use it with other tools!

> cast videos saved on the laptop directly.... This would be a welcome addition.

yeah i know this would be great, but unfortunately it's unfeasible with the current implementation. what ytcast does is merely "telling" the YouTube on TV app to play videos.

[0]: https://github.com/MarcoLucidi01/bin/blob/master/ytsearch

marcolucidi··on Show HN: ytcast – cast YouTube videos to your smart TV from command-line
yes? i mean for YouTube videos yes (if your tv supports the YouTube app and DIAL protocol).
marcolucidi··on Show HN: ytcast – cast YouTube videos to your smart TV from command-line
cool! lots of interesting things can be done with a chromecast, unfortunately i don't have one.
marcolucidi··on Show HN: ytcast – cast YouTube videos to your smart TV from command-line
i'm very glad you appreciated that!

> I loathe "magic" - and love seeing the mechanics of how stuff like this works.

yeah me too :)

marcolucidi··on Show HN: ytcast – cast YouTube videos to your smart TV from command-line
unfortunately it doesn't, it merely "tells" the YouTube on TV app to play videos.
marcolucidi··on Show HN: ytcast – cast YouTube videos to your smart TV from command-line
yeah, i especially dislike searching videos with the remote!
marcolucidi··on Show HN: ytcast – cast YouTube videos to your smart TV from command-line
i learned about catt in this thread and i never used it, so i may be wrong about something, but these should be the main differences:

- they use a different protocol for device discovery, catt uses mDNS, ytcast uses DIAL.

- catt requires a chromecast to work, ytcast should work with any DIAL enabled device that supports the YouTube on TV app.

- catt can cast from many sources including local files, ytcast merely "tells" the YouTube on TV app to play videos, so it's limited to YouTube.

marcolucidi··on Show HN: ytcast – cast YouTube videos to your smart TV from command-line
good for you! good to know about castnow :)
marcolucidi··on Show HN: ytcast – cast YouTube videos to your smart TV from command-line
nope