made it so i just click file and paste YouTube url

Linux is amazing

#! /usr/bin/bash
echo "Enter a url"
read a

yt-dlp -x $a
  • katy ✨@piefed.blahaj.zone
    link
    fedilink
    English
    arrow-up
    4
    ·
    24 hours ago

    this isn’t perfect but i made one when i wanted to fetch a video for a specific resolution (because i prefer 480)

    ytgrab() {  
      local id="$1"  
      local res="${2:-480}" # default to 480  
      local url="https://www.youtube.com/watch?v=$id"  
    
      # fetch formats  
      local fmt  
      fmt=$(yt-dlp -F --cookies-from-browser vivaldi "$url")  
    
      # printing the format output  
      echo "$fmt"  
    
      # pick video format matching the requested resolution  
      local vfmt  
      vfmt=$(echo "$fmt" | awk -v r="${res}p" '$0 ~ r && /video/ {print $1}' | head -n1)  
    
      # pick best m4a audio  
      local afmt  
      afmt=$(echo "$fmt" | awk '/m4a/ && /audio/ {print $1}' | head -n1)  
    
      # safety check  
      if [ -z "$vfmt" ] || [ -z "$afmt" ]; then  
        echo "Could not find matching formats (video ${res}p or m4a audio)."  
        return 1  
      fi  
    
      echo fetching: yt-dlp -f ${vfmt}+${afmt} --cookies-from-browser vivaldi --write-subs --no-write-auto-subs --sub-lang "en.*" $url  
      yt-dlp -f "${vfmt}+${afmt}" --write-subs --cookies-from-browser vivaldi --no-write-auto-subs --sub-lang "en.*" "$url"  
    }  
    
      • katy ✨@piefed.blahaj.zone
        link
        fedilink
        English
        arrow-up
        1
        ·
        16 hours ago

        usually i just like older videos but in this case i was saving a bunch of wcw vault videos to my jellyfin library and i prefer 480 since it was as close to tv as can be (also i’ve never been a fan of hd and tv after 2000 because i felt that’s when it went downhill)