maxisoft / Freenom-dns-updater

A tool to update freenom's dns records
MIT License
168 stars 48 forks source link

Update error #17

Closed tib-kpl closed 4 years ago

tib-kpl commented 5 years ago

Hello,

I've been using freenom-dns-updater for a while to update my ip in my dns and for some time I have this error when I did not have it before. Can you help me ?

Traceback (most recent call last): File "fdu.py", line 318, in cli() File "/home/tib-kpl/.local/lib/python2.7/site-packages/click/core.py", line 764, in call return self.main(args, kwargs) File "/home/tib-kpl/.local/lib/python2.7/site-packages/click/core.py", line 717, in main rv = self.invoke(ctx) File "/home/tib-kpl/.local/lib/python2.7/site-packages/click/core.py", line 1137, in invoke return _process_result(sub_ctx.command.invoke(sub_ctx)) File "/home/tib-kpl/.local/lib/python2.7/site-packages/click/core.py", line 1137, in invoke return _process_result(sub_ctx.command.invoke(sub_ctx)) File "/home/tib-kpl/.local/lib/python2.7/site-packages/click/core.py", line 956, in invoke return ctx.invoke(self.callback, ctx.params) File "/home/tib-kpl/.local/lib/python2.7/site-packages/click/core.py", line 555, in invoke return callback(args, **kwargs) File "fdu.py", line 156, in record_update ok_count, err_count = record_action(lambda freenom, rec: freenom.add_record(rec, True), config, False) File "fdu.py", line 252, in record_action action(freenom, rec) File "fdu.py", line 156, in ok_count, err_count = record_action(lambda freenom, rec: freenom.add_record(rec, True), config, False) File "/usr/local/lib/python2.7/dist-packages/freenom_dns_updater/freenom.py", line 64, in add_record return self.update_record(record, records=records) File "/usr/local/lib/python2.7/dist-packages/freenom_dns_updater/freenom.py", line 115, in update_record raise UpdateError([e.text for e in errs], record, records) freenom_dns_updater.exception.update_error.UpdateError

Gribnif commented 5 years ago

It looks like freenom changed the way their update process works a tiny bit. Now, if there is no change, an "error" with the text "There were no changes" is returned. The solution is to change the code around line 115 to:

        errs = soup.find_all(attrs={'class': 'dnserror'})
        if errs:
            for e in errs:
                if e.text != "There were no changes":
                    raise UpdateError(e.text, record, records)

There's probably a more elegant way to do this, but my Python skills aren't the greatest.

tib-kpl commented 5 years ago

thank you so much

Gribnif commented 5 years ago

I am glad this worked for you. Please reopen this issue so that the program's author knows this problem exists and applies a permanent fix to the code. (I would do it, but apparently Github won't let me.)

maxisoft commented 4 years ago

Should be fixed by #23