How to differentiate between images and videos in a list of URLs?

I just want to ask if I have a list of URLs and I want to differentiate between images URL, video URLs and ordinary URLs. is there any way that I can classify them? thanks in advance