Live data from Hacker News

YouTube Transcript – read YouTube videos

youtubetranscript.com

121–130 of 144 posts

Re: YouTube Transcript – read YouTube videos

#123

If you want an CLI version of a similar idea, you can use yt-dlp and some simple jq to pull down the captions for a file: curl `\ yt-dlp -j "https://www.youtube.com/watch?v=aeWyp2vXxqA" | \ jq -r '.automatic_captions.en[] | select(.ext=="json3") | .url'`

  ... | split_sentences | grep -viE '*vpn*'

Re: YouTube Transcript – read YouTube videos

#124
post #107

Earlier quoted context omitted.

I had a huge backlog of tech videos, so I wrote me this (also to play a bit with Haskell, the base idea can be replicated easily in any language though): https://github.com/rberenguel/glancer

This is great. Sharing like this is what I love about hn. Do you have any other features planned? I’m considering a master keyword list to index against any text that comes in.

The only thing I have in my "someday" list of tasks for Glancer is the possibility of adding/using the whisper binary to get captions when/if unavailable. Aside from that I just keep it more or less working by using it myself (and to be fair on this one, I wish I wrote it in another language, Haskell can be a bit finicky to build if you do it sparingly).

Any addition that is on the "view" layer (the generated HTML) is very easy to add, just needs to go into the template file, at some point I might tweak that area but currently have no outstanding idea/requirement. The rest (i.e. the bulk of the code) is just a very bare-bones parser for captions that should be pretty stable and need no additions (crossing fingers here).

Re: YouTube Transcript – read YouTube videos

#125

   #!/bin/sh

    ttml2srt()
    {
     x=$(echo x|tr x '\34');
     tr -d '\34' \
     |sed -n "/ /;
      s/\" style=\"s2\">/$x/;
      s#

##p;}" \ |sed = \ |sed "/$x/!s/^/$x/" \ |tr '\34' '\12' \ |sed '/[ ]-->[ ]/s/\./,/g' } read x; case $x in https://www.youtube.com/watch?v=??????????\ |https://www.youtube.com/watch?v=???????????\ |https://youtu.be/???????????\ |https://youtu.be/??????????) f=${x##*=};f=${f##*/};case ${#f} in 10|11) curl -4o $f.mp4 $x video=$(tr \{ '\12' $f.srt exec ffmpeg -v quiet -y -i $video -vf subtitles=$f.srt $f.mp4 esac esac exit
The script above, "1.sh", can be used as follows.

   echo https://www.youtube.com/watch?v=aeWyp2vXxqA | 1.sh
It will download the captions as .srt and then "hardsub" them into the video as it dowloads the .mp4. NB. This is slow YouTube downloading without using yt-dl/yt-dlp. Obviously, it will not work with commercial videos.

The .srt file is saved as [YouTube ID].srt and the video as [YouTube ID].mp4, where [YouTube ID] is a 10 or 11 ASCII character string.

The video format is itag=22, i.e., mp4/720p. Not all videos will have 22 of course. I usually try itag=18, mp4/360p, if 22 is not available. Change the format to whatever is preferred.

Looking around for a .ttml/.vtt/.srv[1-3] to srt converter I found solutions that required installing Python or some other large scripting language. On GitHub I found a project called "astisub" that will convert from ttml or vtt to srt. It is a 3.8M Go binary. I wrote a shell function instead.

Re: YouTube Transcript – read YouTube videos

#126
post #86

This is a great idea; I really enjoy all these "two channels simultaneously" (side-by-side translations, video with subtitles, and in this case video with a readable transcript, where you can scroll in the video or scroll in the transcript, and be synchronized). I had done something like this a couple of years ago for some specific set of videos (e.g. https://shreevatsa.net/tex/program/videos/s10/ — compare with http…

This is cool! We're doing forced alignment with audio recordings i.e. podcasts. Here's an example from a test client: https://www.withfanfare.com/p/seldon-crisis/search-by-the-fo... Grateful for any feedback you might have. Also, if you run a knowledge-dense podcast, or know somebody that does, I would love to talk to you/them. I'm for example considering to link places, people and things in a transcript.

Wow, this looks incredible! Love how the underline travels and guides the eye.. Very impressive!

Excuse the question, but "forced alignment" is when you don't have timestamps, like in webvtt?

Re: YouTube Transcript – read YouTube videos

#127
post #29
post #27

Earlier quoted context omitted.

Not sure if you know that, but YouTube has a transcript feature available for years now. It's somewhat hidden in the interface, but let's you search with ctrl-F (or command-F) in the transcript

I use this for city council meetings to figure out who said what. It's not easy, but it's better than nothing. YouTube doesn't appear to do so well with multiple speakers.

I’ve tried to do this recently. Any suggestions on tools or workflows to dissect into different speakers?

Re: YouTube Transcript – read YouTube videos

#128

Earlier quoted context omitted.

Actually, they do. It's copyright. Plenty of legal precedent. They defend WordPress, but are willing to allow WP. The law is on their side.

> Actually, they do. No, they don't. > It's copyright. No, it isn't. It's trademark. There is no such concept as copyright in a single word. > The law is on their side. Again, no, it isn't. What was the point of your comment? Why talk if you're not worried about whether what you're saying is true or false?

Yes. Trademark not copyright. My mistake.

Otherwise: https://wordpressfoundation.org/trademark-policy/

FFS Relax. It was an oversight on my part. It's minor at best in larger scheme of things. Maybe you're having a tough day? God bless you. But this is nothing to go to the mat over.

You could have just said, "Oh. Maybe you're confusing trademark and copyright?". The last thing the world and HN needs is another high-strung belligerent asshole. That doesn't help anyone, or anything, sans your ego. It's not a good look.

Re: YouTube Transcript – read YouTube videos

#129
post #118

Earlier quoted context omitted.

This is cool! We're doing forced alignment with audio recordings i.e. podcasts. Here's an example from a test client: https://www.withfanfare.com/p/seldon-crisis/search-by-the-fo... Grateful for any feedback you might have. Also, if you run a knowledge-dense podcast, or know somebody that does, I would love to talk to you/them. I'm for example considering to link places, people and things in a transcript.

Lovely, thanks for the example. I really like how the underline is subtle yet effective. The animation/effect where it seems to inch forward is also intriguing; how does that work? (Also, this is subjective but have you considered making double-clicking on the text open the audio player even when it's not been started yet? Would make it more discoverable, though I imagine some could get annoyed. Another minor thing:…

Thank you! I wrote your points down. We're still learning how to make it most usable.

We know the start and end timestamps on a word level and we know the current player time. So all we do is set a CSS class on the words that are currently playing. We not only highlight the current word, but also the words that are close in time. This is what generates the effect.

We just released autoscroll, which is something that was requested often.

Re: YouTube Transcript – read YouTube videos

#130
post #123

If you want an CLI version of a similar idea, you can use yt-dlp and some simple jq to pull down the captions for a file: curl `\ yt-dlp -j "https://www.youtube.com/watch?v=aeWyp2vXxqA" | \ jq -r '.automatic_captions.en[] | select(.ext=="json3") | .url'`

... | split_sentences | grep -viE '*vpn*'

`| grep -viE 'skillshare'`
Post reply on HN