#!/bin/python3
# KuchiKuu
# 2022-08-30

import sys
import os

OPEN_IN_BROWSER = True # False/True
BROWSER_NAME="firefox"
INVIDIOUS_DOMAIN="TYPE DOMAIN HERE"

if (len(sys.argv) == 1):
        print(f"usage:\n\t{os.path.basename(sys.argv[0])} youtubelink")
else:
        link = sys.argv[1]
        link = link.replace("youtu.be",INVIDIOUS_DOMAIN)
        link = link.replace("youtube",INVIDIOUS_DOMAIN)
        link = link.replace(".com","")
        link = link.replace("www.","")
        if(OPEN_IN_BROWSER):
                os.system(f"{BROWSER_NAME} {link}")
        else:
                print(link)
exit()