[axel-users] is it possible to set http header and user-agent in .axelrc file?

Philipp Hagemeister phihag at phihag.de
Mon Dec 1 17:09:42 UTC 2008


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

Hi Ye,

I see you are using the trunk version anyway. I did a little bit of
digging, and the problem is that f.youku.com blocks the following
requests with a 403:

* No user-agent or wget or axel in the user-agent. No need for a long
UA, -U MSIE will do and is unlikely to be ever blocked.
* ANY Range header, even if we request the full file. This is extremely
bad practice and prevents multiple parallel downloads. As I found out
too late (after commiting), removing this header will break parallel
downloading in axel. I opened a bug report[1] for this. However, because
this is probably even a deliberate server malfunction and could break
other stuff, this needs further consideration. I will make sure to test
that version 3.0 does not send this header.

The other headers have no effect on the reply.

Regards,

Philipp


[1]
https://alioth.debian.org/tracker/index.php?func=detail&aid=311284&group_id=100070&atid=413085



Ye Xu wrote:
> thanks for your reply, and no need to say sorry, because the dev team
> already done a fantastic job on axel. I am quite enjoy to use it as my
> default cli downloader. esp in some aspect, it even outperform wget :D
> 
> back to the topic:
> 
> for the time point I wrote this thread, i was already using the latest
> version out of svn - r64.
> 
>> seen at seen-desktop $
>> axel -V
>> Axel version 2.99.0 (Linux)
>> Copyright 2001-2002 Wilmer van der Gaast.
> 
> so, that means after a fix commited in svn, I can use the same
> parameters like wget in .axelrc? or use the alias I had mentioned
> above?
> 
> 
> On Mon, Dec 1, 2008 at 16:23, Philipp Hagemeister <phihag at phihag.de> wrote:
> Ye,
> 
> looks like it's our mistake: The code for user-agent slipped out of the
> release. Sorry for that. We'll release an updated version shortly. In
> the meantime, you can use a development version by typing the following
> commands:
> 
> svn co svn://svn.debian.org/svn/ axel-trunk
> cd axel-trunk
> ./configure
> make
> 
> 
> After that, the axel executable can be found in the current directory.
> Type  make install  as root or  sudo make install  to install it. Most
> likely, it will be easier to wait for your distribution to push the
> changes. Again, sorry for that mistake.
> 
> Regards,
> 
> Philipp Hagemeister
> 
> 
> 
> 
> Ye Xu wrote:
>>>> Hello Everyone,
>>>>
>>>> Just curious how can I set multiple http headers or user-agent inside
>>>> .axelrc file just like .wgetrc did like the following.
>>>>
>>>> $less .wgetrc
>>>> header = Accept-Language: en-us,en;q=0.5
>>>> header = Accept:
>>>> text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
>>>> header = Accept-Encoding: gzip,deflate
>>>> header = Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
>>>> header = Keep-Alive: 300
>>>> user_agent = Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US;
>>>> rv:1.8.1.6) Gecko/20070725 Firefox/2.0.0.6
>>>> referer = http://www.google.com
>>>>
>>>> and I also tried to apply the same thing using an alias, but it won't work.
>>>>
>>>> alias axel2='axel --user-agent="Mozilla/5.0 (Windows; U; Windows NT
>>>> 5.1; en-US; rv:1.8.1.6) Gecko/20070725 Firefox/2.0.0.6"
>>>> --header="Accept:text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
>>>> Accept-Language: en-us,en;q=0.5 Accept-Encoding: gzip,deflate
>>>> Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7 Keep-Alive: 300"'
>>>>
>>>> or
>>>>
>>>> alias axel2='axel --user-agent="Mozilla/5.0 (Windows; U; Windows NT
>>>> 5.1; en-US; rv:1.8.1.6) Gecko/20070725 Firefox/2.0.0.6"
>>>> --header="Accept:text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5"
>>>> --header="Accept-Language: en-us,en;q=0.5" --header="Accept-Encoding:
>>>> gzip,deflate" --header="Accept-Charset:
>>>> ISO-8859-1,utf-8;q=0.7,*;q=0.7" --header="Keep-Alive: 300"'
>>>>
>>>> the test link is the following.
>>>>
>>>> http://f.youku.com/player/getFlvPath/sid/12281352837007018629_00/st/flv/fileid/020001070047CA21B541F9007D4392FE9E6FA5-6C90-5B04-1D92-C2FEB95942CB?K=68eeac87640cdc2f161a070f
>>>>
>>>> with wget (with header, user-agent setting above) works, with axel
>>>> show a http 403 error.
>>>>
>>>> thx
>>>>
>>>> Ye
>>>>
>>>> _______________________________________________
>>>> axel-users mailing list
>>>> axel-users at lists.alioth.debian.org
>>>> http://lists.alioth.debian.org/mailman/listinfo/axel-users
>>>>
> 
>>

> _______________________________________________
> axel-users mailing list
> axel-users at lists.alioth.debian.org
> http://lists.alioth.debian.org/mailman/listinfo/axel-users



- --
Philipp Hagemeister

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.9 (GNU/Linux)

iEYEAREKAAYFAkk0GlEACgkQ9eq1gvr7CFx4tgCfS3rSChNESD8JuR8kcmgZQV8H
kgcAnRQoW2f8RJzDSNAdPTB1MP0vahkb
=CFlY
-----END PGP SIGNATURE-----



More information about the axel-users mailing list