Thann / play-with-mpv

Chrome extension that allows you to play videos in webpages like youtube with MPV instead
https://chrome.google.com/webstore/detail/play-with-mpv/hahklcmnfgffdlchjigehabfbiigleji
The Unlicense
351 stars 81 forks source link

Play only works after "activating" video #7

Closed orschiro closed 6 years ago

orschiro commented 6 years ago

This page has a video.

I tried playing it from the context menu but it would not open it until I start the playback and then retry the context menu. Can you confirm?

screenshot from 2018-02-07 10-37-20

Thann commented 6 years ago

youtube-dl is responsible for taking the URL and extracting the video stream from it.

Before "activation" what you're clicking on is just some random div, so it sends the url of the "page" to mpv which fails to extract a video stream.

After "activation", you're clicking on a <video> tag and the extension sends the url of the video stream to MPV which doesn't need youtube-dl to do anything so it just plays the video.

The only "solution" for this would be to contribute to youtube-dl an "extractor" for this page that will get the video stream URL without having to click anything. And you may discover that ytdl can't extract it because it requires JS or something.

The best way to debug things like this is run play-with-mpv from the terminal to see the exact URL that is getting sent to MPV. =]

orschiro commented 6 years ago

The only "solution" for this would be to contribute to youtube-dl an "extractor" for this page that will get the video stream URL without having to click anything. And you may discover that ytdl can't extract it because it requires JS or something.

Thanks! Going to consider reaching out to the youtube-dl guys about this. :-)