occivink / mpv-gallery-view

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

Fix prefetching from http/https sources #7

Closed WisdomCode closed 5 years ago

WisdomCode commented 6 years ago

Files from the web (https/http) had no thumbs in the gallery, as the workdirectory was prepended to the url. By checking whether the image link is a weblink, this can be restricted to local files only (if this exists, maybe also look for ftp:// etc.). I am not fluent in LUA (this is basically my first code in that language), so feel free to refactor to your liking.

occivink commented 6 years ago

I think you could change the check to simply search for :// in the "filename" and consider the path remote if it's found, it's not bulletproof but should be enough. You should also move the path normalization part (all the gsub) to the non-remote branch.

As you might have noticed, this will only work for static content and not for any websites that rely on youtube-dl