[FFmpeg-devel] [PATCH] http: Tell translate.google.com that we are firefox
Michael Niedermayer
michaelni at gmx.at
Wed Apr 3 00:59:38 CEST 2013
Fixes Ticket2265
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
---
libavformat/http.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/libavformat/http.c b/libavformat/http.c
index 1e3cff7..d048688 100644
--- a/libavformat/http.c
+++ b/libavformat/http.c
@@ -537,6 +537,10 @@ static int http_connect(URLContext *h, const char *path, const char *local_path,
proxyauthstr = ff_http_auth_create_response(&s->proxy_auth_state, proxyauth,
local_path, method);
+ //needed by: "http://translate.google.com/translate_tts?tl=fr&q=l%E8vres"
+ if(!strcmp("translate.google.com", hoststr) && !s->user_agent)
+ s->user_agent = av_strdup("Mozilla/5.0 (X11; Ubuntu; Linux i686; rv:15.0) Gecko/20100101 Firefox/15.0.1");
+
/* set default headers if needed */
if (!has_header(s->headers, "\r\nUser-Agent: "))
len += av_strlcatf(headers + len, sizeof(headers) - len,
--
1.7.9.5
More information about the ffmpeg-devel
mailing list