Wget

如何在終端中下載連結重定向並且似乎僅在 GUI 中工作的文件?

  • November 23, 2017

我正在想辦法下載這個文件:

zoiper5_5.2.6_x86_64.tar.xz

從這個連結:

https://www.zoiper.com/en/voip-softphone/download/zoiper5/for/linux

分別來自這個網頁:

https://www.zoiper.com/en/voip-softphone/download/current

其中man需要點擊Linux下載->免費->tar.xz包。


我試過的:

curl -JLO https://www.zoiper.com/en/voip-softphone/download/zoiper5/for/linux

wget --user-agent=Mozilla --content-disposition -E -c https://www.zoiper.com/en/voip-softphone/download/zoiper5/for/linux

PS:如果您下載文件,請注意它實際上是bz2文件。有點瘋狂,我知道:-)

要下載該文件,您需要一個名為PHPSESSID.

首先,保存 cookie:

curl \
 -c cookie.txt \
 -o /dev/null \
 https://www.zoiper.com/en/voip-softphone/download/current

然後,使用該 cookie 並下載文件:

curl \
 -b cookie.txt \
 -o zoiper5_5.2.6_x86_64.tar.xz \
 https://www.zoiper.com/en/voip-softphone/download/zoiper5/for/linux

您也可以使用程序替換來避免寫入 cookie 文件:

curl -b <( curl -c - -o /dev/null https://www.zoiper.com/en/voip-softphone/download/current ) -o zoiper5_5.2.6_x86_64.tar.xz https://www.zoiper.com/en/voip-softphone/download/zoiper5/for/linux

引用自:https://unix.stackexchange.com/questions/406462