在wget中更改默认的USER

编程入门 行业动态 更新时间:2024-10-28 07:29:11
本文介绍了在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

本文发布于:2023-11-12 17:09:49,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1582054.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:wget   USER

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!