本文介绍了在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 dist.wso2/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'您可以使用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'更多推荐
在wget中更改默认的USER
发布评论