def is_registered(domain: str, skip_raise: bool = False) -> bool:
logger.debug("domain='%s',skip_raise='%s' - CALLED!", domain, skip_raise)
- domain_helper.raise_on(domain)
+
+ if not skip_raise:
+ domain_helper.raise_on(domain)
if blacklist.is_blacklisted(domain):
raise RuntimeError(f"domain='{domain}' is blacklisted but function has been invoked")
elif not isinstance(skip_raise, bool):
raise TypeError(f"skip_raise[]='{type(skip_raise)}' is not type of 'bool'")
- if not skip_raise:
- domain_helper.raise_on(domain)
-
logger.debug("domain='%s' - CALLED!", domain)
if not cache.key_exists("is_registered"):
logger.debug("Cache for 'is_registered' not initialized, fetching all rows ...")
logger.info("Checking/converting %d domain names ...", len(rows))
for row in rows:
logger.debug("row[]='%s'", type(row))
- if row[column] in [None, ""]:
+ if column not in row:
+ logger.warning("row()=%d does not contain column='%s' - SKIPPED!", len(row), column)
+ continue
+ elif row[column] in [None, ""]:
logger.warning("row[%s]='%s' is empty - SKIPPED!", column, row[column])
continue
elif not validators.domain(row[column].split("/")[0], rfc_2782=True):
logger.debug("row[%s]='%s' has an unwanted TLD - SKIPPED!", column, row[column])
continue
+ logger.debug("row[%s]='%s' - BEFORE!", column, row[column])
punycode = domain_helper.encode_idna(row[column])
- logger.debug("punycode='%s',row[%s]='%s'", punycode, column, row[column])
+ logger.debug("punycode[%s]='%s' - AFTER!", type(punycode), punycode)
if punycode != row[column]:
- logger.info("punycode row[%s]='%s' to '%s'", column, row[column], punycode)
+ logger.info("row[%s]='%s',punycode'%s'", column, row[column], punycode)
if is_registered(punycode, True):
logger.warning("Deleting row[%s]='%s' as punycode='%s' already exist", column, row[column], punycode)
delete(row[column], column)