[vlc-commits] youtube.lua: improve interoperability when calling API
Pierre Ynard
git at videolan.org
Mon Dec 5 07:23:30 CET 2016
vlc/vlc-2.2 | branch: master | Pierre Ynard <linkfanel at yahoo.fr> | Mon Oct 24 08:10:26 2016 +0200| [71987e3092b600a2e1189bbdf046f82e8afd292c] | committer: Pierre Ynard
youtube.lua: improve interoperability when calling API
(cherry picked from commit 503e8753f0ff894dae5a037b83f4a34067a884a4)
Signed-off-by: Pierre Ynard <linkfanel at yahoo.fr>
> http://git.videolan.org/gitweb.cgi/vlc/vlc-2.2.git/?a=commit;h=71987e3092b600a2e1189bbdf046f82e8afd292c
---
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 fb87931..afbc344 100644
--- a/share/lua/playlist/youtube.lua
+++ b/share/lua/playlist/youtube.lua
@@ -324,10 +324,11 @@ function parse()
else
format = ""
end
- -- 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..format.."&el=detailpage"
+ -- 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..format.."&el=detail"
vlc.msg.warn( "Couldn't extract video URL, falling back to alternate youtube API" )
end
end
More information about the vlc-commits
mailing list