vlc/vlc-3.0 | branch: master | Ludovic Fauvet <e...@videolan.org> | Fri Feb  2 
15:22:24 2018 +0100| [4212130f8bc874330faef684702f07116e1f6a16] | committer: 
Jean-Baptiste Kempf

youtube.lua: support gaming.youtube.com

The page content of gaming.y.o is different, yet the main website plays
video from gaming.y.o the same way, therefore a simple redirect do the
trick.

(cherry picked from commit b9bb5396c84f81f8c5b46dbc03a92cebe8d9d60d)
Signed-off-by: Jean-Baptiste Kempf <j...@videolan.org>

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

 share/lua/playlist/youtube.lua | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/share/lua/playlist/youtube.lua b/share/lua/playlist/youtube.lua
index fc9a68c483..a7eeeb375d 100644
--- a/share/lua/playlist/youtube.lua
+++ b/share/lua/playlist/youtube.lua
@@ -227,8 +227,10 @@ end
 -- Probe function.
 function probe()
     return ( ( vlc.access == "http" or vlc.access == "https" )
-             and string.match( vlc.path, "^www%.youtube%.com/" )
              and (
+               string.match( vlc.path, "^www%.youtube%.com/" )
+            or string.match( vlc.path, "^gaming%.youtube%.com/" )
+             ) and (
                string.match( vlc.path, "/watch%?" ) -- the html page
             or string.match( vlc.path, "/live$" ) -- user live stream html page
             or string.match( vlc.path, "/live%?" ) -- user live stream html 
page
@@ -240,6 +242,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%?" )
         or string.match( vlc.path, "/live$" )
         or string.match( vlc.path, "/live%?" )

_______________________________________________
vlc-commits mailing list
vlc-commits@videolan.org
https://mailman.videolan.org/listinfo/vlc-commits

Reply via email to