Recently, I was writing a collection program that needed to download the attachments of the target site. However, the file download speed of the target site was very slow, so I thought about whether I could call Thunder to download. This is very easy to implement, but there is a problem. Every time a task is added, Thunder's The dialog box has to pop up once, which is very inconvenient. While Xiaofeng was sleeping, I tried it and removed the dialog box. The method is as follows:
The first is the script, which is written in different languages. Here I provide one written in VBS:
Copy the code code as follows:
Set ThunderAgent = CreateObject(ThunderAgent.Agent.1)
Call ThunderAgent.AddTask(http://www.vevb.com/files/bjhyn.mp3,Beijing welcomes you.mp3,c:/a/,,http://www.readlog.cn,1,0,5)
Call ThunderAgent.CommitTasks2(1)
Call ThunderAgent.AddTask(http://file.fzone.cn/upload2/hompyFile/2007/28/921524670987.wma, sheepherding star.wma,c:/a/b/c/,,http://www. vevb.com,1,0,5)
Call ThunderAgent.CommitTasks2(1)
Set ThunderAgent = Nothing
Then start Thunder, go to Tools--Configuration--Advanced, and uncheck the option in front of the option to use Thunder download to add tasks through the IE right-click menu.
Keep Thunder turned on. If you execute the above script at this time, the dialog box to confirm adding the task will not appear.
Attachment: The AddTask method is used. The parameters of this method are as follows: AddTask (download address, save file name, save directory, task comment, reference address, start mode, download only from the original address, download thread number from the original address).
Parameter name meaning
pURL target URL, required parameters
pFileName save name, the default is empty, indicating that it will be processed by Xunlei, optional parameter
pPath storage directory, empty by default, indicating that it will be processed by Xunlei, optional parameter
pComments download comments, empty by default, optional parameters
pReferURL reference page URL, empty by default, optional parameter
nStartMode start mode, 0 starts manually, 1 starts immediately, the default is -1, which means it will be processed by Thunder, optional parameter
nOnlyFromOrigin Whether to only download from the original URL, 1 only downloads from the original URL, 0 downloads from multiple resources, the default is 0, optional parameter
nOriginThreadCount The number of original address download threads, range 1-10, default is -1, indicating that it is processed by Thunder, optional parameter