I run a flask app with an endpoint that takes a video URL and runs yt-dlp. I have a bookmarklet that submits the URL of the current video page I'm on to the web service.
Also when I'm in NewPipe on the phone I can go to a video and share the URL to an app that forwards it to the web service.
Also when I'm in NewPipe on the phone I can go to a video and share the URL to an app that forwards it to the web service.