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
  • Ephera@lemmy.ml
    link
    fedilink
    English
    arrow-up
    3
    ·
    edit-2
    5 hours ago

    One thing that will become important pretty quick if you continue making these scripts is that it’s almost always better to wrap your variables in quotes - so it becomes yt-dlp -x “$a.

    Oh man, this reminds me of the joke that any program that’s more complex than Hello World has bugs – and folks still don’t even agree how to spell “Hello, World!”.

    Of course, Bash is a particular minefield in this regard…

    • 18107@aussie.zone
      link
      fedilink
      English
      arrow-up
      5
      ·
      4 hours ago

      I once wrote a 2 line, 10 word script that had 9 bugs in it. I’m not overly proud of that one.