在wget中更改默认的USER-AGENT和REFERRER值 [英] Change the default USER-AGENT and REFERRER value in wget

查看:1315
本文介绍了在wget中更改默认的USER-AGENT和REFERRER值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在控制台上使用wget时,我通常要下载该版本,例如,Firefox可以得到.

When using wget on the console, I usually want to download the version, my Firefox would get, for ex.

 wget  --header="Accept: text/html" --user-agent="Mozilla/5.0 ..." --referrer connect.wso2.com http://dist.wso2.org/products/carbon/4.2.0/wso2carbon-4.2.0.zip

如何更改wget的默认行为,因此仅使用wget会使用当前Firefox使用的实际 useragent和标头? (也可以将下载的网站的基本URL添加为引荐来源网址很好)

How can I change the default behaviour of wget, so just using wget would use the actual useragent and header my current Firefox is using? (Also adding the base-URL of the downloaded site as referer would be nice)

推荐答案

像这样创建别名:

alias wget='wget --header="Accept: text/html" --user-agent="Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:21.0) Gecko/20100101 Firefox/21.0" --referrer connect.wso2.com'

您可以使用type来显示新的wget别名用作命令名时的解释方式.

You can use type to show how your new wget alias will be interpreted when used as a command name.

type wget
wget is aliased to `wget --header="Accept: text/html" --user-agent="Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:21.0) Gecko/20100101 Firefox/21.0" --referrer connect.wso2.com'

这篇关于在wget中更改默认的USER-AGENT和REFERRER值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆