add support dns.he.net

This commit is contained in:
Pavel Muhortov 2022-04-19 17:06:52 +03:00
parent dffc712c8f
commit de50db59d5

View File

@ -87,6 +87,8 @@ class HEupdate:
:param rec_val: string with record value
:return: None, Message after request
"""
if rec_key[-1] == '.':
rec_key = rec_key[:-1]
self._data = 'hostname=' + rec_key + '&' + 'password=' + self._ddnskey + '&' + 'txt=' + rec_val
request = urllib.request.Request(url=self._server, data=bytes(self._data.encode('utf-8')), method='POST')
response = urllib.request.urlopen(request).read()