使用Python来使用IDM(Internet Download Manager)API

2024-09-30 22:20:20 发布

您现在位置:Python中文网/ 问答频道 /正文

我试图通过python使用idmapi,但我完全不知道该怎么做。 http://www.internetdownloadmanager.com/support/idm_api.html

有人能帮帮我吗? 我甚至不知道是否可以用python实现这一点。在


Tags: comapihttpsupporthtmlwwwidm帮帮我
1条回答
网友
1楼 · 发布于 2024-09-30 22:20:20

idmapi似乎可以从visualbasic访问,这很好,因为这意味着它支持IDispatch,因此支持Python。您想使用comtypes库。使用VB sample作为原型:

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)

相关问题 更多 >