Playing a Youtube video with mpv is very easy, it is also possible to skip to a certain part of the video whenever you wish.
Make sure that you have the latest version of Youtube-dl first.
sudo curl -L https://yt-dl.org/downloads/latest/youtube-dl -o /usr/bin/youtube-dl |
Then run this command, and it should work fine.
mpv --start=56:00 https://www.youtube.com/watch?v=ZE3kTCyqPik |
This starts playback at 00:56 minutes and works great. youtube-dl must be updated for this to work properly. Otherwise, you will get the error shown below.
.4 Thu May 23 jason@Yog-Sothoth 0: $ mpv --start=45:00 https://www.youtube.com/watch?v=ZE3kTCyqPik Playing: https://www.youtube.com/watch?v=ZE3kTCyqPik [ytdl_hook] ERROR: ZE3kTCyqPik: "token" parameter not in video info for unknown reason; please report this issue on https://yt-dl.org/bug . Make sure you are using the latest version; see https://yt-dl.org/update on how to update. Be sure to call youtube-dl with the --verbose flag and include its complete output. [ytdl_hook] youtube-dl failed, trying to play URL directly ... Failed to recognize file format. Exiting... (Errors when loading file) |
This is very useful for skipping ahead in a long video, it just requires a youtube-dl update to fix the playback issue. And then you are all set.