How to use the tld.utils.update_tld_names function in tld

To help you get started, we’ve selected a few tld examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github cornerpirate / iRecon / iRecon.py View on Github external
def run(self):
	
		# sync top level domains with mozilla if the user is root
		if os.geteuid() == 0:
			update_tld_names()
		else:
			print "Not running as root, you are going to need those privs to nmap properly"
			sys.exit(-1)
		
		# try to resolve ip
		if self._isHostname:
			try:
				self._ip = socket.gethostbyname(self._target)
			except:
				print "== Error on resolving IP check that hostname resolves: "
				print sys.exc_info()
				sys.exit(-1)
		else:
			self._ip = self._target
		
		# Iterate through plugins which require a hostname to be passed	
github barseghyanartur / tld / src / tld / commands / update_tld_names.py View on Github external
def main():
    """Updates TLD names.

    :example:

        python src/tld/commands/update_tld_names.py
    """

    try:
        print(do_update_tld_names())
    except Exception as err:
        print(err)

tld

Extract the top-level domain (TLD) from the URL given.

MPL-1.1 OR GPL-2.0-only OR LG…
Latest version published 2 years ago

Package Health Score

78 / 100
Full package analysis