Join GitHub today
strip ytdl:// from direct links in ytdl_hook.lua #5003
When youtube-dl returns a playlist of links that are not youtube videos, all links in the playlist file are prepended with ytdl:// by ytdl_hook.lua
When each of these links is passed off individually to ytdl_hook.lua during on_load and a direct link is detected, the ytdl:// is not appropriately stripped off, which results in a link beginning with 'ytdl://http://', ending in an unsupported protocol error back on the player side for each item in the playlist.
One example of this issue in action is
To resolve this, if a direct link is detected, save it back to the player after the ytdl:// has been stripped off.
I agree that my changes can be relicensed to LGPL 2.1 or later.
After further investigation I have confirmed this but have found a better example, which has been edited in to the original comment.
There is some question in my mind as to whether it would be better to just save back the url, or to call the full blown add_single_video(), but I have gone with the former since it seems this is supposed to be a minimal case. The down side of this decision is that the requested http headers won't be set.