#!/bin/sh
# Get the suffix from a Youtube video, or Invidious instance. 
# https://youtube.com/watch?v=dQw4w9WgXcQ -> dQw4w9WgXcQ
# Pass the -w flag if you want to keep the watch?v=
# Usage:
# yt-suffix PATH (-w)

if isflag '-w' "$@" ; then 
	echo "watch?v="
fi

echo $1 | awk -F'/' '{print $4}' | awk -F'=' '{print $2}'