hirad000
شنبه 26 دی 1394, 11:42 صبح
سلام دوستان
می خوام ی تیم ساده با پایتون بنویسم که حداقل بشه دسکتاپ ریموت رو دید. یا مثلا ی کلاینت و سرور تو ی کامپیوتر نوشت که بشه صفحه ی اونو دید.. میشه بگید برای این باید از چه ماژولی استفاده کرد؟ اصلا ماژول آماده ای هست ؟
مثلا همچین کدی پیدا کردم ولی نمیدونم چجوری باید اجرا کنم؟
import http.client
conn = http.client.HTTPSConnection("webapi.teamviewer.com")
headers = {
'authorization': "Bearer xxxxxxx-xxxxxxxxxxx",
'cache-control': "no-cache",
'postman-token': "xxxxx-xxxx-xxxx-xxxx-xxxxxxxxx",
'content-type': "application/x-www-form-urlencoded"
}
ids = [35123241, 234234234, 1232312, 5644352, 234243234]
pws = ["47gj6", "fgdg6as", "saa23d", "a24asd", "gre42as"]
for i in range(len(ids)):
payload = "remotecontrol_id=r%s&groupid=g18932019&alias=%s&password=%s" % (ids[i], ids[i], pws[i])
conn.request("POST", "/api/v1/devices", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
می خوام ی تیم ساده با پایتون بنویسم که حداقل بشه دسکتاپ ریموت رو دید. یا مثلا ی کلاینت و سرور تو ی کامپیوتر نوشت که بشه صفحه ی اونو دید.. میشه بگید برای این باید از چه ماژولی استفاده کرد؟ اصلا ماژول آماده ای هست ؟
مثلا همچین کدی پیدا کردم ولی نمیدونم چجوری باید اجرا کنم؟
import http.client
conn = http.client.HTTPSConnection("webapi.teamviewer.com")
headers = {
'authorization': "Bearer xxxxxxx-xxxxxxxxxxx",
'cache-control': "no-cache",
'postman-token': "xxxxx-xxxx-xxxx-xxxx-xxxxxxxxx",
'content-type': "application/x-www-form-urlencoded"
}
ids = [35123241, 234234234, 1232312, 5644352, 234243234]
pws = ["47gj6", "fgdg6as", "saa23d", "a24asd", "gre42as"]
for i in range(len(ids)):
payload = "remotecontrol_id=r%s&groupid=g18932019&alias=%s&password=%s" % (ids[i], ids[i], pws[i])
conn.request("POST", "/api/v1/devices", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))