Looping videos from YouTube

(And from lots of other places, see youtube-dl --list-extractors for a list.)

# Download a video
$ youtube-dl https://www.youtube.com/watch?v=aZvDe3box70

# Loop the video
$ mpv --no-video --loop=inf --end 3:47 'Shaban - Ungleichung-aZvDe3box70.mkv'

Note the --loop=inf parameter. And --end <timestamp> is also very helpful.

Also, don’t forget that mpv can play any video that’s downloadable by youtube-dl directly! (But we can’t use that for looping, because then it would download the file repeatedly.)