Skip Navigation

InitialsDiceBearhttps://github.com/dicebear/dicebearhttps://creativecommons.org/publicdomain/zero/1.0/„Initials” (https://github.com/dicebear/dicebear) by „DiceBear”, licensed under „CC0 1.0” (https://creativecommons.org/publicdomain/zero/1.0/)F
Posts
0
Comments
6
Joined
3 yr. ago

  • Depending on how accurate you’re remembering, could be Johnny Mnemonic.

  • I do something very similar. Thanks for sharing cause there's always something to learn by seeing how someone else solved a problem. I'll share mine here too if that's cool:

     sh
        
    #!/usr/bin/env bash
    
    music() {
      case $(uname -s) in
        Darwin)
          yt-dlp --format bestaudio --extract-audio --audio-format mp3 \
            --postprocessor-args "-strict experimental" "$1" ;;
        Linux)
          yt-dlp --format bestaudio --extract-audio --audio-format mp3 "$1" ;;
      esac
    }
    
    video() {
      yt-dlp \
        --format "bestvideo+bestaudio[ext=m4a]/bestvideo+bestaudio/best" \
        --merge-output-format mp4 \
        -o "%(title)s.%(ext)s" "$1"
    }
    
    while getopts ':hm:v:' flag; do
      case "$flag" in
        h) echo "Usage: youtube [-m(usic) <url> | -v(ideo) <url>]" ; exit 0 ;;
        m) music "$OPTARG" ;;
        v) video "$OPTARG" ;;
        *) echo "Invalid argument." >&2 ; exit 1 ;;
      esac
    done
    
      
  • Seriously, what a PITA it would be to do this every 6 months (assuming you don’t use a LTS). I looked at this script and just decided to go with Debian.

  • “We have pride flag at home”

    I love this so much.