Commit 3d37be4f authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

HTTP: add LibVLC version to User-Agent correctly

parent c10f4954
...@@ -1286,7 +1286,8 @@ static int Request( access_t *p_access, uint64_t i_tell ) ...@@ -1286,7 +1286,8 @@ static int Request( access_t *p_access, uint64_t i_tell )
} }
} }
/* User Agent */ /* User Agent */
net_Printf( p_access, p_sys->fd, pvs, "User-Agent: %s\r\n", net_Printf( p_access, p_sys->fd, pvs,
"User-Agent: %s LibVLC/"VERSION"\r\n",
p_sys->psz_user_agent ); p_sys->psz_user_agent );
/* Offset */ /* Offset */
if( p_sys->i_version == 1 && ! p_sys->b_continuous ) if( p_sys->i_version == 1 && ! p_sys->b_continuous )
......
...@@ -53,7 +53,7 @@ function parse() ...@@ -53,7 +53,7 @@ function parse()
else else
extraname = "" extraname = ""
end end
table.insert( p, { path = path; name = title..extraname; description = description; url = vlc.path; options = ":http-user-agent=\"QuickTime vlc lua edition\"" } ) table.insert( p, { path = path; name = title..extraname; description = description; url = vlc.path; options = ":http-user-agent=\"QuickTime\"" } )
end end
if string.match( line, "<title>" ) if string.match( line, "<title>" )
then then
......
...@@ -32,7 +32,7 @@ end ...@@ -32,7 +32,7 @@ end
function main() function main()
fd = vlc.stream( "http://trailers.apple.com/trailers/home/feeds/just_hd.json" ) fd = vlc.stream( "http://trailers.apple.com/trailers/home/feeds/just_hd.json" )
if not fd then return nil end if not fd then return nil end
options = {":http-user-agent=QuickTime/7.2 vlc edition",":demux=avformat,ffmpeg",":play-and-pause"} options = {":http-user-agent=QuickTime/7.2",":demux=avformat,ffmpeg",":play-and-pause"}
line = fd:readline() line = fd:readline()
while line ~= nil while line ~= nil
do do
......
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