gpt4 book ai didi

linux - 使用 wget 或 curl(首选 Wget)下载带有引用目录最后一部分名称的文件,而不是真实文件名

转载 作者:太空宇宙 更新时间:2023-11-04 12:54:54 25 4
gpt4 key购买 nike

比方说,

http://mobile.example.com/vid/flying-birds是一个链接 http://mobile.example.com/vid/22 存在的页面,当我们点击这个链接时,它重定向到 http://v-cdn-r.example.com/mp4/x/y/dfile.mp4?ir=880&int=06 和名为 dfile 的文件。 mp4?ir=880&int=06 已下载。

我想要这个文件名 flying-birds(来自首页 url)。我试过用 wget 函数来做这件事,

--default-page=name

用命令

wget -r -l1 --default-page=name http://mobile.example.com/vid/flying-birds

但下载的文件名现在是 22(来自第二个链接)而不是我预期的 flying-birds

i have more than one links and each link has different keywords than flying-birds. in simple, there is lots of directory with different-different directory name.

最佳答案

你可以尝试这样的事情:

wget -r -l1 -O $(basename http://mobile.example.com/vid/flying-birds) http://mobile.example.com/vid/flying-birds

请参阅此帖子以获取 How to wget a file with correct name when redirected? .

关于linux - 使用 wget 或 curl(首选 Wget)下载带有引用目录最后一部分名称的文件,而不是真实文件名,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36056601/

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