Fixed `tg_validate_url()` function with fallback to get URL