UntrackMe, doesn’t open an app, but redirects to a chosen Invidious instance. I use farside.link/invidious which chooses a random instance closer to you.
There is a similar thing already written, minus the automatic part. You set it as your default browser and lets you do all sorts of things to the link before opening it in a browser. It lets you choose which app to use the link in afterwards. You can unshort urls, it checks for malware or redirects… You get the picture. Not sure if this helps with what you are after:
I wonder could someone write an app that watches the clipboard for YouTube URLs and auto launches the desired app?
You can uninstall YouTube and set newpipe as default “YouTube” app, all links will be open in that
UntrackMe, doesn’t open an app, but redirects to a chosen Invidious instance. I use farside.link/invidious which chooses a random instance closer to you.
There is a similar thing already written, minus the automatic part. You set it as your default browser and lets you do all sorts of things to the link before opening it in a browser. It lets you choose which app to use the link in afterwards. You can unshort urls, it checks for malware or redirects… You get the picture. Not sure if this helps with what you are after:
https://f-droid.org/packages/com.trianguloy.urlchecker/