GetFileNameFromURL is a ComfyUI custom node that extracts the filename from a URL. It can handle various URLs and is capable of handling redirects.
https://github.com/githubYiheng/ComfyUI_GetFileNameFromURL
git clone https://github.com/githubYiheng/ComfyUI_GetFileNameFromURL
comfy node install ComfyUI_GetFileNameFromURL