[vlc-commits] youtube.lua: make gaming.youtube.com subdomain support more generic

Pierre Ynard git at videolan.org
Thu Nov 12 07:28:19 CET 2020


vlc | branch: master | Pierre Ynard <linkfanel at yahoo.fr> | Thu Nov 12 05:42:59 2020 +0100| [77f19929db1bcbc0f3a73b6edfd8f63ffb6cc56e] | committer: Pierre Ynard

youtube.lua: make gaming.youtube.com subdomain support more generic

And mark it as out of use: gaming.youtube.com URLs now get redirected to
the main domain.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=77f19929db1bcbc0f3a73b6edfd8f63ffb6cc56e
---

 share/lua/playlist/youtube.lua | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/share/lua/playlist/youtube.lua b/share/lua/playlist/youtube.lua
index 08947a86b0..77c3ae42ae 100644
--- a/share/lua/playlist/youtube.lua
+++ b/share/lua/playlist/youtube.lua
@@ -306,7 +306,7 @@ function probe()
     return ( ( vlc.access == "http" or vlc.access == "https" )
              and (
                string.match( vlc.path, "^www%.youtube%.com/" )
-            or string.match( vlc.path, "^gaming%.youtube%.com/" )
+            or string.match( vlc.path, "^gaming%.youtube%.com/" ) -- out of use
              ) and (
                string.match( vlc.path, "/watch%?" ) -- the html page
             or string.match( vlc.path, "/live$" ) -- user live stream html page
@@ -319,11 +319,10 @@ end
 
 -- Parse function.
 function parse()
-    if string.match( vlc.path, "^gaming%.youtube%.com/" ) then
-        url = string.gsub( vlc.path, "^gaming%.youtube%.com", "www.youtube.com" )
-        return { { path = vlc.access.."://"..url } }
-    end
-    if string.match( vlc.path, "/watch%?" )
+    if not string.match( vlc.path, "^www%.youtube%.com/" ) then
+        -- Skin subdomain
+        return { { path = vlc.access.."://"..string.gsub( vlc.path, "^([^/]*)/", "www.youtube.com/" ) } }
+    elseif string.match( vlc.path, "/watch%?" )
         or string.match( vlc.path, "/live$" )
         or string.match( vlc.path, "/live%?" )
     then -- This is the HTML page's URL



More information about the vlc-commits mailing list