Is there a way to play a video and make it follow YouTube autoplay videos?
Can this be done with youtube-dl
and/or mpv
?
autoplaympvyoutubeyoutube-dl
Is there a way to play a video and make it follow YouTube autoplay videos?
Can this be done with youtube-dl
and/or mpv
?
Best Answer
simplified approach
you could use a small script:
save this as
autoplay.pl
, callchmod 755 autoplay.pl
, and then try e.g../autoplay.pl 5YTxsc3Cz24
or, directly in your shell:
you can end the playing by pressing ctrl+c (two times, one for mpv, one for the script).
avoid recurring IDs
the above code is a basic example and does not avoid any loops. if you want to avoid playing videos with the same ID twice, this can be achieved by adding a bucket:
this code searches the current youtube page for all IDs and skips those IDs already played. it ends, if no unplayed ID is found at the current page.
avoid recurring IDs harder
however, in some rare(?) cases you might have played all IDs of the current youtube page already. then the script should look up the pages of already seen IDs: