Parse the waiting time from the exception

def parse_wait_time(text: str) -> int:
    """Parse the waiting time from the exception"""
    val = RATELIMIT.findall(text)
    if len(val) > 0:
        try:
            res = val[0]
            if res[1] == 'minutes':
                return int(res[0]) * 60

            if res[1] == 'seconds':
                return int(res[0])
        except Exception as e:
            util_logger.warning('Could not parse ratelimit: ' + str(e))
    return 1 * 60