The output shows that the URL was redirected. The first line of the output tells you that it was moved, and the Location line tells you where:. You could use curl to make another request manually, or you can use the --location or -L argument which tells curl to redo the request to the new location whenever it encounters a redirect.
Give it a try:. You can combine the -L argument with some of the aforementioned arguments to download the file to your local system:. Warning : Many resources online will ask you to use curl to download scripts and execute them. You can learn more by viewing the manual page for curl by running man curl.
Where would you like to share this to? Viewed k times. Improve this question. Thi G. Add a comment. Active Oldest Votes. Use wget instead. Install it with Homebrew: brew install wget or MacPorts: sudo port install wget For downloading files from a directory listing, use -r recursive , -np don't follow links to parent directories , and -k to make links in downloaded HTML or CSS point to local files credit xaccrocheur.
Improve this answer. Lri Lri The trick is to use -k to convert the links images, etc. What should I do? HoseynHeydari : you can use rudix. I have received an URL where the file is located, but the url makes an redirect before reaching the file. The file that should be downloaded is a RAR file, but instead of the file I get the incorrect login page. But I always receive the incorrect login page from the website if I use the above code.
Can anyone see what I am doing wrong here? Stack Overflow for Teams — Collaborate and share knowledge with a private group. Create a free Team What is Teams?
Collectives on Stack Overflow. Learn more. Asked 5 years, 10 months ago. Active 5 years, 2 months ago. Viewed 3k times. As a simple example, the ipify website has an API can be queried to ascertain your external IP address. It returns a JSON object describing a book. You can find these on the back cover of most books, usually below a barcode. Especially if the protocol was one of the many not supported by wget. Browse All iPhone Articles Browse All Mac Articles Do I need one? Browse All Android Articles Browse All Smart Home Articles Customize the Taskbar in Windows Browse All Microsoft Office Articles What Is svchost.
Browse All Privacy and Security Articles Browse All Linux Articles Browse All Buying Guides. Best iPhone 13 Pro Case. Best Bluetooth Headphones for Switch. Best Roku TV. Best Apple Watch. Best iPad Cases. Best Portable Monitors. Best Gaming Keyboards. Best Drones. Best 4K TVs. Best iPhone 13 Cases. Best Tech Gifts for Kids Aged Awesome PC Accessories.
0コメント