Image 01
profile-image

ivanthechemist

test
Pornhub

VLC Playlist Parsers 35 comments

Score 75.8%
Oct 17 2019
Some videos don't have an HD version, even if that is listed in defaultQuality. Therefore, they don't have the link in the response. So at the moment the cycle plays the first available resolution, which is not the highest available. I tried to sort in different ways, but I somehow always ended up with a sort by first digit, not by number. If you know Lua I think it is trivial to fix so that the order is highest res video that has a link.
Also, this skips the download restrictions on FHD video, as it can be easily downloaded with VLC. - Sep 24 2019
There is a small issue with the script that I couldn't fix. The resolutions in the defaultQuality response are not ordered, but the cycle is taking the first available. This leads to videos playing by default in 480p. I don't have enough experience with Lua to fix the algorithm to work with a sorted whatever data structure, so I have replaced the following code:
local available_resolutions = string.match(line, "\"defaultQuality\":%[(.-)%]")
for resolution in string.gmatch(available_resolutions, "[^,]+") do
with
local hard_res = {1080,720,480,240}
for i, resolution in ipairs(hard_res) do

I have tested that it works with 1080p 60fps source. - Sep 23 2019