You can loop a YouTube video or a selected portion within the VLC media player. However, for this, you need to have the specific video downloaded on your Mac.  There are several online Youtube video downloaders like ssyoutube.com, head over to the website and copy-paste the YouTube video link you want to loop and download it.  Once the video has been downloaded, play the video using a VLC media player. From the top menu bar, click View and select Advanced controls from the drop-down list. Now, a list of advanced controls will show up under the video.  Click on the A-B loop button, drag the slider to where you want to start the loop, and hit the loop button. Now, set the endpoint using the same slider and play the video.