It simply uses youtube api to search a random query string and shows the first result. It can also show zero viewed video. For this purpose it uses Petittube.
It offers API endpoint for random or zero viewed video.
create a get request to this endpoint and you will get a random youtube video data.
https://randtube.vercel.app/api/random
create a get request to this endpoint and you will get a Zero Viewed youtube video data.
https://randtube.vercel.app/api/zeroviewed
to stream the video you can use ifream with a src like this:
<iframe width="630"
height="473"
src="https://www.youtube.com/embed/[VIDEO_ID_HERE]?autoplay=1" frameborder="0"
allowfullscreen></iframe>