gpt4 book ai didi

linux - wget postdata 没有这样的文件或目录

转载 作者:太空宇宙 更新时间:2023-11-04 03:31:58 27 4
gpt4 key购买 nike

"wget --user-agent=Mozilla/5.0 --save-cookies cookies.txt --post-data 'dir="$dir1"=&file="$file1"' --no-check-certificate http://test.com/mp3/file.php"

在命令行中一切正常,但在 shell 脚本中它显示没有这样的文件或目录

wget --user-agent=Mozilla/5.0 --save-cookies cookies.txt --post-data 'dir=L011c2ljYW5fU2luZ2VyL1N1amF0aGEgSGl0cw===&file=S2FhdHJ1IEthYXRydSAtIElzYWlBcnV2aS5OZXQubXAz' --no-check-certificate http://test.com/mp3/file.php : No such file or directory

最佳答案

我不知道 wget 之前的双引号是格式错误 ("wget --user-a ...) 还是实际上是命令的一部分;无论哪种方式,请将其删除。另外,尝试对 URL 进行双引号。这对我在命令行和 shell 脚本中有效:

 wget --user-agent=Mozilla/5.0 --save-cookies cookies.txt --post-data 'dir="$dir1"=&file="$file1"' --no-check-certificate "http://test.com/mp3/file.php"

运行包含以下命令的脚本:

user@box:~$ sh wget_script.sh 
--2016-04-26 14:28:42-- http://test.com/mp3/file.php
Resolving test.com (test.com)... 69.172.200.235
Connecting to test.com (test.com)|69.172.200.235|:80... connected.
HTTP request sent, awaiting response... 302 Moved Temporarily
Location: https://www.test.com/ [following]
--2016-04-26 14:28:42-- https://www.test.com/
Resolving www.test.com (www.test.com)... 69.172.200.235
Connecting to www.test.com (www.test.com)|69.172.200.235|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [text/html]
Saving to: ‘file.php’

[ <=> ] 1,557 --.-K/s in 0s

2016-04-26 14:28:42 (92.4 MB/s) - ‘file.php’ saved [1557]

user@box:~$

关于linux - wget postdata 没有这样的文件或目录,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36864776/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com