结合使用IDM(Internet Download Manager)API和python [英] Use IDM(Internet Download Manager) API with python

查看:289
本文介绍了结合使用IDM(Internet Download Manager)API和python的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试通过python使用IDM api,但是我完全不知道该怎么做. http://www.internetdownloadmanager.com/support/idm_api.html

I am trying to use the IDM api through python but I'm completely lost on how i would do this. http://www.internetdownloadmanager.com/support/idm_api.html

有人可以帮我吗?我什至不知道是否可以使用python做到这一点.

Could someone please help me? I don't even know if it is possible to do this with python.

推荐答案

似乎可以从Visual Basic访问IDM api,这很好,因为它表示它支持IDispatch,因此支持Python.您想使用 comtypes 库.使用 VB示例作为原型:

The IDM api seems to be accessible from Visual Basic, which is good, because it means that it supports IDispatch and therefore Python. You want to use the comtypes library. Using the VB sample as a prototype:

import comtypes.client as cc
import comtypes

referrer = ""
cookie = ""
postData = ""
user = ""
password = ""
cc.GetModule(["{PUT_UUID_HERE}",1,0])
# not sure about the syntax here, but cc.GetModule will tell you the name of the wrapper it generated
import comtypes.gen.IDManLib as IDMan
idm1 = cc.CreateObject("IDMan.CIDMLinkTransmitter", None, None, IDMan.ICIDMLinkTransmitter2)
idm1.SendLinkToIDM("http://www.internetdownloadmanager.com/idman401.exe",
referrer, cookie, postData, user, password, r"C:\\", "idman401.exe", 0)

这篇关于结合使用IDM(Internet Download Manager)API和python的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆