[vlc-commits] youtube.lua: add comments
Pierre Ynard
git at videolan.org
Fri Sep 28 04:31:03 CEST 2012
vlc/vlc-2.0 | branch: master | Pierre Ynard <linkfanel at yahoo.fr> | Tue Sep 18 01:13:28 2012 +0200| [b228a86f9635bedad324a17a8b02b5a7061e8d46] | committer: Pierre Ynard
youtube.lua: add comments
(cherry picked from commit 43db5ce6cde15260be0c3fb98964f86aa6b64595)
Signed-off-by: Pierre Ynard <linkfanel at yahoo.fr>
> http://git.videolan.org/gitweb.cgi/vlc/vlc-2.0.git/?a=commit;h=b228a86f9635bedad324a17a8b02b5a7061e8d46
---
share/lua/playlist/youtube.lua | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/share/lua/playlist/youtube.lua b/share/lua/playlist/youtube.lua
index 13018ba..3562b82 100644
--- a/share/lua/playlist/youtube.lua
+++ b/share/lua/playlist/youtube.lua
@@ -47,6 +47,7 @@ function get_prefres()
return prefres
end
+-- Pick the most suited format available
function get_fmt( fmt_list )
local prefres = get_prefres()
if prefres < 0 then
@@ -66,6 +67,7 @@ function get_fmt( fmt_list )
return fmt
end
+-- Parse and pick our video URL
function pick_url( url_map, fmt )
local path = nil
-- Handle both orderings, as unfortunately both may appear
@@ -173,6 +175,9 @@ 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 = "http://www.youtube.com/get_video_info?video_id="..video_id..format.."&el=detailpage"
end
@@ -187,7 +192,7 @@ function parse()
return { { path = path; name = name; description = description; artist = artist; arturl = arturl } }
- elseif string.match( vlc.path, "/get_video_info%?" ) then
+ elseif string.match( vlc.path, "/get_video_info%?" ) then -- video info API
local line = vlc.readline() -- data is on one line only
local fmt = get_url_param( vlc.path, "fmt" )
More information about the vlc-commits
mailing list