Here's my attempt at solving the same kind of problem for just URIs, I try to defer to .mailcap for file based auto-opening.
Never had much luck with xdg-open
Never had much luck with xdg-open
Will definitely dig into it to either use it directly or at least try to implement it in mine see.sh.
Also IMHO you should add short 'youtu.be' regex handler :)
Regards.