Commit f568fd43 authored by Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf

Youtube: improve description parsing

Close #13973
parent a8ef884e
...@@ -235,23 +235,21 @@ function parse() ...@@ -235,23 +235,21 @@ function parse()
name = vlc.strings.resolve_xml_special_chars( name ) name = vlc.strings.resolve_xml_special_chars( name )
name = vlc.strings.resolve_xml_special_chars( name ) name = vlc.strings.resolve_xml_special_chars( name )
end end
if string.match( line, "<meta name=\"description\"" ) then
-- Don't ask me why they double encode ... if string.match( line, "<p id=\"eow[-]description\" >" ) then
_,_,description = string.find( line, "content=\"(.-)\"" ) _,_,description = string.find( line, "<p id=\"eow[-]description\" >(.-)<[/]p>" )
description = vlc.strings.resolve_xml_special_chars( description )
description = vlc.strings.resolve_xml_special_chars( description ) description = vlc.strings.resolve_xml_special_chars( description )
end end
if string.match( line, "<meta property=\"og:image\"" ) then if string.match( line, "<meta property=\"og:image\"" ) then
_,_,arturl = string.find( line, "content=\"(.-)\"" ) _,_,arturl = string.find( line, "content=\"(.-)\"" )
end end
-- This is not available in the video parameters (whereas it
-- is given by the get_video_info API as the "author" field) if string.match(line, "\"author\":\"(.-)\",") then
if not artist then _,_,artist = string.find(line, "\"author\":\"(.-)\",")
artist = string.match( line, "yt%-uix%-sessionlink yt%-user%-name[^>]*>([^<]*)</" )
if artist then
artist = vlc.strings.resolve_xml_special_chars( artist )
end
end end
-- JSON parameters, also formerly known as "swfConfig", -- JSON parameters, also formerly known as "swfConfig",
-- "SWF_ARGS", "swfArgs", "PLAYER_CONFIG", "playerConfig" ... -- "SWF_ARGS", "swfArgs", "PLAYER_CONFIG", "playerConfig" ...
if string.match( line, "ytplayer%.config" ) then if string.match( line, "ytplayer%.config" ) then
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment