X-Git-Url: http://git.ipfire.org/?p=ddns.git;a=blobdiff_plain;f=ddns%2Fproviders.py;h=124cf2f8280e7618759725d733b0d3573492025a;hp=f3230fc0d1ee5d47c79c1e379de248aa756e170d;hb=2de06f59af10a7c76145fbb7bfb02ec3ef432d35;hpb=f22ab0851f894136823df166d03d80cf7f4646b7 diff --git a/ddns/providers.py b/ddns/providers.py index f3230fc..124cf2f 100644 --- a/ddns/providers.py +++ b/ddns/providers.py @@ -1,4 +1,23 @@ #!/usr/bin/python +############################################################################### +# # +# ddns - A dynamic DNS client for IPFire # +# Copyright (C) 2012 IPFire development team # +# # +# This program is free software: you can redistribute it and/or modify # +# it under the terms of the GNU General Public License as published by # +# the Free Software Foundation, either version 3 of the License, or # +# (at your option) any later version. # +# # +# This program is distributed in the hope that it will be useful, # +# but WITHOUT ANY WARRANTY; without even the implied warranty of # +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # +# GNU General Public License for more details. # +# # +# You should have received a copy of the GNU General Public License # +# along with this program. If not, see . # +# # +############################################################################### # Import all possible exception types. from .errors import * @@ -114,18 +133,21 @@ class DDNSProviderNOIP(DDNSProvider): # here: http://www.no-ip.com/integrate/request and # here: http://www.no-ip.com/integrate/response - url = "http://%(username)s:%(password)s@dynupdate.no-ip.com/nic/update?hostname=%(hostname)s&myip=%(address)s" + url = "http://%(username)s:%(password)s@dynupdate.no-ip.com/nic/update" def __call__(self): url = self.url % { - "hostname" : self.hostname, "username" : self.username, "password" : self.password, + } + + data = { + "hostname" : self.hostname, "address" : self.get_address("ipv4"), } # Send update to the server. - response = self.send_request(url) + response = self.send_request(url, data=data) # Get the full response message. output = response.read() @@ -154,12 +176,16 @@ class DDNSProviderSelfhost(DDNSProvider): "protocols" : ["ipv4",], } - url = "https://carol.selfhost.de/update?username=%(username)s&password=%(password)s&textmodi=1" + url = "https://carol.selfhost.de/update" def __call__(self): - url = self.url % { "username" : self.username, "password" : self.password } + data = { + "username" : self.username, + "password" : self.password, + "textmodi" : "1", + } - response = self.send_request(url) + response = self.send_request(self.url, data=data) match = re.search("status=20(0|4)", response.read()) if not match: