YouSum on the Command line - a CLI function for summarising long YouTube videos to get right to the point!

YouSum on the Command line - a CLI function for summarising long YouTube videos to get right to the point!

Table of Contents

But Wait - it’s on the command line

After the debacle of not being able to host my YouSum program, I’ve gotten back in the habit of just running it locally on the command line. I mentioned the llm utility in a prior post as well… and you should make sure to export your OpenAI API key before making this happen

but here you go!

yousum() {
  if [ -z "$1" ]; then
    echo "Usage: yousum <YouTube URL>"
    return 1
  fi

  # Extract the video ID using macOS-compatible regex in sed
  local video_id=$(echo "$1" | sed -E 's/.*v=([a-zA-Z0-9_-]+).*/\1/')

  if [ -z "$video_id" ]; then
    echo "Invalid YouTube URL. Please provide a valid one."
    return 1
  fi

  # Run the command
  youtube_transcript_api "$video_id" | llm -s "You are an information extraction service. Perform the following:\
                STEP 0: Provide a SUMMARY of the content in 100 words or less.\
                STEP 1: Extract the 5-10 most interesting FACTS"
}

usage example:

yousum https://www.youtube.com/watch?v=CO-6iqCum1w

Related Posts

SlackZen - just leave (tm) - and the noise of the modern office

SlackZen - just leave (tm) - and the noise of the modern office

TLDR: Check out the code on GitHub . It even worked at one point in time!

Read More
Provocative Post about Planning Products!

Provocative Post about Planning Products!

Some provocative recommendations in this post: The size of your backlog is inversely proportional to your product’s success While I think you ought to be synthesizing more than this suggests, the overplanning and under-reliance on what your customers actually do with your software is a massive fail.

Read More
Building a Cajun Accordion I can live with... [brief edition]

Building a Cajun Accordion I can live with... [brief edition]

The chronicles some of the work I’ve done to produce an electronic / computer-mediated cajun accordion instrument that isnt $$$ and explores some of the user experience (UX) possibilities - including that the squeezebox’s physical limitations are actually a gift for the musician!

Read More

Get new posts via email

Intuit Mailchimp

Copyright 2024-infinity, Paul Pereyda Karayan. Design by Zeon Studio