diff --git a/constants/regex.py b/constants/regex.py index 23e3025..cecaf8c 100644 --- a/constants/regex.py +++ b/constants/regex.py @@ -1,5 +1,5 @@ WEBHOOK_REGEX = r"(https?:\/\/.*discord(app)?\.com\/api\/webhooks\/\d+\/.{68})" -WEBHOOK_REGEX_BASE64 = r"(aHR0cHM6Ly9[\d\w]+==)" +WEBHOOK_REGEX_BASE64 = r"(aHR0cHM6Ly9[A-Za-z0-9\-_]+={0,2})" TELEGRAM_REGEX = r"([0-9]{10}:[a-zA-Z0-9]{35})" TELEGRAM_REGEX_BASE64 = r"([MNZO][A-Za-z0-9+/=]{30,})\x00" -DISCORD_TOKEN_MATCHER = r"[MNZO]\w{25}\.\w{6}\.[A-Za-z0-9\-_]{38}" +DISCORD_TOKEN_MATCHER = r"[MNZO][A-Za-z0-9\-_]{25}\.[A-Za-z0-9\-_]{6}\.[A-Za-z0-9\-_]{38}" diff --git a/utils/webhook_util.py b/utils/webhook_util.py index 4d621c9..df90e2b 100644 --- a/utils/webhook_util.py +++ b/utils/webhook_util.py @@ -16,10 +16,10 @@ def validate_and_delete_webhook(webhook: str) -> bool: logger.debug(f'Webhook status code: {webhook_status_code}') if webhook_status_code <= 205: logger.info(f"webhook: {webhook} is valid!") - result = delete(webhook, headers={"Content-Type": "application/json"}) - logger.success( - f"Webhook {webhook} is retrieved successfully and deleted!! {result.status_code}" - ) + # result = delete(webhook, headers={"Content-Type": "application/json"}) + # logger.success( + # f"Webhook {webhook} is retrieved successfully and deleted!! {result.status_code}" + # ) return True