selfhost: Use dyndns protocol, too.
authorMichael Tremer <michael.tremer@ipfire.org>
Sun, 22 Jun 2014 11:16:44 +0000 (11:16 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Sun, 22 Jun 2014 11:16:44 +0000 (11:16 +0000)
src/ddns/providers.py

index 5d63506..ece4b37 100644 (file)
@@ -745,7 +745,7 @@ class DDNSProviderRegfish(DDNSProvider):
                raise DDNSUpdateError
 
 
-class DDNSProviderSelfhost(DDNSProvider):
+class DDNSProviderSelfhost(DDNSProviderDynDNS):
        INFO = {
                "handle"    : "selfhost.de",
                "name"      : "Selfhost.de",
@@ -753,20 +753,15 @@ class DDNSProviderSelfhost(DDNSProvider):
                "protocols" : ["ipv4",],
        }
 
-       url = "https://carol.selfhost.de/update"
+       url = "https://carol.selfhost.de/nic/update"
 
-       def update(self):
-               data = {
-                       "username" : self.username,
-                       "password" : self.password,
-                       "textmodi" : "1",
-               }
-
-               response = self.send_request(self.url, data=data)
+       def _prepare_request_data(self):
+               data = DDNSProviderDynDNS._prepare_request_data(self)
+               data.update({
+                       "hostname" : "1",
+               })
 
-               match = re.search("status=20(0|4)", response.read())
-               if not match:
-                       raise DDNSUpdateError
+               return data
 
 
 class DDNSProviderSPDNS(DDNSProviderDynDNS):