[vlc-commits] youtube.lua: update live stream support to website changes

Pierre Ynard git at videolan.org
Sat Jan 19 03:18:17 CET 2019


vlc/vlc-3.0 | branch: master | Pierre Ynard <linkfanel at yahoo.fr> | Sat Jan 19 03:07:38 2019 +0100| [59122257cd1ef52f7c646ba9b7bf0d9f1d932608] | committer: Pierre Ynard

youtube.lua: update live stream support to website changes

Instead of the previous "hlsvp" parameter, the URL can now be found in a
deeper "hlsManifestUrl" parameter.

Thanks to forum thread for analysis!

Fixes #21738

(cherry picked from commit c4bdca7aeca0afb2669b0b654d8df9eaafac28f4)
Signed-off-by: Pierre Ynard <linkfanel at yahoo.fr>

> http://git.videolan.org/gitweb.cgi/vlc/vlc-3.0.git/?a=commit;h=59122257cd1ef52f7c646ba9b7bf0d9f1d932608
---

 share/lua/playlist/youtube.lua | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/share/lua/playlist/youtube.lua b/share/lua/playlist/youtube.lua
index ab2a1ecaf4..c4da544803 100644
--- a/share/lua/playlist/youtube.lua
+++ b/share/lua/playlist/youtube.lua
@@ -316,7 +316,7 @@ function parse()
                 if not path then
                     -- If this is a live stream, the URL map will be empty
                     -- and we get the URL from this field instead
-                    local hlsvp = string.match( line, "\"hlsvp\": *\"(.-)\"" )
+                    local hlsvp = string.match( line, '\\"hlsManifestUrl\\": *\\"(.-)\\"' )
                     if hlsvp then
                         hlsvp = string.gsub( hlsvp, "\\/", "/" )
                         path = hlsvp
@@ -372,7 +372,7 @@ function parse()
         if not path then
             -- If this is a live stream, the URL map will be empty
             -- and we get the URL from this field instead
-            local hlsvp = string.match( line, "&hlsvp=([^&]*)" )
+            local hlsvp = string.match( line, "%%22hlsManifestUrl%%22%%3A%%22(.-)%%22" )
             if hlsvp then
                 hlsvp = vlc.strings.decode_uri( hlsvp )
                 path = hlsvp



More information about the vlc-commits mailing list