Use IDM(Internet Download Manager) API with python

僤鯓⒐⒋嵵緔 提交于 2021-01-24 12:28:21

问题


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

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


回答1:


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)


来源:https://stackoverflow.com/questions/22587681/use-idminternet-download-manager-api-with-python

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!