From 3d37be4f70d386e9751ec41309f82475ffae0ad8 Mon Sep 17 00:00:00 2001 From: =?utf8?q?R=C3=A9mi=20Denis-Courmont?= Date: Sat, 29 May 2010 19:03:23 +0300 Subject: [PATCH] HTTP: add LibVLC version to User-Agent correctly --- modules/access/http.c | 3 ++- share/lua/playlist/appletrailers.lua | 2 +- share/lua/sd/appletrailers.lua | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/modules/access/http.c b/modules/access/http.c index 747eba0675..9435504791 100644 --- a/modules/access/http.c +++ b/modules/access/http.c @@ -1286,7 +1286,8 @@ static int Request( access_t *p_access, uint64_t i_tell ) } } /* 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 ); /* Offset */ if( p_sys->i_version == 1 && ! p_sys->b_continuous ) diff --git a/share/lua/playlist/appletrailers.lua b/share/lua/playlist/appletrailers.lua index 3e2688dab2..dd1a5f1246 100644 --- a/share/lua/playlist/appletrailers.lua +++ b/share/lua/playlist/appletrailers.lua @@ -53,7 +53,7 @@ function parse() else extraname = "" 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 if string.match( line, "" ) then diff --git a/share/lua/sd/appletrailers.lua b/share/lua/sd/appletrailers.lua index 92beddab99..93d3effdf8 100644 --- a/share/lua/sd/appletrailers.lua +++ b/share/lua/sd/appletrailers.lua @@ -32,7 +32,7 @@ end function main() fd = vlc.stream( "http://trailers.apple.com/trailers/home/feeds/just_hd.json" ) 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() while line ~= nil do -- 2.39.2