I tried to download some files in batches some time ago, but I found that no one has ever written this on the Internet. Although Thunder can set batch download rules, it is relatively simple, you can only generate up to 999 tasks. Finally, I found an article on CSDN that used C language and thunder to implement batch resource download. So I modified the source code and solved my problem.
My goal is to download thousands of files in batches. The file addresses are from http: // URL/0001.zip to http: // URL/9999.zip. so I learned from the ideas in this article, write one by yourself. In fact, my problem is simpler than that of the author, because he needs to set three variables, and I only need one. The main method is to use the C language to batch write strings to the file, and then open the string and then use the bulk download function of thunder.
The source code I wrote is as follows:
/*
* Powered by 90blog.org
*/
# Include <stdio. h>
Void trans (char * c, int I)
{
If (I> = 0 & I <10)
{
Sprintf (c, "000% d", I );
}
Else if (I <100)
{
Sprintf (c, "00% d", I );
}
Else if (I <1000)
{
Sprintf (c, "0% d", I );
}
Else
{
Sprintf (c, "% d", I );
}
}
Int main (int argc, char * argv [])
{
Char buff [100];
Char c [5] = "0001 ";
FILE * fp;
Int I = 1;
Int Max = 9999;
Fp = fopen ("download.htm", "w ");
Fputs ("For (I = 1; I <= Max; I ++)
{
Trans (c, I );
Sprintf (buff, "<p> <a href = \" http: // URL/%s.zip/\ "> % s </a> </p> \ n ", c, c );
Fputs (buff, fp );
Puts (buff );
}
Fputs ("Puts ("write OK ");
Fclose (fp );
Return 0;
}
After running, an HTML file is generated directly. After opening the file, you can right-click and download all the links with thunder. A few thousands of tasks are directly added, but thunder is not stuck, and QQ tornado has no response. From this point of view, Thunder is more powerful than QQ tornado in this aspect.
This method can be used to directly download resources in batches, but it seems that in Linux, you can directly use commands to write the addresses to files in batches and then download them in batches. However, I won't, so this method is the only option.
From post-90 blogs