Advertisement
techblog

cf_ddns_script

Jan 22nd, 2020
207
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.51 KB | None | 0 0
  1. #import requests
  2. #GET_EXT_IP_URL = 'http://ipinfo.io/ip'
  3. #IP = requests.get(self.GET_EXT_IP_URL).text.rstrip()
  4. #print(IP)
  5. from pycfdns import CloudflareUpdater
  6. cfupdate = CloudflareUpdater()
  7. zone = '[zone]'
  8. email = '[cd mail]'
  9. key = '[cf api key]'
  10. records = ['*']
  11.  
  12. headers = cfupdate.set_header(email, key)
  13. zoneid = cfupdate.get_zoneID(headers, zone)
  14. update_records = cfupdate.get_recordInfo(headers, zoneid, zone, records)
  15. result = cfupdate.update_records(headers, zoneid, update_records)
  16. print(result)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement