mzcyx2011
2016-05-01 22:24:30 +08:00
# -*- coding=utf-8 -*-
import os
import time
from win32com.client import Dispatch
def addTasktoXunlei(down_url,course_infos):
flag = False
o = Dispatch("ThunderAgent.Agent.1")
if down_url:
course_path = os.getcwd()
try:
#AddTask("下载地址", "另存文件名", "保存目录","任务注释","引用地址","开始模式", "只从原始地址下载","从原始地址下载线程数")
o.AddTask(down_url, '', course_path, "", "", -1, 0, 5)
o.CommitTasks()
flag = True
except Exception:
print(Exception.message)
print(" AddTask is fail!")
return flag
我也找过很久,最后找到的这个!!运行前要把迅雷设置为静默下载,这样就不用点击确认再下载