top | item 45833812

(no title)

hebelehubele | 3 months ago

For long videos, I have a script that fetches the transcript using yt-dlp and pipes it to an LLM for keypoints. If the content sounds interesting, I watch it; if not, I save 45 minutes.

discuss

order

dvfjsdhgfv|3 months ago

Mind sharing the script? It's becoming a big problem to me: people send me links to "must watch videos" but neither the title nor description nor subchapter titles tell me what it actually is about.

In this particular case, it's spending 40 minutes of my life on something that could be explained in 4 sentences.

SiempreViernes|3 months ago

The more common solution I've seen is asking the person sending the link for clarification.

threeducks|3 months ago

While attempting to write my own script, I found that there are many websites which offer YouTube summaries, which are probably an easier solution. For example (not affiliated) https://www.easemate.ai/video-summary It even allows you to ask questions about the transcript.

I also found a Python library for fetching YouTube video transcripts, but some issue mentioned that they got banned, so out of caution, I implemented my summary script as a JavaScript bookmarklet instead. It will probably break on the next YouTube update, so I am not sure how useful it is. Also, you have to set your own API key (and maybe URL). I used Groq (not to be confused with Grok), because it is free and very fast.

    javascript:(function(){
    var GROQ_API_KEY = "YOUR_API_KEY_HERE";

    var btn = [...document.querySelectorAll('button')].find(b => b.textContent.trim() === 'Show transcript');
    btn.click();

    function checkTranscriptAvailable(){
        var transcript = document.querySelector('[target-id="engagement-panel-searchable-transcript"]').innerText;
        console.log("transcript:", transcript.slice(0, 50));
        var length = transcript.replace(/\s/g, '').length;
        if (length > 100){
            fetch("https://api.groq.com/openai/v1/chat/completions", {
              method: "POST",
              headers: {
                "Authorization": "Bearer " + GROQ_API_KEY,
                "Content-Type": "application/json"
              },
              body: JSON.stringify({
                "model": "openai/gpt-oss-120b",
                "messages": [
                  {
                    "role": "user",
                    "content": [
                      {
                        "type": "text",
                        "text": "Briefly summarize this transcript:\n\n" + transcript,
                      },
                    ]
                  }
                ]
              })
            })
                .then(res => res.json())
                .then(data => alert(data.choices[0].message.content))
                .catch(err => alert(err));
        }else{
            setTimeout(checkTranscriptAvailable, 1000);
        }
    };

    checkTranscriptAvailable();

    })();

red-iron-pine|3 months ago

sweet jesus share that script.

there are a lot of YT vids that can be summed up essentially in 2 sentences and I don't need to see 4 ads first.

YT's actual AI summary is useless, arguably net negative

hebelehubele|3 months ago

This is the script that uses yt-dlp to print the English transcript. I pipe it to Simon Willison's `llm` tool.

https://gist.github.com/abdusco/118a6a3ab41a0a1d2a5f8813f789...

https://github.com/simonw/llm

    > youtube_transcript.py 'https://www.youtube.com/watch?v=DAX2_mPr9W8' | llm 'give me keypoints, ignore promotions'
    Certainly! Here are the key points from the detailed discussion about dishwasher detergents, washing cycles, and hot water use:
    
    1. **Dishwasher Detergent Basics:**
       - Most dishwashers have a detergent dispenser designed to release detergent in two doses: a smaller pre-wash dose and a larger main wash dose.
       - The pre-wash helps remove easily dissolvable food residues before the main wash.
       - Oils and fats do not dissolve well in plain water; putting some detergent in the pre-wash water helps emulsify and remove these soils early.
    
    2. **Why Use Loose Powder Detergents:**
       - Loose powders allow flexible dosing: users can adjust detergent amounts based on load dirtiness.
       - Pre-dosed pods force a single, fixed dose which can be excessive or insufficient depending on the wash.
       - The dispenser’s design supports splitting detergent dosing; powders are better aligned with this system than pods.
    
       ... you get the point

jfim|3 months ago

If you want to build a quick one, it's yt-dlp to download the video, whisper to transcribe the audio, and Claude code have it summarize the transcript.

I'm not at my computer RN but I'll share it later.

hasbot|3 months ago

YouTube included a summary:

"This video explores dishwasher detergent, focusing on a new powder formulation. The creator details the science behind effective dishwashing, including pre-wash cycles and water temperature. Independent testing results comparing the new powder to leading pods are revealed."

red-iron-pine|3 months ago

yeah but it doesn't tell you the point.

i don't have 40 minutes to watch a long-form video essay about detergent.

give me the gist, which based on context is that powder works better and is cheaper

iso1631|3 months ago

I can always rely on technology connections videos to be interesting to me, so no need to do any of that.

floppyd|3 months ago

I did something similar a while back, but I treat it as "text thumbnails" and kind of replace YT frontpage with this. I don't use it all the time, but sometimes the clickbait is too much.

Also I should add Gemini (the app) is able to access YT transcripts most of the time, so sometimes I'd just paste the link and ask for a tldr. One of the few reasons to go for Gemini app, not google ai studio.

That said, Technology Connections is worth watching just because videos are very pleasant, it's probably my favorite YT subscription right now.

yomismoaqui|3 months ago

I did something similar but as a Chrome extension using Gemini 2.5 Flash (or Flash Lite) for summarizing.

On the page it shows an extra TLDR button near the like button.

You can change the prompt to modify how the summary looks and has an optional mode with links to specific timestamps.