Introduction

wget and curl, are great Linux operating system commands to download files. But you may face problems when all you have is a dynamic url.

Static url and Dynamic url

From: http://www.webconfs.com/dynamic-urls-vs-static-urls-article-3.php We have:

There are two types of URLs: dynamic and static. A dynamic URL is a page address that results from the search of a database-driven web site or the URL of a web site that runs a script. In contrast to static URLs, in which the contents of the web page stay the same unless the changes are hard-coded into the HTML, dynamic URLs are generated from specific queries to a site's database. The dynamic page is basically only a template in which to display the results of the database query. Instead of changing information in the HTML code, the data is changed in the database.

Example of static url

http://www.somesites.com/forums/the-challenges-of-dynamic-urls.htm

Example of dynamic url

http://www.somesites.com/forums/thread.php?threadid=12345&sort=date

Downloading files using wget from dynamic url

So, to download a file when it is pointed by a dynamic url, all you need to to is to use single quotes for the url. Like this:

wget 'http://some.site.com/download?id=234&status=download'

It would also be a good idea to specify the output filename so, the best way is:

wget 'http://some.site.com/download?id=234&status=download' -O output_filename