ich versuche seit einigen Tagen, das Fernsteuerinterface einer Behnke Türstation via Python zu programmieren.
Code: Alles auswählen
import requests
import time
URL = "https://tuerstation.ct1n.de:8000/remote.cgi"
session = requests.session()
req = session.get(URL, verify=False, auth=('xx', 'yy'), stream=True)
if req.status_code != requests.codes.ok:
print("HTTPS Statuscode : ", r.status_code, "; Exit.")
exit(1)
try:
while True:
print(req.text)
time.sleep(1)
except KeyboardInterrupt:
pass
except requests.exceptions.StreamConsumedError:
pass
Code: Alles auswählen
--specialBehnkeBoun
--specialBehnkeBoun
--specialBehnkeBoun
....
Code: Alles auswählen
GET /remote.cgi HTTP/1.1
Host: tuerstation.ct1n.de:8000
User-Agent: python-requests/2.21.0
Accept-Encoding: gzip, deflate
Accept: */*
Connection: keep-alive
Authorization: Basic xx
HTTP/1.1 200 OK
Server: Behnke/1.0
Content-Length: 19
Connection: close
Cache-Control: no-cache,no-store
Content-Type: multipart/x-mixed-replace;boundary=specialBehnkeBoundary
--specialBehnkeBoundary
Content-type: text/plain
Welcome
--specialBehnkeBoundary
Content-type: text/plain
call ended 1
--specialBehnkeBoundary
Content-type: text/plain
call ended 1
--specialBehnkeBoundary
Content-type: text/plain
call ended 1
--specialBehnkeBoundary
Content-type: text/plain
call ended 1
--specialBehnkeBoundary
Code: Alles auswählen
Content-type: text/plain
call ended 1
--specialBehnkeBoundary
Vielen Dank schon mal!
Gruß, Thomas