How To Find URL of YouTube Video File?

I’m messing around with the AVProVideo plugin for Unity and would like to play a youtube video through it. I can give it a url to a video file and it will play it. I tried giving it a link to a youtube video, but that didn’t work. The link is a url to the youtube player, not the video file. There are obviously websites that download mp4s based on the youtube url you give it. I right clicked on the download button and grabbed its url, which linked me to the file. Plugging that into the video player works fine, but I want this to be automated. How do those websites find the video file? If I can figure out what they do, I think I can automate the process of turning youtube links into file urls.

This is against Youtube’s terms of service. See section 5.1: Terms of Service

At least using those youtube player plugins from asset store works,
can get video url and pass to Easy Movie Texture plugin to play it…

(didnt check the sources how they do it, but pretty sure youtube has api for that…)

Gotcha, thanks