occivink / mpv-gallery-view

Gallery-view scripts for mpv
The Unlicense
189 stars 20 forks source link

Use real youtube thumbnails from youtube-dl #8

Closed jgreco closed 5 years ago

jgreco commented 5 years ago

gallery-thumbgen.lua checks to see if the input_path starts with https?://. If so, it uses youtube-dl to attempt to resolve a url to a thumbnail (i.e. the thumbnail used on the website.) This works for any site for which youtube-dl can find thumbnails.

In the special case of a link to youtube proper, youtube-dl is not used because it's slow. Instead the URL is parsed to pull out the video ID and a URL to the thumbnail for that particular ID is generated. This is much faster than waiting for youtube-dl, but perhaps more brittle.

If any of the above fails, then the original input_path is returned and thumbnailing proceeds as usual.

screen shot 2018-12-07 at 4 31 58 pm

jgreco commented 5 years ago

Fixed the pattern matching code, fixed finding youtube-dl on windows.

Also added ytdl blacklist code and an optional gallery_worker.conf to go with it. (Personally I think this feature is superfluous, but ytdl_hook has it so maybe somebody somewhere has a good use for it...)