[FFmpeg-devel] [PATCH] http: Tell translate.google.com that we are firefox
Michael Niedermayer
michaelni at gmx.at
Wed Apr 3 01:22:36 CEST 2013
On Wed, Apr 03, 2013 at 01:06:20AM +0200, Stefano Sabatini wrote:
> On date Wednesday 2013-04-03 00:59:38 +0200, Michael Niedermayer encoded:
> > 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");
> > +
>
> I'm strongly against this, especially since there is no explanation of
> why this happens,
dont ask me, i dont know why this happens
> and don't think that adding an hack for each website
> on the Internet having weird requirements is a good idea.
having code that "just works" is a good idea
burdening the maintainer isnt a good idea, but that leads to the
question who is / wants to be the maintainer of http.
If I have to maintain it then i prefer a few hundread special cases
for big sites over a non working http.c. The work dealing with
user bug reports likely exceeds the work maintaining such cases, at
least IMHO
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
I have often repented speaking, but never of holding my tongue.
-- Xenocrates
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20130403/3086ae99/attachment.asc>
More information about the ffmpeg-devel
mailing list