Syc 大佬有话说 :
【干活】通过脚本代码控制迅雷添加下载任务
#前提
【哪个版本的迅雷可以用脚本控制添加和删除任务?】
https://www.hostloc.com/forum.php?mod=viewthread&tid=725619
本文来源:https://php.wf/archives/remote-download-by-controlling-xunlei-with-com-object.html
IE时代,迅雷下载会在IE中注册并加载COM控件ThunderAgent.dll,使用Js调起对象ThunderAgent.Agent.1实现添加下载任务。
以下为官方JS调用函数,其他语言只要能链接COM库的,均参照此函数构建即可。
function AddLink(Url,Info,Location,strCID,strStatUrl,strCookie,strCharset)
{
if (Url != "")
{
if (Info == "")
{
Info = "unknown";
}
try
{
var ThunderAgent = new ActiveXObject("ThunderAgent.Agent");
}
catch(e)
{
ThunderAgent = new ActiveXObject("ThunderAgent.Agent64");
}
try
{
ThunderAgent.AddTask12(Url, "", "", Info, Location, strCharset, -1, 0, -1,strCookie, strCID, strStatUrl, 0, "rightup");
}
catch(e)
{
try
{
ThunderAgent.AddTask5(Url, "", "", Info, Location, -1, 0, -1,strCookie, strCID, strStatUrl, 1, "", -1);
}
catch(e)
{
ThunderAgent.AddTask2(Url, "", "", Info, Location, -1, 0, -1,strCookie);
}
}
ThunderAgent.CommitTasks2(1);
}
}
https://shitu-query-gz.gz.bcebos.com/2020-08-02/16/1b043ac4790ccc13?authorization=bce-auth-v1%2F7e22d8caf5af46cc9310f1e3021709f3%2F2020-08-02T16%3A52%3A56Z%2F300%2Fhost%2Fe1f0f1b524bd9f62f0bd3ef51922b185808e98a5c60e9c9b63d4b997ac58d496https://cdn.jsdelivr.net/gh/hishis/forum-master/public/images/patch.gif
h20 大佬有话说 :
干货 不是 干活