[vlc-commits] youtube.lua: improve interoperability when calling API

Pierre Ynard git at videolan.org
Mon Oct 24 08:19:49 CEST 2016


vlc | branch: master | Pierre Ynard <linkfanel at yahoo.fr> | Mon Oct 24 08:10:26 2016 +0200| [503e8753f0ff894dae5a037b83f4a34067a884a4] | committer: Pierre Ynard

youtube.lua: improve interoperability when calling API

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

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

diff --git a/share/lua/playlist/youtube.lua b/share/lua/playlist/youtube.lua
index 7ecf3d1..a510729 100644
--- a/share/lua/playlist/youtube.lua
+++ b/share/lua/playlist/youtube.lua
@@ -315,10 +315,11 @@ function parse()
         if not path then
             local video_id = get_url_param( vlc.path, "v" )
             if video_id then
-                -- Without "el=detailpage", /get_video_info fails for many
-                -- music videos with errors about copyrighted content being
-                -- "restricted from playback on certain sites"
-                path = vlc.access.."://www.youtube.com/get_video_info?video_id="..video_id.."&el=detailpage"..copy_url_param( vlc.path, "fmt" )
+                -- Passing no "el" parameter to /get_video_info seems to
+                -- let it default to "embedded", and both known values
+                -- of "embedded" and "detailpage" are wrong and fail for
+                -- various restricted videos, so we pass a different value
+                path = vlc.access.."://www.youtube.com/get_video_info?video_id="..video_id.."&el=detail"..copy_url_param( vlc.path, "fmt" )
                 vlc.msg.warn( "Couldn't extract video URL, falling back to alternate youtube API" )
             end
         end



More information about the vlc-commits mailing list