3 ms·
Very nice. I made a thing in Python which summarizes a YouTube transcript in bullet points. Never thought about asking it questions, that's a great idea! I jus
by andai 2y ago
Very nice. I made a thing in Python which summarizes a YouTube transcript in bullet points. Never thought about asking it questions, that's a great idea!
I just run yt-dlp to fetch the transcript and shove it in the GPT prompt. (I think also have a few lines to remove the timestamps, although arguably those would be useful to keep.)
My prompt is "{transcript} Please summarize the above in bullet points"
The trick was splitting it up into overlapping chunks so it fits in the context size. (And then summarizing your summary because it ends up too long cause you had so many chunks!)
These days that's not so important, usually you can shove an entire book in! (Unless you're using a local model, which still have small context sizes, work pretty well for summarization.)
- HPsquared 2y agoIf you're going as far as using yt-dlp, why not run the audio through Whisper?
- andai 2y agoInteresting, I haven't used Whisper, is it cost effective? Seems to be about 36 cents per (hour long) video? How long does processing take?
- kajecounterhack 2y agoYou can run it locally, and it's really fast. But since YouTube transcription is really good, I don't see why you'd use Whisper and get a worse transcription (unless maybe it's on videos that Google did not transcribe for whatever reason).
- gs17 2y ago> But since YouTube transcription is really good Are you sure you're looking at automatic transcripts? YouTube transcripts are bizarrely low quality if they're not provided by the creators (I've actually used my Google Pixel's live transcription to make better captions occasionally). I just checked a video my girlfriend uploaded a week ago and the auto-transcript was still pretty messy. I've used Whisper for the same task and it's significantly better.
- ofou 2y agoAgreed. However, you can get great YT transcriptions using GPT-4o mini to clean them up.
- jokethrowaway 2y agoThat's crazy, months ago I compared whisper v2 transcripts with YouTube transcripts generated on my video and found them to be identical, down to the timestamps. I know people who upload a video on YouTube unlisted just to get transcripts generation for free and then delete the video.
- HPsquared 2y ago36 cents an hour is how much it costs to hire an entire GPU like an A4000. I can assure you Whisper runs much, much faster than 1x!
- jokethrowaway 2y agoA few derivative projects are faster than 1x, insanely-fast-whisper being the fastest I've tried. whisper v3 large on release day was around 1x on a 4090
- davidzweig 2y agoThe security against downloading audio from YouTube has been upped recently with 'PO tokens'. Whisper is only a few tenths of a cent per hour transcribed if transcribing on your gpu though, at about 30x real-time on a 3080 etc. with batching.
- swyx 2y ago> The security against downloading audio from YouTube has been upped recently with 'PO tokens'. do you have a source? more generally is there a community or news source for youtube "api" news like this?
- davidzweig 2y agoI haven't been following closely the last few weeks, but you can check the issues in this repo, for example: https://github.com/distubejs/ytdl-core https://github.com/distubejs/ytdl-core
- HPsquared 2y agoTbh I've not had trouble with this for personal use.
- potatoman22 2y agoSame! It's been a nifty little tool for helping me decide which videos are worth watching. https://github.com/davidhaas6/digest https://github.com/davidhaas6/digest
- shekhargulati 2y agoI also built something similar using yt-dlp and llm CLI and wrote a post about it https://shekhargulati.com/2024/07/30/building-a-youtube-video-summarizer-with-llm-and-yt-dlp/ https://shekhargulati.com/2024/07/30/building-a-youtube-vide.... Script here https://github.com/shekhargulati/llm-tools/blob/main/yt-summarizer.sh https://github.com/shekhargulati/llm-tools/blob/main/yt-summ...